fix(chromium): allow PlzDedicatedWorker (#32711)
With the recent Chromium fixes in v129, it is now safe to enable this feature. Fixes #31747.
This commit is contained in:
parent
ea284f2986
commit
cc302fa515
|
|
@ -35,9 +35,8 @@ export const chromiumSwitches = [
|
||||||
// Translate - https://github.com/microsoft/playwright/issues/16126
|
// Translate - https://github.com/microsoft/playwright/issues/16126
|
||||||
// HttpsUpgrades - https://github.com/microsoft/playwright/pull/27605
|
// HttpsUpgrades - https://github.com/microsoft/playwright/pull/27605
|
||||||
// PaintHolding - https://github.com/microsoft/playwright/issues/28023
|
// PaintHolding - https://github.com/microsoft/playwright/issues/28023
|
||||||
// PlzDedicatedWorker - https://github.com/microsoft/playwright/issues/31747
|
|
||||||
// ThirdPartyStoragePartitioning - https://github.com/microsoft/playwright/issues/32230
|
// ThirdPartyStoragePartitioning - https://github.com/microsoft/playwright/issues/32230
|
||||||
'--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding,PlzDedicatedWorker,ThirdPartyStoragePartitioning',
|
'--disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding,ThirdPartyStoragePartitioning',
|
||||||
'--allow-pre-commit-input',
|
'--allow-pre-commit-input',
|
||||||
'--disable-hang-monitor',
|
'--disable-hang-monitor',
|
||||||
'--disable-ipc-flooding-protection',
|
'--disable-ipc-flooding-protection',
|
||||||
|
|
|
||||||
|
|
@ -123,20 +123,24 @@ it('should intercept network activity from worker', async function({ page, serve
|
||||||
|
|
||||||
it('should intercept worker requests when enabled after worker creation', {
|
it('should intercept worker requests when enabled after worker creation', {
|
||||||
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32355' }
|
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32355' }
|
||||||
}, async function({ page, server, isAndroid, browserName }) {
|
}, async ({ page, server, isAndroid, browserName }) => {
|
||||||
it.skip(isAndroid);
|
it.skip(isAndroid);
|
||||||
it.fixme(browserName === 'chromium');
|
it.fixme(browserName === 'chromium');
|
||||||
|
|
||||||
await page.goto(server.EMPTY_PAGE);
|
await page.goto(server.EMPTY_PAGE);
|
||||||
server.setRoute('/data_for_worker', (req, res) => res.end('failed to intercept'));
|
server.setRoute('/data_for_worker', (req, res) => res.end('failed to intercept'));
|
||||||
const url = server.PREFIX + '/data_for_worker';
|
const url = server.PREFIX + '/data_for_worker';
|
||||||
await page.evaluate(url => {
|
await Promise.all([
|
||||||
(window as any).w = new Worker(URL.createObjectURL(new Blob([`
|
page.waitForEvent('worker'),
|
||||||
onmessage = function(e) {
|
page.evaluate(url => {
|
||||||
fetch("${url}").then(response => response.text()).then(console.log);
|
(window as any).w = new Worker(URL.createObjectURL(new Blob([`
|
||||||
};
|
onmessage = function(e) {
|
||||||
`], { type: 'application/javascript' })));
|
fetch("${url}").then(response => response.text()).then(console.log);
|
||||||
}, url);
|
};
|
||||||
|
`], { type: 'application/javascript' })));
|
||||||
|
}, url),
|
||||||
|
]);
|
||||||
|
// Install the route **after** the worker has been created.
|
||||||
await page.route(url, route => {
|
await page.route(url, route => {
|
||||||
route.fulfill({
|
route.fulfill({
|
||||||
status: 200,
|
status: 200,
|
||||||
|
|
@ -150,7 +154,9 @@ it('should intercept worker requests when enabled after worker creation', {
|
||||||
expect(msg.text()).toBe('intercepted');
|
expect(msg.text()).toBe('intercepted');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should intercept network activity from worker 2', async function({ page, server, isAndroid }) {
|
it('should intercept network activity from worker 2', {
|
||||||
|
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31747' }
|
||||||
|
}, async ({ page, server, isAndroid }) => {
|
||||||
it.skip(isAndroid);
|
it.skip(isAndroid);
|
||||||
|
|
||||||
const url = server.PREFIX + '/worker/worker.js';
|
const url = server.PREFIX + '/worker/worker.js';
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,9 @@ it('should report and intercept network from nested worker', async function({ pa
|
||||||
await expect.poll(() => messages).toEqual(['{"foo":"not bar"}', '{"foo":"not bar"}']);
|
await expect.poll(() => messages).toEqual(['{"foo":"not bar"}', '{"foo":"not bar"}']);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support extra http headers', async ({ page, server }) => {
|
it('should support extra http headers', {
|
||||||
|
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31747' }
|
||||||
|
}, async ({ page, server }) => {
|
||||||
await page.setExtraHTTPHeaders({ foo: 'bar' });
|
await page.setExtraHTTPHeaders({ foo: 'bar' });
|
||||||
const [worker, request1] = await Promise.all([
|
const [worker, request1] = await Promise.all([
|
||||||
page.waitForEvent('worker'),
|
page.waitForEvent('worker'),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue