test: interception breaks remote importScripts (#5953)
This commit is contained in:
parent
0076e46e57
commit
0120896771
1
test/assets/worker/import-me.js
Normal file
1
test/assets/worker/import-me.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
console.log("hello from import-me.js");
|
||||
14
test/assets/worker/worker-http-import.html
Normal file
14
test/assets/worker/worker-http-import.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Remote importScripts Test</title>
|
||||
</head>
|
||||
<html>
|
||||
<div id="status">-</div>
|
||||
<script>
|
||||
new Worker('worker-http-import.js').addEventListener("message", ({ data }) => {
|
||||
document.getElementById("status").innerText = data;
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
</html>
|
||||
4
test/assets/worker/worker-http-import.js
Normal file
4
test/assets/worker/worker-http-import.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
console.log("hello from worker-http-import.js");
|
||||
importScripts("./import-me.js")
|
||||
console.log("successfully imported");
|
||||
self.postMessage("finished");
|
||||
|
|
@ -146,3 +146,13 @@ it('should work with regular expression passed from a different context', async
|
|||
expect(response.ok()).toBe(true);
|
||||
expect(intercepted).toBe(true);
|
||||
});
|
||||
|
||||
it('should not break remote worker importScripts', (test, { browserName }) => {
|
||||
test.fail(browserName === 'chromium');
|
||||
}, async ({ page, server, context }) => {
|
||||
context.route('**', async request => {
|
||||
await request.continue();
|
||||
});
|
||||
await page.goto(server.PREFIX + '/worker/worker-http-import.html');
|
||||
await page.waitForSelector("#status:has-text('finished')");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue