test: actually test sandbox events in the test that says 'test sandbox events' (#19284)
This commit is contained in:
parent
b5f69e0b9f
commit
c5e249b85c
2 changed files with 9 additions and 8 deletions
|
@ -1846,13 +1846,13 @@ describe('BrowserWindow module', () => {
|
|||
describe('event handling', () => {
|
||||
let w: BrowserWindow = null as unknown as BrowserWindow
|
||||
beforeEach(() => {
|
||||
w = new BrowserWindow({show: false, webPreferences: {nodeIntegration: true}})
|
||||
w = new BrowserWindow({show: false, webPreferences: {sandbox: true}})
|
||||
})
|
||||
it('works for window events', (done) => {
|
||||
waitForEvents(w, [
|
||||
'page-title-updated'
|
||||
], done)
|
||||
w.loadFile(path.join(fixtures, 'api', 'sandbox.html'), { search: 'window-events' })
|
||||
w.loadURL(`data:text/html,<script>document.title = 'changed'</script>`)
|
||||
})
|
||||
|
||||
it('works for stop events', (done) => {
|
||||
|
@ -1861,7 +1861,7 @@ describe('BrowserWindow module', () => {
|
|||
'did-fail-load',
|
||||
'did-stop-loading'
|
||||
], done)
|
||||
w.loadFile(path.join(fixtures, 'api', 'sandbox.html'), { search: 'webcontents-stop' })
|
||||
w.loadURL(`data:text/html,<script>stop()</script>`)
|
||||
})
|
||||
|
||||
it('works for web contents events', (done) => {
|
||||
|
@ -1869,7 +1869,8 @@ describe('BrowserWindow module', () => {
|
|||
'did-finish-load',
|
||||
'did-frame-finish-load',
|
||||
'did-navigate-in-page',
|
||||
'will-navigate',
|
||||
// TODO(nornagon): sandboxed pages should also emit will-navigate
|
||||
// 'will-navigate',
|
||||
'did-start-loading',
|
||||
'did-stop-loading',
|
||||
'did-frame-finish-load',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue