summaryrefslogtreecommitdiffstats
path: root/dom/base/test/jsmodules/test_scriptInsertedModule.html
blob: 0afc259f8cf5459e131169126dcaebcecf525421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<meta charset=utf-8>
<title>Test a script-inserted module</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script>
  var result;

  let script = document.createElement("script");
  script.type = "module";
  script.src = "./module_simpleImport.js";
  document.head.appendChild(script);

  SimpleTest.waitForExplicitFinish();

  function testLoaded() {
    ok(result == 42);
    SimpleTest.finish();
  }
</script>
<body onload='testLoaded()'></body>