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 464195 f4fa3dd608c7f9a60c38f73c09e2826a4511f1fb
parent 464194 181a97408a3049335ca6c37908ddd0bde574f191
child 464196 a8be7c66cb41dd9fdc8bc15775c27487eff57cd9
push id35713
push usercbrindusan@mozilla.com
push dateFri, 15 Mar 2019 21:55:43 +0000
treeherdermozilla-central@66b1aba3fb43 [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>