Bug 1528229 [wpt PR 15371] - [Import Maps] Implement Import Maps v0.5 behind a flag, a=testonly
authorHiroshige Hayashizaki <hiroshige@chromium.org>
Tue, 05 Mar 2019 12:12:50 +0000
changeset 464546 fa01f97677855f1e3853979f65afa7f97879e961
parent 464545 1d35d06964626a7a283b924892bb81eefeb563b5
child 464547 c24abbb7f7e91a2501a438c1c8eba45e11cde21c
push id80669
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:47:54 +0000
treeherderautoland@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1528229, 15371, 848607, 1449093, 631880
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528229 [wpt PR 15371] - [Import Maps] Implement Import Maps v0.5 behind a flag, a=testonly Automatic update from web-platform-tests [Import Maps] Implement Import Maps v0.5 behind a flag Design doc: https://docs.google.com/document/d/1vFQzbmxg9ilpg8CT_P8roEYcpTfZ06Q5N4J9-ZQqqZo/edit This CL implements an initial version of Import Maps that supports - Inline import maps (i.e. no src attribute), - Layered API/Built-in modules fallback, and - Basic bare specifier mapping. The import maps are behind the flag of LayeredAPI. Bug: 848607 Change-Id: I31efa6f9ce470375a07592f627b525f48dc2d504 Reviewed-on: https://chromium-review.googlesource.com/c/1449093 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#631880} -- wpt-commits: 7ddae5400caf476583cfbe71238254f8cbb217b9 wpt-pr: 15371
testing/web-platform/tests/import-maps/builtin-empty.tentative.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/import-maps/builtin-empty.tentative.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helper.js"></script>
+
+<script>
+const importMap = `
+{
+  "imports": {
+    "./resources/log.js?pipe=sub&name=empty": [ "@std/" ],
+    "./resources/log.js?pipe=sub&name=empty-fallback": [
+      "@std/",
+      "./resources/log.js?pipe=sub&name=empty-fallback"
+    ]
+  }
+}
+`;
+
+const tests = {
+  // Arrays of expected results for:
+  // - <script src type="module">,
+  // - <script src> (classic script),
+  // - static import, and
+  // - dynamic import.
+
+  // Discussions about notations are ongoing, e.g.
+  // https://github.com/tc39/proposal-javascript-standard-library/issues/12
+  // Currently the tests expects two notations are accepted.
+  // TODO: Once the discussions converge, update this and related tests.
+  "std:":
+    [Result.FETCH_ERROR, Result.FETCH_ERROR, Result.FETCH_ERROR, Result.FETCH_ERROR],
+  "@std/":
+    [Result.FETCH_ERROR, Result.PARSE_ERROR, Result.FETCH_ERROR, Result.FETCH_ERROR],
+
+  "./resources/log.js?pipe=sub&name=empty":
+    [Result.URL, Result.URL, Result.PARSE_ERROR, Result.PARSE_ERROR],
+  "./resources/log.js?pipe=sub&name=empty-fallback":
+    [Result.URL, Result.URL, Result.URL, Result.URL],
+};
+
+doTests(importMap, null, tests);
+</script>
+<body>