fix(chromium): make locale overrides work (#1108)

This commit is contained in:
Yury Semikhatsky 2020-02-26 11:01:46 -08:00 committed by GitHub
parent 3afaeef557
commit 4f69930fbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -112,6 +112,8 @@ export class CRPage implements PageDelegate {
promises.push(this._client.send('Emulation.setScriptExecutionDisabled', { value: true }));
if (options.userAgent || options.locale)
promises.push(this._client.send('Emulation.setUserAgentOverride', { userAgent: options.userAgent || '', acceptLanguage: options.locale }));
if (options.locale)
promises.push(this._client.send('Emulation.setLocaleOverride', { locale: options.locale }));
if (options.timezoneId)
promises.push(emulateTimezone(this._client, options.timezoneId));
if (options.geolocation)

View File

@ -253,7 +253,7 @@ module.exports.describe = function({testRunner, expect, playwright, headless, FF
});
});
describe.skip(CHROMIUM || FFOX)('BrowserContext({locale})', function() {
describe.skip(FFOX)('BrowserContext({locale})', function() {
it('should affect accept-language header', async({browser, server}) => {
const context = await browser.newContext({ locale: 'fr-CH' });
const page = await context.newPage();