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
48 lines
1.6 KiB
HTML
48 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<meta name="timeout" content="long">
|
|
<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",
|
|
|
|
"data:text/javascript,log.push('data:foo')": "./resources/log.js?pipe=sub&name=foo",
|
|
"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",
|
|
"data:text/javascript,log.push('data:to-data')": "data:text/javascript,log.push('dataURL')",
|
|
|
|
"data:text/javascript,log.push('data:to-bare')": "bare"
|
|
}
|
|
}
|
|
`;
|
|
|
|
const tests = {
|
|
// Arrays of expected results for:
|
|
// - <script src type="module">,
|
|
// - <script src> (classic script),
|
|
// - static import, and
|
|
// - dynamic import.
|
|
|
|
// data: to HTTP(S).
|
|
"data:text/javascript,log.push('data:foo')":
|
|
[Result.URL, Result.URL, "log:foo", "log:foo"],
|
|
"data:text/javascript,log.push('data:cross-origin-foo')":
|
|
[Result.URL, Result.URL, "log:cross-origin-foo", "log:cross-origin-foo"],
|
|
|
|
// data: to data:
|
|
"data:text/javascript,log.push('data:to-data')":
|
|
[Result.URL, Result.URL, "dataURL", "dataURL"],
|
|
|
|
// data: to bare mapping is disabled.
|
|
"data:text/javascript,log.push('data:to-bare')":
|
|
[Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
|
|
};
|
|
|
|
doTests(importMap, null, tests);
|
|
</script>
|
|
<body>
|