Add spec for detached window crash
This commit is contained in:
Родитель
dd5ee28b2f
Коммит
399470e281
|
@ -49,11 +49,9 @@ describe('webContents module', function () {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('getFocusedWebContents() API', function () {
|
describe('getFocusedWebContents() API', function () {
|
||||||
if (isCi) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
it('returns the focused web contents', function (done) {
|
it('returns the focused web contents', function (done) {
|
||||||
|
if (isCi) return done()
|
||||||
|
|
||||||
const specWebContents = remote.getCurrentWebContents()
|
const specWebContents = remote.getCurrentWebContents()
|
||||||
assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId())
|
assert.equal(specWebContents.getId(), webContents.getFocusedWebContents().getId())
|
||||||
|
|
||||||
|
@ -69,6 +67,27 @@ describe('webContents module', function () {
|
||||||
|
|
||||||
specWebContents.openDevTools()
|
specWebContents.openDevTools()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('does not crash when called on a detached dev tools window', function (done) {
|
||||||
|
const specWebContents = w.webContents
|
||||||
|
|
||||||
|
specWebContents.once('devtools-opened', function () {
|
||||||
|
assert.doesNotThrow(function () {
|
||||||
|
webContents.getFocusedWebContents()
|
||||||
|
})
|
||||||
|
specWebContents.closeDevTools()
|
||||||
|
})
|
||||||
|
|
||||||
|
specWebContents.once('devtools-closed', function () {
|
||||||
|
assert.doesNotThrow(function () {
|
||||||
|
webContents.getFocusedWebContents()
|
||||||
|
})
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
|
||||||
|
specWebContents.openDevTools({mode: 'detach'})
|
||||||
|
w.inspectElement(100, 100)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('isFocused() API', function () {
|
describe('isFocused() API', function () {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче