This commit is contained in:
John Kleinschmidt 2020-05-26 10:25:57 -04:00 коммит произвёл GitHub
Родитель 08f288faf1
Коммит db5cf816b4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 18 добавлений и 8 удалений

Просмотреть файл

@ -71,7 +71,6 @@ steps:
ELECTRON_TEST_RESULTS_DIR: junit
MOCHA_MULTI_REPORTERS: 'mocha-junit-reporter, tap'
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_TIMEOUT: 120000
- task: PublishTestResults@2
displayName: 'Publish Test Results'

Просмотреть файл

@ -10,7 +10,6 @@ import { closeWindow } from './window-helpers';
const fixturesPath = path.resolve(__dirname, 'fixtures');
describe('Menu module', function () {
this.timeout(5000);
describe('Menu.buildFromTemplate', () => {
it('should be able to attach extra fields', () => {
const menu = Menu.buildFromTemplate([
@ -885,9 +884,14 @@ describe('Menu module', function () {
const appProcess = cp.spawn(process.execPath, [appPath]);
let output = '';
appProcess.stdout.on('data', data => { output += data; });
await emittedOnce(appProcess, 'exit');
await new Promise((resolve) => {
appProcess.stdout.on('data', data => {
output += data;
if (data.indexOf('Window has') > -1) {
resolve();
}
});
});
expect(output).to.include('Window has no menu');
});

Просмотреть файл

@ -1233,7 +1233,10 @@ describe('chromium features', () => {
w.loadURL(pdfSource);
const [, contents] = await emittedOnce(app, 'web-contents-created');
expect(contents.getURL()).to.equal('chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html');
await emittedOnce(contents, 'did-finish-load');
await new Promise((resolve) => {
contents.on('did-finish-load', resolve);
contents.on('did-frame-finish-load', resolve);
});
});
it('opens when loading a pdf resource in a iframe', async () => {
@ -1241,7 +1244,10 @@ describe('chromium features', () => {
w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'pdf-in-iframe.html'));
const [, contents] = await emittedOnce(app, 'web-contents-created');
expect(contents.getURL()).to.equal('chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html');
await emittedOnce(contents, 'did-finish-load');
await new Promise((resolve) => {
contents.on('did-finish-load', resolve);
contents.on('did-frame-finish-load', resolve);
});
});
});

Просмотреть файл

@ -294,11 +294,12 @@ describe('chrome extensions', () => {
it('loads a devtools extension', async () => {
const customSession = session.fromPartition(`persist:${require('uuid').v4()}`);
customSession.loadExtension(path.join(fixtures, 'extensions', 'devtools-extension'));
const winningMessage = emittedOnce(ipcMain, 'winning');
const w = new BrowserWindow({ show: true, webPreferences: { session: customSession, nodeIntegration: true } });
await w.loadURL(url);
w.webContents.openDevTools();
showLastDevToolsPanel(w);
await emittedOnce(ipcMain, 'winning');
await winningMessage;
});
});