Clear interval before destroying window
This commit is contained in:
parent
a9d4d9ad85
commit
58cae1d8de
1 changed files with 6 additions and 3 deletions
|
@ -1599,8 +1599,10 @@ describe('browser-window module', function () {
|
||||||
BrowserWindow.removeDevToolsExtension('foo')
|
BrowserWindow.removeDevToolsExtension('foo')
|
||||||
BrowserWindow.addDevToolsExtension(extensionPath)
|
BrowserWindow.addDevToolsExtension(extensionPath)
|
||||||
|
|
||||||
w.webContents.on('devtools-opened', function () {
|
let showPanelIntervalId = null
|
||||||
var showPanelIntevalId = setInterval(function () {
|
|
||||||
|
w.webContents.once('devtools-opened', function () {
|
||||||
|
showPanelIntervalId = setInterval(function () {
|
||||||
if (w && w.devToolsWebContents) {
|
if (w && w.devToolsWebContents) {
|
||||||
var showLastPanel = function () {
|
var showLastPanel = function () {
|
||||||
var lastPanelId = WebInspector.inspectorView._tabbedPane._tabs.peekLast().id
|
var lastPanelId = WebInspector.inspectorView._tabbedPane._tabs.peekLast().id
|
||||||
|
@ -1608,7 +1610,7 @@ describe('browser-window module', function () {
|
||||||
}
|
}
|
||||||
w.devToolsWebContents.executeJavaScript(`(${showLastPanel})()`)
|
w.devToolsWebContents.executeJavaScript(`(${showLastPanel})()`)
|
||||||
} else {
|
} else {
|
||||||
clearInterval(showPanelIntevalId)
|
clearInterval(showPanelIntervalId)
|
||||||
}
|
}
|
||||||
}, 100)
|
}, 100)
|
||||||
})
|
})
|
||||||
|
@ -1618,6 +1620,7 @@ describe('browser-window module', function () {
|
||||||
|
|
||||||
ipcMain.once('answer', function (event, message) {
|
ipcMain.once('answer', function (event, message) {
|
||||||
assert.equal(message.runtimeId, 'foo')
|
assert.equal(message.runtimeId, 'foo')
|
||||||
|
clearInterval(showPanelIntervalId)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue