refactor: be more precise when creating api::WebContents (#23128)

This commit is contained in:
Jeremy Rose 2021-04-23 13:51:37 -07:00 committed by GitHub
parent 1c57e078aa
commit dc7fa1d9f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 15 deletions

View file

@ -1382,6 +1382,7 @@ describe('chromium features', () => {
const w = new BrowserWindow({ show: false });
w.loadURL(pdfSource);
const [, contents] = await emittedOnce(app, 'web-contents-created');
await emittedOnce(contents, 'did-navigate');
expect(contents.getURL()).to.equal('chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html');
});
@ -1389,6 +1390,7 @@ describe('chromium features', () => {
const w = new BrowserWindow({ show: false });
w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'pdf-in-iframe.html'));
const [, contents] = await emittedOnce(app, 'web-contents-created');
await emittedOnce(contents, 'did-navigate');
expect(contents.getURL()).to.equal('chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html');
});
});