test: untangle a chromium-spec test (#16456)
This commit is contained in:
parent
34ac68c4a8
commit
fd8b9450ee
1 changed files with 21 additions and 20 deletions
|
@ -520,27 +520,28 @@ describe('chromium feature', () => {
|
|||
b = window.open('about:blank')
|
||||
})
|
||||
|
||||
it('open a blank page when no URL is specified', (done) => {
|
||||
let b = null
|
||||
app.once('browser-window-created', (event, { webContents }) => {
|
||||
webContents.once('did-finish-load', () => {
|
||||
const { location } = b
|
||||
b.close()
|
||||
assert.strictEqual(location.href, 'about:blank')
|
||||
it('open a blank page when no URL is specified', async () => {
|
||||
const browserWindowCreated = emittedOnce(app, 'browser-window-created')
|
||||
const w = window.open()
|
||||
try {
|
||||
const [, { webContents }] = await browserWindowCreated
|
||||
await emittedOnce(webContents, 'did-finish-load')
|
||||
assert.strictEqual(w.location.href, 'about:blank')
|
||||
} finally {
|
||||
w.close()
|
||||
}
|
||||
})
|
||||
|
||||
let c = null
|
||||
app.once('browser-window-created', (event, { webContents }) => {
|
||||
webContents.once('did-finish-load', () => {
|
||||
const { location } = c
|
||||
c.close()
|
||||
assert.strictEqual(location.href, 'about:blank')
|
||||
done()
|
||||
})
|
||||
})
|
||||
c = window.open('')
|
||||
})
|
||||
})
|
||||
b = window.open()
|
||||
it('open a blank page when an empty URL is specified', async () => {
|
||||
const browserWindowCreated = emittedOnce(app, 'browser-window-created')
|
||||
const w = window.open('')
|
||||
try {
|
||||
const [, { webContents }] = await browserWindowCreated
|
||||
await emittedOnce(webContents, 'did-finish-load')
|
||||
assert.strictEqual(w.location.href, 'about:blank')
|
||||
} finally {
|
||||
w.close()
|
||||
}
|
||||
})
|
||||
|
||||
it('throws an exception when the arguments cannot be converted to strings', () => {
|
||||
|
|
Loading…
Reference in a new issue