From 782417b1fa48e693acf45abe2c60776312fd44ec Mon Sep 17 00:00:00 2001 From: Tereza Tomcova Date: Fri, 18 Nov 2016 21:28:24 +0100 Subject: [PATCH] Added tests for BrowserWindow.setAppDetails --- spec/api-browser-window-spec.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index cdfdb38442..c2f6260c10 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -518,6 +518,34 @@ describe('browser-window module', function () { }) }) + describe('BrowserWindow.setAppDetails(options)', function () { + if (process.platform !== 'win32') return + + it('supports setting the app details', function () { + const iconPath = path.join(fixtures, 'assets', 'icon.ico') + + assert.doesNotThrow(function () { + w.setAppDetails({appId: 'my.app.id'}) + w.setAppDetails({appIconPath: iconPath, appIconIndex: 0}) + w.setAppDetails({appIconPath: iconPath}) + w.setAppDetails({relaunchCommand: 'my-app.exe arg1 arg2', relaunchDisplayName: 'My app name'}) + w.setAppDetails({relaunchCommand: 'my-app.exe arg1 arg2'}) + w.setAppDetails({relaunchDisplayName: 'My app name'}) + w.setAppDetails({ + appId: 'my.app.id', + appIconPath: iconPath, + appIconIndex: 0, + relaunchCommand: 'my-app.exe arg1 arg2', + relaunchDisplayName: 'My app name' + }) + w.setAppDetails({}) + }) + assert.throws(function () { + w.setAppDetails() + }, /Insufficient number of arguments./) + }) + }) + describe('BrowserWindow.fromId(id)', function () { it('returns the window with id', function () { assert.equal(w.id, BrowserWindow.fromId(w.id).id)