Add failing BrowserWindow.fromDevToolsWebContents spec
This commit is contained in:
parent
b0a1e2988b
commit
03263bb5b6
1 changed files with 22 additions and 0 deletions
|
@ -584,6 +584,28 @@ describe('BrowserWindow module', function () {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('BrowserWindow.fromDevToolsWebContents(webContents)', function () {
|
||||||
|
let contents = null
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
contents = webContents.create({})
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
contents.destroy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('returns the window with the webContents', function (done) {
|
||||||
|
w.webContents.once('devtools-opened', () => {
|
||||||
|
assert.equal(BrowserWindow.fromDevToolsWebContents(w.devToolsWebContents).id, w.id)
|
||||||
|
assert.equal(BrowserWindow.fromDevToolsWebContents(w.webContents), undefined)
|
||||||
|
assert.equal(BrowserWindow.fromDevToolsWebContents(contents), undefined)
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
w.webContents.openDevTools()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('"useContentSize" option', function () {
|
describe('"useContentSize" option', function () {
|
||||||
it('make window created with content size when used', function () {
|
it('make window created with content size when used', function () {
|
||||||
w.destroy()
|
w.destroy()
|
||||||
|
|
Loading…
Reference in a new issue