Bug 1539614 [wpt PR 16077] - HTML: move textarea tests together, a=testonly
[gecko.git] / testing / web-platform / tests / import-maps / bare.sub.tentative.html
blob5bfb6b52072338568397a8dfac3a98a90c70b34b
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script src="resources/test-helper.js"></script>
6 <script>
7 // "bare/..." (i.e. without leading "./") are bare specifiers
8 // (not relative paths).
9 //
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.
14 const importMap = `
16 "imports": {
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"
31 const tests = {
32 // Arrays of expected results for:
33 // - <script src type="module">,
34 // - <script src> (classic script),
35 // - static import, and
36 // - dynamic import.
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
43 // Bare to HTTP(S).
44 "bare/bare":
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"],
49 // Bare to data:
50 "bare/to-data":
51 [Result.URL, Result.URL, "dataURL", "dataURL"],
53 // Bare to built-in.
54 "bare/std-blank":
55 [Result.URL, Result.URL, Result.BUILTIN, Result.BUILTIN],
56 "bare/blank":
57 [Result.URL, Result.URL, Result.BUILTIN, Result.BUILTIN],
58 "bare/std-none":
59 [Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
60 "bare/none":
61 [Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
63 // Bare to bare mapping is disabled.
64 "bare/to-bare":
65 [Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
68 doTests(importMap, null, tests);
69 </script>
70 <body>