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 @@ + +
+ + +