From 14db20431592f23174052fd04f16a5f39b9ce97d Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Wed, 22 Nov 2017 14:37:46 -0800 Subject: [PATCH] :construction_worker: Add a spec --- spec/api-browser-window-spec.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/spec/api-browser-window-spec.js b/spec/api-browser-window-spec.js index bb5996e68335..61561401c8b9 100644 --- a/spec/api-browser-window-spec.js +++ b/spec/api-browser-window-spec.js @@ -9,7 +9,7 @@ const http = require('http') const {closeWindow} = require('./window-helpers') const {ipcRenderer, remote, screen} = require('electron') -const {app, ipcMain, BrowserWindow, protocol, webContents} = remote +const {app, ipcMain, BrowserWindow, BrowserView, protocol, webContents} = remote const isCI = remote.getGlobal('isCi') const nativeModulesEnabled = remote.getGlobal('nativeModulesEnabled') @@ -802,6 +802,25 @@ describe('BrowserWindow module', () => { }) }) + describe('BrowserWindow.fromBrowserView(browserView)', () => { + let bv = null + + beforeEach(() => { + bv = new BrowserView() + w.setBrowserView(bv) + }) + + afterEach(() => { + w.setBrowserView(null) + bv.destroy() + }) + + it('returns the window with the browserView', () => { + assert.equal(BrowserWindow.fromBrowserView(bv).id, w.id) + }) + }) + }) + describe('BrowserWindow.setOpacity(opacity)', () => { it('make window with initial opacity', () => { w.destroy()