2 <script src=
"/resources/testharness.js"></script>
3 <script src=
"/resources/testharnessreport.js"></script>
4 <script src=
"resources/test-helper.js"></script>
7 // "bare/..." (i.e. without leading "./") are bare specifiers
8 // (not relative paths).
10 // Discussions about notations for builtin modules are ongoing, e.g.
11 // https://github.com/tc39/proposal-javascript-standard-library/issues/12
12 // Currently the tests expects two notations are accepted.
13 // TODO: Once the discussions converge, update the tests.
17 "bare/bare": "./resources/log.js?pipe=sub&name=bare",
18 "bare/cross-origin-bare": "https://{{domains[www1]}}:{{ports[https][0]}}/import-maps/resources/log.js?pipe=sub&name=cross-origin-bare",
19 "bare/to-data": "data:text/javascript,log.push('dataURL')",
21 "bare/std-blank": "std:blank",
22 "bare/blank": "@std/blank",
23 "bare/std-none": "std:none",
24 "bare/none": "@std/none",
26 "bare/to-bare": "bare/bare"
32 // Arrays of expected results for:
33 // - <script src type="module">,
34 // - <script src> (classic script),
35 // - static import, and
38 // Currently, Chromium's implementation resolves import maps as a part of
39 // specifier resolution, and thus failure in import map resolution causes
40 // a parse error, not fetch error. Therefore, we use Result.PARSE_ERROR
41 // below. https://crbug.com/928435
45 [Result
.URL
, Result
.URL
, "log:bare", "log:bare"],
46 "bare/cross-origin-bare":
47 [Result
.URL
, Result
.URL
, "log:cross-origin-bare", "log:cross-origin-bare"],
51 [Result
.URL
, Result
.URL
, "dataURL", "dataURL"],
55 [Result
.URL
, Result
.URL
, Result
.BUILTIN
, Result
.BUILTIN
],
57 [Result
.URL
, Result
.URL
, Result
.BUILTIN
, Result
.BUILTIN
],
59 [Result
.URL
, Result
.URL
, Result
.PARSE_ERROR
, Result
.PARSE_ERROR
],
61 [Result
.URL
, Result
.URL
, Result
.PARSE_ERROR
, Result
.PARSE_ERROR
],
63 // Bare to bare mapping is disabled.
65 [Result
.URL
, Result
.URL
, Result
.PARSE_ERROR
, Result
.PARSE_ERROR
],
68 doTests(importMap
, null, tests
);