fix: emit focus/blur events for webview (#14344)

* fix: emit focus/blur events for webview

* test: webview can emit focus event
This commit is contained in:
Cheng Zhao 2018-08-29 03:35:44 +09:00 committed by Charles Kerr
parent edd5c4b9bb
commit 459a2304b4
5 changed files with 53 additions and 21 deletions

View file

@ -1294,6 +1294,19 @@ describe('<webview> tag', function () {
expect(secondResizeEvent.newWidth).to.equal(newWidth)
expect(secondResizeEvent.newHeight).to.equal(newHeight)
})
it('emits focus event', async () => {
const domReadySignal = waitForEvent(webview, 'dom-ready')
webview.src = `file://${fixtures}/pages/a.html`
document.body.appendChild(webview)
await domReadySignal
const focusSignal = waitForEvent(webview, 'focus')
webview.contentWindow.focus()
await focusSignal
})
})
describe('zoom behavior', () => {