tests: fix failing WOA tests

tests: fix startDrag for WOA

tests: fix early-in-memory-session-create crash test on WOA

ci: cleanup user app data directories on WOA
This commit is contained in:
John Kleinschmidt
2020-08-17 16:04:02 -04:00
parent 2d502b8ac6
commit 43106d28d8
4 changed files with 10 additions and 3 deletions

View File

@@ -87,7 +87,11 @@ steps:
- powershell: |
Get-Process | Where Name Like "electron*" | Stop-Process
Get-Process | Where Name Like "MicrosoftEdge*" | Stop-Process
Get-Process | Where Name Like "msedge*" | Stop-Process
displayName: 'Kill processes left running from last test run'
condition: always()
- powershell: |
Remove-Item -path $env:APPDATA/Electron* -Recurse
displayName: 'Delete user app data directories'
condition: always()

View File

@@ -12,6 +12,7 @@ import { ifdescribe, ifit, delay, defer } from './spec-helpers';
const pdfjs = require('pdfjs-dist');
const fixturesPath = path.resolve(__dirname, '..', 'spec', 'fixtures');
const mainFixturesPath = path.resolve(__dirname, 'fixtures');
const features = process._linkedBinding('electron_common_features');
describe('webContents module', () => {
@@ -760,7 +761,7 @@ describe('webContents module', () => {
}).to.throw('Must specify non-empty \'icon\' option');
expect(() => {
w.webContents.startDrag({ file: __filename, icon: __filename });
w.webContents.startDrag({ file: __filename, icon: path.join(mainFixturesPath, 'blank.png') });
}).to.throw('Must specify non-empty \'icon\' option');
});
});

View File

View File

@@ -2,5 +2,7 @@ const { app, session } = require('electron');
app.on('ready', () => {
session.fromPartition('in-memory');
process.exit(0);
setImmediate(() => {
process.exit(0);
});
});