b63e04317b37b76c116ef6414e13e5a06c6536fb
[WebKit-https.git] / LayoutTests / js / dom / modules / module-load-same-module-from-different-entry-point.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../../../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8 description('2 different module tag will attempt to load the same module');
9 debug('Currently, this is not defined in the spec. This issue should be fixed in the future.');
10 // Module will be executed asynchronously.
11 window.jsTestIsAsync = true;
12 window.moduleExecutedCount = 0;
13 debug('Module is not executed yet.');
14 shouldBe(`window.moduleExecutedCount`, `0`);
15 var counter = 0;
16 function onLoad() {
17     shouldBe(`window.moduleExecutedCount`, `1`);
18     if (++counter === 2) {
19         shouldBeTrue(`window.firstModuleIsExecuted`);
20         shouldBeTrue(`window.secondModuleIsExecuted`);
21         finishJSTest();
22     }
23 }
24 </script>
25 <script src="../../../resources/js-test-post.js"></script>
26 <script type="module" onload="onLoad()">
27 import "./script-tests/module-load-same-module-from-different-entry-point.js"
28 debug('Executing the module.');
29 window.firstModuleIsExecuted = true;
30 </script>
31 <script type="module" onload="onLoad()">
32 import "./script-tests/module-load-same-module-from-different-entry-point.js"
33 debug('Executing the module.');
34 window.secondModuleIsExecuted = true;
35 </script>
36 </body>
37 </html>