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 464529 fa01f9767785
parent 464528 1d35d0696462
child 464530 c24abbb7f7e9
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@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>