fix: backport Node nested microtask fix (#20303)
This commit is contained in:
parent
0653e31767
commit
593f1774e9
5 changed files with 82 additions and 19 deletions
|
@ -359,7 +359,6 @@ describe('webContents module', () => {
|
|||
|
||||
// For some reason we have to wait for two focused events...?
|
||||
await emittedOnce(w.webContents, 'devtools-focused')
|
||||
await emittedOnce(w.webContents, 'devtools-focused')
|
||||
|
||||
expect(() => { webContents.getFocusedWebContents() }).to.not.throw()
|
||||
|
||||
|
@ -444,9 +443,10 @@ describe('webContents module', () => {
|
|||
await focused
|
||||
expect(w.isFocused()).to.be.true()
|
||||
w.webContents.openDevTools({ mode: 'detach', activate: true })
|
||||
await emittedOnce(w.webContents, 'devtools-focused')
|
||||
await emittedOnce(w.webContents, 'devtools-focused')
|
||||
await emittedOnce(w.webContents, 'devtools-opened')
|
||||
await Promise.all([
|
||||
emittedOnce(w.webContents, 'devtools-opened'),
|
||||
emittedOnce(w.webContents, 'devtools-focused'),
|
||||
])
|
||||
await new Promise(resolve => setTimeout(resolve, 0))
|
||||
expect(w.isFocused()).to.be.false()
|
||||
})
|
||||
|
@ -572,8 +572,6 @@ describe('webContents module', () => {
|
|||
|
||||
const [, zoomDirection] = await emittedOnce(w.webContents, 'zoom-changed')
|
||||
expect(zoomDirection).to.equal(zoomingIn ? 'in' : 'out')
|
||||
// Apparently we get two zoom-changed events??
|
||||
await emittedOnce(w.webContents, 'zoom-changed')
|
||||
}
|
||||
|
||||
await testZoomChanged({ zoomingIn: true })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue