Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion html/canvas/resources/canvas-promise-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ function runCanvasTestsInWorker({dependencies = []} = {}) {
const dependencyScripts =
await Promise.all(allDeps.map(dep => fetch(dep).then(r => r.text())));
const canvasTests = currentScript.textContent;
const allScripts = dependencyScripts.concat([canvasTests, 'done();']);
const allScripts = [
// Forward `location.search` to the worker so that it could run the right
// test variants. `location.search` is read-only in workers, so the whole
// object has to be replaced.
`var location = {search: '${self.location.search}'};`,
].concat(dependencyScripts)
.concat([canvasTests, 'done();']);

const workerBlob = new Blob(allScripts);
const worker = new Worker(URL.createObjectURL(workerBlob));
Expand Down
Loading