spec: setDevToolsWebContents
This commit is contained in:
parent
25c5938c76
commit
ea9771702b
2 changed files with 40 additions and 0 deletions
|
@ -92,6 +92,22 @@ describe('webContents module', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('setDevToolsWebCotnents() API', () => {
|
||||
it('sets arbitry webContents as devtools', (done) => {
|
||||
let devtools = new BrowserWindow({show: false})
|
||||
devtools.webContents.once('dom-ready', () => {
|
||||
assert.ok(devtools.getURL().startsWith('chrome-devtools://devtools'))
|
||||
devtools.webContents.executeJavaScript('InspectorFrontendHost.constructor.name', (name) => {
|
||||
assert.ok(name, 'InspectorFrontendHostImpl')
|
||||
devtools.destroy()
|
||||
done()
|
||||
})
|
||||
})
|
||||
w.webContents.setDevToolsWebContents(devtools.webContents)
|
||||
w.webContents.openDevTools()
|
||||
})
|
||||
})
|
||||
|
||||
describe('isFocused() API', () => {
|
||||
it('returns false when the window is hidden', () => {
|
||||
BrowserWindow.getAllWindows().forEach((window) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue