mirror of
https://github.com/electron/electron.git
synced 2026-01-24 06:48:15 -05:00
spec: Calling methods of destroyed webContents should not crash
This commit is contained in:
@@ -55,6 +55,12 @@ describe 'browser-window module', ->
|
||||
done()
|
||||
w.loadURL 'file://' + path.join(fixtures, 'api', 'close-beforeunload-false.html')
|
||||
|
||||
describe 'BrowserWindow.destroy()', ->
|
||||
it 'prevents users to access methods of webContents', ->
|
||||
webContents = w.webContents
|
||||
w.destroy()
|
||||
assert.throws (-> webContents.getId()), /Object has been destroyed/
|
||||
|
||||
describe 'BrowserWindow.loadURL(url)', ->
|
||||
it 'should emit did-start-loading event', (done) ->
|
||||
w.webContents.on 'did-start-loading', ->
|
||||
|
||||
Reference in New Issue
Block a user