summaryrefslogtreecommitdiffstats
path: root/dom/worklet/tests/test_fetch_failed.html
blob: e60b3327453a6e4b3cea683ce5309f4edb006d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE HTML>
<html>
<head>
  <title>Test fetch an child module script with an invalid uri for Worklet</title>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  <script type="application/javascript" src="common.js"></script>
</head>
<body>

<script type="application/javascript">
// This function is called into an iframe.
function runTestInIframe() {
  var audioContext = new AudioContext();
  ok(!!audioContext.audioWorklet, "audioContext.audioWorklet exists");

  audioContext.audioWorklet.addModule("specifier_with_user.mjs")
  .then(() => {
    ok(false, "Error: load shouldn't succeed.");
  }, () => {
    ok(true, "OK: load should fail.");
  })

  // done
  .then(() => {
    SimpleTest.finish();
  });
}

</script>
</body>
</html>