blob: 1b13d43290f834d0f9a69930500a67ac15bf5edf [file] [log] [blame]
if (window.testRunner) testRunner.waitUntilDone();
// Imports code into a worklet, with some helpers.
async function importWorklet(worklet, code) {
const response = await fetch("resources/testharness-worklet.js");
const finalCode = (await response.text()) + code;
let url;
// FIXME: This is temporary, until we support loading scripts by url
if (window.chrome) {
const blob = new Blob([finalCode], {type: 'text/javascript'});
url = URL.createObjectURL(blob);
} else {
url = finalCode;
}
worklet.addModule(url);
if (window.testRunner) {
setTimeout(function() {
testRunner.notifyDone();
}, 3000);
}
}