fix(firefox): isolate ignoreHTTPSErrors setting between contexts (#1617)

This commit is contained in:
Yury Semikhatsky 2020-04-01 12:59:48 -07:00 committed by GitHub
parent c2617c090a
commit c218d8c25f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View File

@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "754895",
"firefox_revision": "1062",
"firefox_revision": "1067",
"webkit_revision": "1185"
},
"scripts": {

View File

@ -92,14 +92,12 @@ export class FFBrowser extends platform.EventEmitter implements Browser {
const { browserContextId } = await this._connection.send('Browser.createBrowserContext', {
userAgent: options.userAgent,
bypassCSP: options.bypassCSP,
ignoreHTTPSErrors: options.ignoreHTTPSErrors,
javaScriptDisabled: options.javaScriptEnabled === false ? true : undefined,
viewport,
locale: options.locale,
removeOnDetach: true
});
// TODO: move ignoreHTTPSErrors to browser context level.
if (options.ignoreHTTPSErrors)
await this._connection.send('Browser.setIgnoreHTTPSErrors', { enabled: true });
const context = new FFBrowserContext(this, browserContextId, options);
await context._initialize();
this._contexts.set(browserContextId, context);

View File

@ -32,7 +32,7 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p
expect(response.ok()).toBe(true);
await context.close();
});
it.fail(FFOX)('should isolate contexts', async({browser, httpsServer}) => {
it('should isolate contexts', async({browser, httpsServer}) => {
{
let error = null;
const context = await browser.newContext({ ignoreHTTPSErrors: true });
@ -57,7 +57,7 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p
});
const context = await browser.newContext({ ignoreHTTPSErrors: true });
const page = await context.newPage();
await page.goto(httpsServer.PREFIX + '/mixedcontent.html', {waitUntil: 'load'});
await page.goto(httpsServer.PREFIX + '/mixedcontent.html', {waitUntil: 'domcontentloaded'});
expect(page.frames().length).toBe(2);
// Make sure blocked iframe has functional execution context
// @see https://github.com/GoogleChrome/puppeteer/issues/2709