test: interception breaks remote importScripts (#5953)

This commit is contained in:
Ross Wollman 2021-03-25 17:16:41 -07:00 committed by GitHub
parent 0076e46e57
commit 0120896771
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1 @@
console.log("hello from import-me.js");

View 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>

View file

@ -0,0 +1,4 @@
console.log("hello from worker-http-import.js");
importScripts("./import-me.js")
console.log("successfully imported");
self.postMessage("finished");

View file

@ -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')");
});