From ded316cd5e04bfcd3b93fa8342f0d6f48c98f7e8 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Fri, 11 Jan 2019 15:33:35 -0800 Subject: [PATCH] wait for window to be focused in openDevTools test --- spec/api-web-contents-spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index 097b49d2d1f9..c744a3db59dc 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -264,7 +264,9 @@ describe('webContents module', () => { describe('openDevTools() API', () => { it('can show window with activation', async () => { + const focused = emittedOnce(w, 'focus') w.show() + await focused assert.strictEqual(w.isFocused(), true) const devtoolsOpened = emittedOnce(w.webContents, 'devtools-opened') w.webContents.openDevTools({ mode: 'detach', activate: true })