fix(firefox): roll to 1029 and unskip passing tests (#984)

This commit is contained in:
Dmitry Gozman 2020-02-13 13:19:25 -08:00 committed by GitHub
parent d790b4c280
commit 2e0d89e25c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 6 deletions

View file

@ -9,7 +9,7 @@
"main": "index.js", "main": "index.js",
"playwright": { "playwright": {
"chromium_revision": "740847", "chromium_revision": "740847",
"firefox_revision": "1028", "firefox_revision": "1029",
"webkit_revision": "1148" "webkit_revision": "1148"
}, },
"scripts": { "scripts": {

View file

@ -70,7 +70,8 @@ export class RawKeyboardImpl implements input.RawKeyboard {
code, code,
key, key,
repeat: autoRepeat, repeat: autoRepeat,
location location,
text,
}); });
} }

View file

@ -73,6 +73,7 @@ export class FFPage implements PageDelegate {
helper.addEventListener(this._session, 'Page.workerCreated', this._onWorkerCreated.bind(this)), 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.workerDestroyed', this._onWorkerDestroyed.bind(this)),
helper.addEventListener(this._session, 'Page.dispatchMessageFromWorker', this._onDispatchMessageFromWorker.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)); worker.session.dispatchMessage(JSON.parse(event.message));
} }
async _onCrashed(event: Protocol.Page.crashedPayload) {
this._page._didCrash();
}
async exposeBinding(name: string, bindingFunction: string): Promise<void> { async exposeBinding(name: string, bindingFunction: string): Promise<void> {
await this._session.send('Page.addBinding', {name: name}); await this._session.send('Page.addBinding', {name: name});
await this._session.send('Page.addScriptToEvaluateOnNewDocument', {script: bindingFunction}); await this._session.send('Page.addScriptToEvaluateOnNewDocument', {script: bindingFunction});
@ -424,6 +429,8 @@ export class FFPage implements PageDelegate {
objectId: toRemoteObject(handle).objectId!, objectId: toRemoteObject(handle).objectId!,
executionContextId: (to._delegate as FFExecutionContext)._executionContextId 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<T>; return to._createHandle(result.remoteObject) as dom.ElementHandle<T>;
} }

View file

@ -176,7 +176,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT})
}); });
expect(await divHandle.ownerFrame()).toBe(page.mainFrame()); 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); await page.goto(server.EMPTY_PAGE);
const [popup] = await Promise.all([ const [popup] = await Promise.all([
page.waitForEvent('popup').then(async popup => { await popup.waitForLoadState(); return popup; }), page.waitForEvent('popup').then(async popup => { await popup.waitForLoadState(); return popup; }),

View file

@ -378,7 +378,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT})
const result = await page.evaluate(body => body.innerHTML, bodyHandle); const result = await page.evaluate(body => body.innerHTML, bodyHandle);
expect(result.trim()).toBe('<div>Hi, I\'m frame</div>'); expect(result.trim()).toBe('<div>Hi, I\'m frame</div>');
}); });
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); await page.goto(server.EMPTY_PAGE);
const frame = await utils.attachFrame(page, 'frame1', server.CROSS_PROCESS_PREFIX + '/empty.html'); const frame = await utils.attachFrame(page, 'frame1', server.CROSS_PROCESS_PREFIX + '/empty.html');
const bodyHandle = await frame.$('body'); const bodyHandle = await frame.$('body');

View file

@ -71,7 +71,7 @@ module.exports.describe = function({testRunner, expect, FFOX, CHROMIUM, WEBKIT,
await textarea.press('b'); await textarea.press('b');
expect(await page.evaluate(() => document.querySelector('textarea').value)).toBe('a'); 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'); await page.goto(server.PREFIX + '/input/textarea.html');
const textarea = await page.$('textarea'); const textarea = await page.$('textarea');
await textarea.press('a', {text: 'ё'}); await textarea.press('a', {text: 'ё'});

View file

@ -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}) => { it('should throw when page crashes', async({page}) => {
await page.setContent(`<div>This page should crash</div>`);
let error = null; let error = null;
page.on('error', err => error = err); page.on('error', err => error = err);
if (CHROMIUM) if (CHROMIUM)
page.goto('chrome://crash').catch(e => {}); page.goto('chrome://crash').catch(e => {});
else if (WEBKIT) else if (WEBKIT)
page._delegate._session.send('Page.crash', {}).catch(e => {}); page._delegate._session.send('Page.crash', {}).catch(e => {});
else if (FFOX)
page._delegate._session.send('Page.crash', {}).catch(e => {});
await waitEvent(page, 'error'); await waitEvent(page, 'error');
expect(error.message).toBe('Page crashed!'); expect(error.message).toBe('Page crashed!');
}); });