"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spec-main/api-app-spec.ts" between
electron-11.0.1.tar.gz and electron-11.0.2.tar.gz

About: Electron is a framework for creating native cross platform applications with web technologies like JavaScript, HTML, and CSS.

api-app-spec.ts  (electron-11.0.1):api-app-spec.ts  (electron-11.0.2)
skipping to change at line 607 skipping to change at line 607
}); });
}); });
}); });
describe('app.get/setLoginItemSettings API', function () { describe('app.get/setLoginItemSettings API', function () {
const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update .exe'); const updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update .exe');
const processStartArgs = [ const processStartArgs = [
'--processStart', `"${path.basename(process.execPath)}"`, '--processStart', `"${path.basename(process.execPath)}"`,
'--process-start-args', '"--hidden"' '--process-start-args', '"--hidden"'
]; ];
const regAddArgs = [
'ADD',
'HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupAppr
oved\\Run',
'/v',
'additionalEntry',
'/t',
'REG_BINARY',
'/f',
'/d'
];
before(function () { before(function () {
if (process.platform === 'linux' || process.mas) this.skip(); if (process.platform === 'linux' || process.mas) this.skip();
}); });
beforeEach(() => { beforeEach(() => {
app.setLoginItemSettings({ openAtLogin: false }); app.setLoginItemSettings({ openAtLogin: false });
app.setLoginItemSettings({ openAtLogin: false, path: updateExe, args: proc essStartArgs }); app.setLoginItemSettings({ openAtLogin: false, path: updateExe, args: proc essStartArgs });
app.setLoginItemSettings({ name: 'additionalEntry', openAtLogin: false });
}); });
afterEach(() => { afterEach(() => {
app.setLoginItemSettings({ openAtLogin: false }); app.setLoginItemSettings({ openAtLogin: false });
app.setLoginItemSettings({ openAtLogin: false, path: updateExe, args: proc essStartArgs }); app.setLoginItemSettings({ openAtLogin: false, path: updateExe, args: proc essStartArgs });
app.setLoginItemSettings({ name: 'additionalEntry', openAtLogin: false });
}); });
ifit(process.platform !== 'win32')('sets and returns the app as a login item ', function () { ifit(process.platform !== 'win32')('sets and returns the app as a login item ', function () {
app.setLoginItemSettings({ openAtLogin: true }); app.setLoginItemSettings({ openAtLogin: true });
expect(app.getLoginItemSettings()).to.deep.equal({ expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true, openAtLogin: true,
openAsHidden: false, openAsHidden: false,
wasOpenedAtLogin: false, wasOpenedAtLogin: false,
wasOpenedAsHidden: false, wasOpenedAsHidden: false,
restoreState: false restoreState: false
}); });
}); });
ifit(process.platform === 'win32')('sets and returns the app as a login item (windows)', function () { ifit(process.platform === 'win32')('sets and returns the app as a login item (windows)', function () {
app.setLoginItemSettings({ openAtLogin: true }); app.setLoginItemSettings({ openAtLogin: true, enabled: true });
expect(app.getLoginItemSettings()).to.deep.equal({ expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true, openAtLogin: true,
openAsHidden: false, openAsHidden: false,
wasOpenedAtLogin: false, wasOpenedAtLogin: false,
wasOpenedAsHidden: false, wasOpenedAsHidden: false,
restoreState: false, restoreState: false,
executableWillLaunchAtLogin: true, executableWillLaunchAtLogin: true,
launchItems: [{ launchItems: [{
name: 'electron.app.Electron', name: 'electron.app.Electron',
path: process.execPath, path: process.execPath,
args: [], args: [],
scope: 'user', scope: 'user',
enabled: true enabled: true
}] }]
}); });
app.setLoginItemSettings({ openAtLogin: false });
app.setLoginItemSettings({ openAtLogin: true, enabled: false });
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true,
openAsHidden: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false,
executableWillLaunchAtLogin: false,
launchItems: [{
name: 'electron.app.Electron',
path: process.execPath,
args: [],
scope: 'user',
enabled: false
}]
});
}); });
ifit(process.platform !== 'win32')('adds a login item that loads in hidden m ode', function () { ifit(process.platform !== 'win32')('adds a login item that loads in hidden m ode', function () {
app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true }); app.setLoginItemSettings({ openAtLogin: true, openAsHidden: true });
expect(app.getLoginItemSettings()).to.deep.equal({ expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: true, openAtLogin: true,
openAsHidden: process.platform === 'darwin' && !process.mas, // Only ava ilable on macOS openAsHidden: process.platform === 'darwin' && !process.mas, // Only ava ilable on macOS
wasOpenedAtLogin: false, wasOpenedAtLogin: false,
wasOpenedAsHidden: false, wasOpenedAsHidden: false,
restoreState: false restoreState: false
skipping to change at line 779 skipping to change at line 809
executableWillLaunchAtLogin: true, executableWillLaunchAtLogin: true,
launchItems: [{ launchItems: [{
name: 'electron.app.Electron', name: 'electron.app.Electron',
path: process.execPath, path: process.execPath,
args: [], args: [],
scope: 'user', scope: 'user',
enabled: true enabled: true
}] }]
}); });
}); });
ifit(process.platform === 'win32')('finds launch items independent of args',
function () {
app.setLoginItemSettings({ openAtLogin: true, args: ['arg1'] });
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', ena
bled: false, args: ['arg2'] });
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: false,
openAsHidden: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false,
executableWillLaunchAtLogin: true,
launchItems: [{
name: 'additionalEntry',
path: process.execPath,
args: ['arg2'],
scope: 'user',
enabled: false
}, {
name: 'electron.app.Electron',
path: process.execPath,
args: ['arg1'],
scope: 'user',
enabled: true
}]
});
});
ifit(process.platform === 'win32')('finds launch items independent of path q
uotation or casing', function () {
const expectation = {
openAtLogin: false,
openAsHidden: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false,
executableWillLaunchAtLogin: true,
launchItems: [{
name: 'additionalEntry',
path: 'C:\\electron\\myapp.exe',
args: ['arg1'],
scope: 'user',
enabled: true
}]
};
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', ena
bled: true, path: 'C:\\electron\\myapp.exe', args: ['arg1'] });
expect(app.getLoginItemSettings({ path: '"C:\\electron\\MYAPP.exe"' })).to
.deep.equal(expectation);
app.setLoginItemSettings({ openAtLogin: false, name: 'additionalEntry' });
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', ena
bled: true, path: '"C:\\electron\\MYAPP.exe"', args: ['arg1'] });
expect(app.getLoginItemSettings({ path: 'C:\\electron\\myapp.exe' })).to.d
eep.equal({
...expectation,
launchItems: [
{
name: 'additionalEntry',
path: 'C:\\electron\\MYAPP.exe',
args: ['arg1'],
scope: 'user',
enabled: true
}
]
});
});
ifit(process.platform === 'win32')('detects disabled by TaskManager', async
function () {
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', ena
bled: true, args: ['arg1'] });
const appProcess = cp.spawn('reg', [...regAddArgs, '0300000000000000000000
00']);
await emittedOnce(appProcess, 'exit');
expect(app.getLoginItemSettings()).to.deep.equal({
openAtLogin: false,
openAsHidden: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false,
executableWillLaunchAtLogin: false,
launchItems: [{
name: 'additionalEntry',
path: process.execPath,
args: ['arg1'],
scope: 'user',
enabled: false
}]
});
});
ifit(process.platform === 'win32')('detects enabled by TaskManager', async f
unction () {
const expectation = {
openAtLogin: false,
openAsHidden: false,
wasOpenedAtLogin: false,
wasOpenedAsHidden: false,
restoreState: false,
executableWillLaunchAtLogin: true,
launchItems: [{
name: 'additionalEntry',
path: process.execPath,
args: ['arg1'],
scope: 'user',
enabled: true
}]
};
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', ena
bled: false, args: ['arg1'] });
let appProcess = cp.spawn('reg', [...regAddArgs, '020000000000000000000000
']);
await emittedOnce(appProcess, 'exit');
expect(app.getLoginItemSettings()).to.deep.equal(expectation);
app.setLoginItemSettings({ openAtLogin: true, name: 'additionalEntry', ena
bled: false, args: ['arg1'] });
appProcess = cp.spawn('reg', [...regAddArgs, '000000000000000000000000']);
await emittedOnce(appProcess, 'exit');
expect(app.getLoginItemSettings()).to.deep.equal(expectation);
});
}); });
ifdescribe(process.platform !== 'linux')('accessibilitySupportEnabled property ', () => { ifdescribe(process.platform !== 'linux')('accessibilitySupportEnabled property ', () => {
it('with properties', () => { it('with properties', () => {
it('can set accessibility support enabled', () => { it('can set accessibility support enabled', () => {
expect(app.accessibilitySupportEnabled).to.eql(false); expect(app.accessibilitySupportEnabled).to.eql(false);
app.accessibilitySupportEnabled = true; app.accessibilitySupportEnabled = true;
expect(app.accessibilitySupportEnabled).to.eql(true); expect(app.accessibilitySupportEnabled).to.eql(true);
}); });
 End of changes. 6 change blocks. 
1 lines changed or deleted 157 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)