From b42493e6e6aa7a43cf57f1e77405400ce8594856 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sat, 29 Sep 2018 05:34:57 +1000 Subject: [PATCH] test: guarantee the order of webview and devtools creation (#14849) --- spec/api-web-contents-spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/api-web-contents-spec.js b/spec/api-web-contents-spec.js index 8963c3cddf5d..683da9891214 100644 --- a/spec/api-web-contents-spec.js +++ b/spec/api-web-contents-spec.js @@ -46,14 +46,16 @@ describe('webContents module', () => { assert.ok(all.length >= 4) assert.strictEqual(all[0].getType(), 'window') - assert.strictEqual(all[all.length - 2].getType(), 'remote') - assert.strictEqual(all[all.length - 1].getType(), 'webview') + assert.strictEqual(all[all.length - 2].getType(), 'webview') + assert.strictEqual(all[all.length - 1].getType(), 'remote') done() }) w.loadFile(path.join(fixtures, 'pages', 'webview-zoom-factor.html')) - w.webContents.openDevTools() + w.webContents.on('did-attach-webview', () => { + w.webContents.openDevTools() + }) }) })