Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(firefox): use separate processes for pages in different contexts #1976

Merged
merged 2 commits into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "index.js",
"playwright": {
"chromium_revision": "762211",
"firefox_revision": "1086",
"firefox_revision": "1087",
"webkit_revision": "1209"
},
"scripts": {
Expand Down
22 changes: 22 additions & 0 deletions test/emulation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,28 @@ describe('BrowserContext({locale})', function() {
]);
await context.close();
});
it('should be isolated between contexts', async({browser, server}) => {
const context1 = await browser.newContext({ locale: 'en-US' });
const promises = [];
// By default firefox limits number of child web processes to 8.
for (let i = 0; i< 8; i++)
promises.push(context1.newPage());
await Promise.all(promises);

const context2 = await browser.newContext({ locale: 'ru-RU' });
const page2 = await context2.newPage();

const localeNumber = () => (1000000.50).toLocaleString();
const numbers = await Promise.all(context1.pages().map(page => page.evaluate(localeNumber)));

numbers.forEach(value => expect(value).toBe('1,000,000.5'));
expect(await page2.evaluate(localeNumber)).toBe('1 000 000,5');

await Promise.all([
context1.close(),
context2.close()
]);
});
});

describe('focus', function() {
Expand Down