test: fix flake in will-navigate test (#36153)
This commit is contained in:
parent
260678bd0c
commit
07530f8e37
1 changed files with 4 additions and 4 deletions
|
@ -567,6 +567,10 @@ describe('BrowserWindow module', () => {
|
||||||
targetId: iframeTarget.targetId,
|
targetId: iframeTarget.targetId,
|
||||||
flatten: true
|
flatten: true
|
||||||
});
|
});
|
||||||
|
let willNavigateEmitted = false;
|
||||||
|
w.webContents.on('will-navigate', () => {
|
||||||
|
willNavigateEmitted = true;
|
||||||
|
});
|
||||||
await w.webContents.debugger.sendCommand('Input.dispatchMouseEvent', {
|
await w.webContents.debugger.sendCommand('Input.dispatchMouseEvent', {
|
||||||
type: 'mousePressed',
|
type: 'mousePressed',
|
||||||
x: 10,
|
x: 10,
|
||||||
|
@ -581,10 +585,6 @@ describe('BrowserWindow module', () => {
|
||||||
clickCount: 1,
|
clickCount: 1,
|
||||||
button: 'left'
|
button: 'left'
|
||||||
}, sessionId);
|
}, sessionId);
|
||||||
let willNavigateEmitted = false;
|
|
||||||
w.webContents.on('will-navigate', () => {
|
|
||||||
willNavigateEmitted = true;
|
|
||||||
});
|
|
||||||
await emittedOnce(w.webContents, 'did-navigate');
|
await emittedOnce(w.webContents, 'did-navigate');
|
||||||
expect(willNavigateEmitted).to.be.true();
|
expect(willNavigateEmitted).to.be.true();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue