mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(firefox): use separate processes for pages in different contexts (#1976)
This commit is contained in:
parent
df7338c2ce
commit
f58d909db4
@ -9,7 +9,7 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"chromium_revision": "762211",
|
"chromium_revision": "762211",
|
||||||
"firefox_revision": "1086",
|
"firefox_revision": "1087",
|
||||||
"webkit_revision": "1211"
|
"webkit_revision": "1211"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -453,6 +453,28 @@ describe('BrowserContext({locale})', function() {
|
|||||||
]);
|
]);
|
||||||
await context.close();
|
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() {
|
describe('focus', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user