feat: add activate option to webContents.openDevTools (#13852)
This commit is contained in:
parent
aafbd865bf
commit
d63a848011
13 changed files with 63 additions and 32 deletions
|
@ -159,6 +159,22 @@ describe('webContents module', () => {
|
|||
})
|
||||
})
|
||||
|
||||
describe('openDevTools() API', () => {
|
||||
it('can show window with activation', async () => {
|
||||
w.show()
|
||||
assert.strictEqual(w.isFocused(), true)
|
||||
w.webContents.openDevTools({ mode: 'detach', activate: true })
|
||||
await emittedOnce(w.webContents, 'devtools-opened')
|
||||
assert.strictEqual(w.isFocused(), false)
|
||||
})
|
||||
|
||||
it('can show window without activation', async () => {
|
||||
w.webContents.openDevTools({ mode: 'detach', activate: false })
|
||||
await emittedOnce(w.webContents, 'devtools-opened')
|
||||
assert.strictEqual(w.isDevToolsOpened(), true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('before-input-event event', () => {
|
||||
it('can prevent document keyboard events', (done) => {
|
||||
ipcMain.once('keydown', (event, key) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue