Skip to content

Commit

Permalink
fix(firefox): use separate processes for pages in different contexts (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s authored Apr 27, 2020
1 parent df7338c commit f58d909
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
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": "1211"
},
"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

0 comments on commit f58d909

Please sign in to comment.