Skip to content

Commit f58d909

Browse files
authored
fix(firefox): use separate processes for pages in different contexts (#1976)
1 parent df7338c commit f58d909

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"main": "index.js",
1010
"playwright": {
1111
"chromium_revision": "762211",
12-
"firefox_revision": "1086",
12+
"firefox_revision": "1087",
1313
"webkit_revision": "1211"
1414
},
1515
"scripts": {

test/emulation.spec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,28 @@ describe('BrowserContext({locale})', function() {
453453
]);
454454
await context.close();
455455
});
456+
it('should be isolated between contexts', async({browser, server}) => {
457+
const context1 = await browser.newContext({ locale: 'en-US' });
458+
const promises = [];
459+
// By default firefox limits number of child web processes to 8.
460+
for (let i = 0; i< 8; i++)
461+
promises.push(context1.newPage());
462+
await Promise.all(promises);
463+
464+
const context2 = await browser.newContext({ locale: 'ru-RU' });
465+
const page2 = await context2.newPage();
466+
467+
const localeNumber = () => (1000000.50).toLocaleString();
468+
const numbers = await Promise.all(context1.pages().map(page => page.evaluate(localeNumber)));
469+
470+
numbers.forEach(value => expect(value).toBe('1,000,000.5'));
471+
expect(await page2.evaluate(localeNumber)).toBe('1 000 000,5');
472+
473+
await Promise.all([
474+
context1.close(),
475+
context2.close()
476+
]);
477+
});
456478
});
457479

458480
describe('focus', function() {

0 commit comments

Comments
 (0)