5 <title>Test for ShadowRealms
</title>
6 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
8 <iframe id=
"ifr"></iframe>
13 <script type=
"application/javascript">
14 SimpleTest.waitForExplicitFinish();
16 var promise = (async ()=
> {
17 var module = await import(
"./shadow_realm_module.js");
18 is(module.x,
1,
"import works outside worker");
20 var sr = new ShadowRealm();
21 await sr.importValue(
"./shadow_realm_module.js", 'x').then((x) =
> is(x,
1,
"imported x and got 1"));
25 var worker = new Worker(
"shadow_realm_worker.js");
31 worker.postMessage(str);
35 worker.onmessage = function(e) {
36 console.log(
"Received Message: "+e.data);
39 if (e.data ==
"finish") {
40 is(expected, recieved,
"Got the appropriate Number of messages");
45 if (e.data.startsWith(
"PASS")) {