From 6bbfe89f96bc418bd7cd26d4168763df123ec94e Mon Sep 17 00:00:00 2001 From: Ryohei Ikegami Date: Sun, 19 Mar 2017 18:11:20 +0900 Subject: [PATCH] Add spec for useNativeWindowOpen --- spec/api-browser-window-spec.js | 17 +++++++++++++++++ spec/fixtures/api/native-window-open.html | 11 +++++++++++ 2 files changed, 28 insertions(+) create mode 100644 spec/fixtures/api/native-window-open.html diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index b5985e4b7406..69f9c78d52b7 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -1069,6 +1069,23 @@ describe('BrowserWindow module', function () { w.loadURL('file://' + path.join(fixtures, 'pages', 'window-open.html')) }) }) + + describe('useNativeWindowOpen option', () => { + it('allows synchronous access to window opened by window.open()', (done) => { + ipcMain.once('answer', function (event, content) { + assert.equal(content, 'Hello') + done() + }) + w.destroy() + w = new BrowserWindow({ + show: false, + webPreferences: { + nativeWindowOpen: true + } + }) + w.loadURL('file://' + path.join(fixtures, 'api', 'native-window-open.html')) + }) + }) }) describe('beforeunload handler', function () { diff --git a/spec/fixtures/api/native-window-open.html b/spec/fixtures/api/native-window-open.html new file mode 100644 index 000000000000..630c4faa41b3 --- /dev/null +++ b/spec/fixtures/api/native-window-open.html @@ -0,0 +1,11 @@ + + + + +