forked from mirrors/gecko-dev
Automatic update from web-platform-tests Import maps: rearrange and update WPTs * Flips the pass condition for worker interaction. A module worker does not impact the import map of the outer page, since its constructor takes a URL, not a specifier that needs resolution. * Removes leftover built-in module support and @std references. * Removes .tentative filename suffixes. * Renames "common" to "data-driven". * Renames parsing.tentative.https.html to parsing-internal.https.html so that all internal tests to have -internal in the name. We should move them out of WPT (or convert them to not require internals), eventually, but for now making the difference clear is good. * Moves "core" tests up to the top level. * Removes references to future fetch-based import maps and Chromium implementation limitations. * Adds OWNERS and META.yml Bug: 1026809 Change-Id: I1807468a813ebee416cd8e05a272dbae6ea157bb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491616 Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Commit-Queue: Domenic Denicola <domenic@chromium.org> Cr-Commit-Position: refs/heads/master@{#825559} -- wpt-commits: bb36180aa7a284259079575ba2a175a6a4f5d8d2 wpt-pr: 26239
47 lines
1.6 KiB
HTML
47 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="resources/test-helper.js"></script>
|
|
|
|
<script>
|
|
// "bare/..." (i.e. without leading "./") are bare specifiers
|
|
// (not relative paths).
|
|
const importMap = `
|
|
{
|
|
"imports": {
|
|
"bare": "./resources/log.js?pipe=sub&name=bare",
|
|
|
|
"./resources/log.js?pipe=sub&name=foo": "./resources/log.js?pipe=sub&name=bar",
|
|
"./resources/log.js?pipe=sub&name=cross-origin-foo": "https://{{domains[www1]}}:{{ports[https][0]}}/import-maps/resources/log.js?pipe=sub&name=cross-origin-bar",
|
|
"./resources/log.js?pipe=sub&name=to-data": "data:text/javascript,log.push('dataURL')",
|
|
|
|
"./resources/log.js?pipe=sub&name=to-bare": "bare"
|
|
}
|
|
}
|
|
`;
|
|
|
|
const tests = {
|
|
// Arrays of expected results for:
|
|
// - <script src type="module">,
|
|
// - <script src> (classic script),
|
|
// - static import, and
|
|
// - dynamic import.
|
|
|
|
// HTTP(S) to HTTP(S).
|
|
"{{location[server]}}/import-maps/resources/log.js?pipe=sub&name=foo":
|
|
[Result.URL, Result.URL, "log:bar", "log:bar"],
|
|
"{{location[server]}}/import-maps/resources/log.js?pipe=sub&name=cross-origin-foo":
|
|
[Result.URL, Result.URL, "log:cross-origin-bar", "log:cross-origin-bar"],
|
|
|
|
// HTTP(S) to data:
|
|
"{{location[server]}}/import-maps/resources/log.js?pipe=sub&name=to-data":
|
|
[Result.URL, Result.URL, "dataURL", "dataURL"],
|
|
|
|
// HTTP(S) to bare mapping is disabled.
|
|
"{{location[server]}}/import-maps/resources/log.js?pipe=sub&name=to-bare":
|
|
[Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
|
|
};
|
|
|
|
doTests(importMap, null, tests);
|
|
</script>
|
|
<body>
|