fix(webkit): rewrite global object retrieval errors (#640)

This commit is contained in:
Dmitry Gozman 2020-01-24 15:56:41 -08:00 committed by Pavel Feldman
parent fb9ec96e3e
commit f1d1dfb081
2 changed files with 11 additions and 3 deletions

View File

@ -111,7 +111,15 @@ export class WKExecutionContext implements js.ExecutionContextDelegate {
serializableArgs = args;
}
const thisObjectId = await this._contextGlobalObjectId();
let thisObjectId;
try {
thisObjectId = await this._contextGlobalObjectId();
} catch (error) {
if (error.message.includes('Missing injected script for given'))
throw new Error('Execution context was destroyed, most likely because of a navigation.');
throw error;
}
let callFunctionOnPromise;
try {
callFunctionOnPromise = this._session.send('Runtime.callFunctionOn', {

View File

@ -181,8 +181,8 @@ module.exports.describe = function({testRunner, expect, product, FFOX, CHROMIUM,
const screenshot = await page.screenshot();
expect(screenshot).toBeGolden('screenshot-webgl.png');
});
// firefox and webkit are flaky
it.skip(FFOX || WEBKIT)('should work while navigating', async({page, server}) => {
// firefox is flaky
it.skip(FFOX)('should work while navigating', async({page, server}) => {
await page.setViewport({width: 500, height: 500});
await page.goto(server.PREFIX + '/redirectloop1.html');
for (let i = 0; i < 10; i++) {