summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/import-maps/acquiring/modulepreload.html
blob: 68b66a8ae330e4d1fc07a3f8aaec78e0be4ae962 (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
<!DOCTYPE html>
<html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const t = async_test(
  'After <link rel=modulepreload> import maps should fire error events');
const log = [];
</script>
<link rel="modulepreload" href="../resources/empty.js?pipe=trickle(d1)"></link>
<script type="importmap" onerror="t.done()">
{
  "imports": {
    "../resources/log.js?pipe=sub&name=A": "../resources/log.js?pipe=sub&name=B"
  }
}
</script>
<script>
promise_test(() => {
  return import("../resources/log.js?pipe=sub&name=A")
    .then(() => assert_array_equals(log, ["log:A"]))
  },
  'After <link rel=modulepreload> import maps are not effective');
</script>