Bug 1539614 [wpt PR 16077] - HTML: move textarea tests together, a=testonly
[gecko.git] / testing / web-platform / tests / import-maps / data.sub.tentative.html
blob1c7172bf7c6f21aeb22948f9d3eb05d9b3c11b86
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": "./resources/log.js?pipe=sub&name=bare",
19 "data:text/javascript,log.push('data:foo')": "./resources/log.js?pipe=sub&name=foo",
20 "data:text/javascript,log.push('data:cross-origin-foo')": "https://{{domains[www1]}}:{{ports[https][0]}}/import-maps/resources/log.js?pipe=sub&name=cross-origin-foo",
21 "data:text/javascript,log.push('data:to-data')": "data:text/javascript,log.push('dataURL')",
23 "data:text/javascript,log.push('data:std-blank')": "std:blank",
24 "data:text/javascript,log.push('data:blank')": "@std/blank",
25 "data:text/javascript,log.push('data:std-none')": "std:none",
26 "data:text/javascript,log.push('data:none')": "@std/none",
28 "data:text/javascript,log.push('data:to-bare')": "bare"
33 const tests = {
34 // Arrays of expected results for:
35 // - <script src type="module">,
36 // - <script src> (classic script),
37 // - static import, and
38 // - dynamic import.
40 // Currently, Chromium's implementation resolves import maps as a part of
41 // specifier resolution, and thus failure in import map resolution causes
42 // a parse error, not fetch error. Therefore, we use Result.PARSE_ERROR
43 // below. https://crbug.com/928435
45 // data: to HTTP(S).
46 "data:text/javascript,log.push('data:foo')":
47 [Result.URL, Result.URL, "log:foo", "log:foo"],
48 "data:text/javascript,log.push('data:cross-origin-foo')":
49 [Result.URL, Result.URL, "log:cross-origin-foo", "log:cross-origin-foo"],
51 // data: to data:
52 "data:text/javascript,log.push('data:to-data')":
53 [Result.URL, Result.URL, "dataURL", "dataURL"],
55 // data: to built-in.
56 "data:text/javascript,log.push('data:std-blank')":
57 [Result.URL, Result.URL, Result.BUILTIN, Result.BUILTIN],
58 "data:text/javascript,log.push('data:blank')":
59 [Result.URL, Result.URL, Result.BUILTIN, Result.BUILTIN],
60 "data:text/javascript,log.push('data:std-none')":
61 [Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
62 "data:text/javascript,log.push('data:none')":
63 [Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
65 // data: to bare mapping is disabled.
66 "data:text/javascript,log.push('data:to-bare')":
67 [Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
70 doTests(importMap, null, tests);
71 </script>
72 <body>