Merge pull request #6851 from electron/focused-web-contents-from-hidden-windows

Prevent web contents in hidden windows from reporting as focused
This commit is contained in:
Cheng Zhao 2016-08-17 20:15:37 +09:00 committed by GitHub
commit 4e355355a9
2 changed files with 21 additions and 2 deletions

View file

@ -70,4 +70,12 @@ describe('webContents module', function () {
specWebContents.openDevTools()
})
})
describe('isFocused() API', function () {
it('returns false when the window is hidden', function () {
BrowserWindow.getAllWindows().forEach(function (window) {
assert.equal(!window.isVisible() && window.webContents.isFocused(), false)
})
})
})
})