blob: ae81a61aa856bae1e2ae4281e8dfb6bc6f880e45 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../resources/js-test.js"></script>
<script>
description("Tests that AudioWorklet.addModule() rejects the promise when the URL is invalid.");
jsTestIsAsync = true;
const invalidURL = "http://invalid:url";
async function test() {
context = new OfflineAudioContext(2, 100, 44100);
await shouldRejectWithErrorName("context.audioWorklet.addModule(invalidURL);", "SyntaxError");
await shouldRejectWithErrorName("context.audioWorklet.addModule('doesnotExist.js');", "AbortError");
finishJSTest();
}
test();
</script>
</body>
</html>