summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/module/inline-async-execorder.html
blob: db03612e82b42b6bd3294ced7468bb6c8b702520 (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
<html>
  <head>
    <title>Inline async module script execution order</title>
    <meta name=timeout content=long>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
  </head>
  <body>
    <script>
      let loaded = [];
      let test = async_test("Inline async module script execution order");
      window.addEventListener("load", test.step_func(function() {
        assert_array_equals(loaded,
                            ["fast", "fast", "fast", "slow", "slow", "slow"]);
      test.done();
      }));
    </script>
    <script type="module" async src="resources/slow-module.js?pipe=trickle(d2)&unique=1"></script>
    <script type="module" async>
      import "./resources/slow-module.js?pipe=trickle(d2)&unique=2";
      loaded.push("slow");
    </script>
    <script type="module" async src="resources/fast-module.js?unique=1"></script>
    <script type="module" async>
      import "./resources/fast-module.js?unique=2";
      loaded.push("fast");
    </script>
  </body>
</html>