revert: test use emittedUntil in PDF Viewer tests (#27273)
This reverts commit 36f4ee87df
.
This commit is contained in:
parent
cd42933f41
commit
dd17250a80
1 changed files with 5 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { expect } from 'chai';
|
import { expect } from 'chai';
|
||||||
import { BrowserWindow, WebContents, session, ipcMain, app, protocol, webContents } from 'electron/main';
|
import { BrowserWindow, WebContents, session, ipcMain, app, protocol, webContents } from 'electron/main';
|
||||||
import { emittedOnce, emittedUntil } from './events-helpers';
|
import { emittedOnce } from './events-helpers';
|
||||||
import { closeAllWindows } from './window-helpers';
|
import { closeAllWindows } from './window-helpers';
|
||||||
import * as https from 'https';
|
import * as https from 'https';
|
||||||
import * as http from 'http';
|
import * as http from 'http';
|
||||||
|
@ -1283,17 +1283,15 @@ describe('chromium features', () => {
|
||||||
it('opens when loading a pdf resource as top level navigation', async () => {
|
it('opens when loading a pdf resource as top level navigation', async () => {
|
||||||
const w = new BrowserWindow({ show: false });
|
const w = new BrowserWindow({ show: false });
|
||||||
w.loadURL(pdfSource);
|
w.loadURL(pdfSource);
|
||||||
await emittedUntil(app, 'web-contents-created', (event: Electron.Event, contents: WebContents) => {
|
const [, contents] = await emittedOnce(app, 'web-contents-created');
|
||||||
return contents.getURL() === 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html';
|
expect(contents.getURL()).to.equal('chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html');
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('opens when loading a pdf resource in a iframe', async () => {
|
it('opens when loading a pdf resource in a iframe', async () => {
|
||||||
const w = new BrowserWindow({ show: false });
|
const w = new BrowserWindow({ show: false });
|
||||||
w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'pdf-in-iframe.html'));
|
w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'pdf-in-iframe.html'));
|
||||||
await emittedUntil(app, 'web-contents-created', (event: Electron.Event, contents: WebContents) => {
|
const [, contents] = await emittedOnce(app, 'web-contents-created');
|
||||||
return contents.getURL() === 'chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html';
|
expect(contents.getURL()).to.equal('chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html');
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue