diff --git a/package.json b/package.json index b606c83bf2..084a195f60 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "main": "index.js", "playwright": { "chromium_revision": "740847", - "firefox_revision": "1028", + "firefox_revision": "1029", "webkit_revision": "1148" }, "scripts": { diff --git a/src/firefox/ffInput.ts b/src/firefox/ffInput.ts index 57d645f6fc..8627add2ec 100644 --- a/src/firefox/ffInput.ts +++ b/src/firefox/ffInput.ts @@ -70,7 +70,8 @@ export class RawKeyboardImpl implements input.RawKeyboard { code, key, repeat: autoRepeat, - location + location, + text, }); } diff --git a/src/firefox/ffPage.ts b/src/firefox/ffPage.ts index 4780a528de..9dfae6114e 100644 --- a/src/firefox/ffPage.ts +++ b/src/firefox/ffPage.ts @@ -73,6 +73,7 @@ export class FFPage implements PageDelegate { helper.addEventListener(this._session, 'Page.workerCreated', this._onWorkerCreated.bind(this)), helper.addEventListener(this._session, 'Page.workerDestroyed', this._onWorkerDestroyed.bind(this)), helper.addEventListener(this._session, 'Page.dispatchMessageFromWorker', this._onDispatchMessageFromWorker.bind(this)), + helper.addEventListener(this._session, 'Page.crashed', this._onCrashed.bind(this)), ]; } @@ -229,6 +230,10 @@ export class FFPage implements PageDelegate { worker.session.dispatchMessage(JSON.parse(event.message)); } + async _onCrashed(event: Protocol.Page.crashedPayload) { + this._page._didCrash(); + } + async exposeBinding(name: string, bindingFunction: string): Promise { await this._session.send('Page.addBinding', {name: name}); await this._session.send('Page.addScriptToEvaluateOnNewDocument', {script: bindingFunction}); @@ -424,6 +429,8 @@ export class FFPage implements PageDelegate { objectId: toRemoteObject(handle).objectId!, executionContextId: (to._delegate as FFExecutionContext)._executionContextId }); + if (!result.remoteObject) + throw new Error('Unable to adopt element handle from a different document'); return to._createHandle(result.remoteObject) as dom.ElementHandle; } diff --git a/test/elementhandle.spec.js b/test/elementhandle.spec.js index bb139224ca..c54e445b4b 100644 --- a/test/elementhandle.spec.js +++ b/test/elementhandle.spec.js @@ -176,7 +176,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT}) }); expect(await divHandle.ownerFrame()).toBe(page.mainFrame()); }); - it.skip(FFOX)('should work for adopted elements', async({page,server}) => { + it('should work for adopted elements', async({page,server}) => { await page.goto(server.EMPTY_PAGE); const [popup] = await Promise.all([ page.waitForEvent('popup').then(async popup => { await popup.waitForLoadState(); return popup; }), diff --git a/test/evaluation.spec.js b/test/evaluation.spec.js index 7f2cf1bf22..d50d092584 100644 --- a/test/evaluation.spec.js +++ b/test/evaluation.spec.js @@ -378,7 +378,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT}) const result = await page.evaluate(body => body.innerHTML, bodyHandle); expect(result.trim()).toBe('
Hi, I\'m frame
'); }); - it.skip(FFOX)('should not allow cross-frame element handles when frames do not script each other', async({page, server}) => { + it('should not allow cross-frame element handles when frames do not script each other', async({page, server}) => { await page.goto(server.EMPTY_PAGE); const frame = await utils.attachFrame(page, 'frame1', server.CROSS_PROCESS_PREFIX + '/empty.html'); const bodyHandle = await frame.$('body'); diff --git a/test/keyboard.spec.js b/test/keyboard.spec.js index d5bf294d15..c91d3197ac 100644 --- a/test/keyboard.spec.js +++ b/test/keyboard.spec.js @@ -71,7 +71,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT, await textarea.press('b'); expect(await page.evaluate(() => document.querySelector('textarea').value)).toBe('a'); }); - it.skip(FFOX)('ElementHandle.press should support |text| option', async({page, server}) => { + it('ElementHandle.press should support |text| option', async({page, server}) => { await page.goto(server.PREFIX + '/input/textarea.html'); const textarea = await page.$('textarea'); await textarea.press('a', {text: 'ё'}); diff --git a/test/page.spec.js b/test/page.spec.js index facb5a8b3e..9c9a122003 100644 --- a/test/page.spec.js +++ b/test/page.spec.js @@ -112,14 +112,17 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF }); }); - describe.skip(FFOX)('Page.Events.error', function() { + describe('Page.Events.error', function() { it('should throw when page crashes', async({page}) => { + await page.setContent(`
This page should crash
`); let error = null; page.on('error', err => error = err); if (CHROMIUM) page.goto('chrome://crash').catch(e => {}); else if (WEBKIT) page._delegate._session.send('Page.crash', {}).catch(e => {}); + else if (FFOX) + page._delegate._session.send('Page.crash', {}).catch(e => {}); await waitEvent(page, 'error'); expect(error.message).toBe('Page crashed!'); });