From bc0ed740d1afbd88607aab23ab23ddc81d685073 Mon Sep 17 00:00:00 2001 From: Hiroshige Hayashizaki Date: Wed, 16 Oct 2019 10:47:48 -0700 Subject: [PATCH] [Import Maps] Split out WPT tests related to built-in modules This CL splits some WPT tests into - wpt/import-maps/core/ that tests the core features after https://github.com/WICG/import-maps/pull/176, and - wpt/import-maps/builtin-support.tentative/ that requires pre-#176 built-in module and fallback support, in order to test builtin- and non-builtin- versions easier. Bug: 1010751 Change-Id: I9f4793f64fa0ad267fa1d4e43d5597d94a5cc541 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1839428 Commit-Queue: Hiroshige Hayashizaki Reviewed-by: Domenic Denicola Cr-Commit-Position: refs/heads/master@{#706510} --- .../@std/__dir__.headers | 0 .../@std/blank | 0 .../{ => builtin-support.tentative}/@std/none | 0 .../bare.sub.tentative.html | 24 +-------- .../bare/__dir__.headers | 0 .../bare/blank | 0 .../{ => builtin-support.tentative}/bare/none | 0 .../bare/std-blank | 0 .../bare/std-none | 0 .../builtin-empty.tentative.html | 12 ++--- .../builtin-import-scheme.tentative.html | 2 +- .../builtin.tentative.html | 2 +- .../data.sub.tentative.html | 26 +-------- .../fallback-disallowed.sub.tentative.html | 42 +++++++-------- .../fallback.sub.tentative.html | 26 ++++----- .../http.sub.tentative.html | 32 ++--------- .../static-import.js | 0 import-maps/core/bare.sub.tentative.html | 51 ++++++++++++++++++ import-maps/core/bare/__dir__.headers | 1 + import-maps/{ => core}/bare/bare | 0 import-maps/{ => core}/bare/cross-origin-bare | 0 import-maps/{ => core}/bare/to-bare | 0 import-maps/{ => core}/bare/to-data | 0 import-maps/core/data.sub.tentative.html | 53 +++++++++++++++++++ import-maps/core/http.sub.tentative.html | 52 ++++++++++++++++++ .../{ => core}/module-map-key.tentative.html | 6 +-- import-maps/core/static-import.js | 1 + import-maps/resources/test-helper.js | 2 +- 28 files changed, 213 insertions(+), 119 deletions(-) rename import-maps/{ => builtin-support.tentative}/@std/__dir__.headers (100%) rename import-maps/{ => builtin-support.tentative}/@std/blank (100%) rename import-maps/{ => builtin-support.tentative}/@std/none (100%) rename import-maps/{ => builtin-support.tentative}/bare.sub.tentative.html (65%) rename import-maps/{ => builtin-support.tentative}/bare/__dir__.headers (100%) rename import-maps/{ => builtin-support.tentative}/bare/blank (100%) rename import-maps/{ => builtin-support.tentative}/bare/none (100%) rename import-maps/{ => builtin-support.tentative}/bare/std-blank (100%) rename import-maps/{ => builtin-support.tentative}/bare/std-none (100%) rename import-maps/{ => builtin-support.tentative}/builtin-empty.tentative.html (75%) rename import-maps/{ => builtin-support.tentative}/builtin-import-scheme.tentative.html (94%) rename import-maps/{ => builtin-support.tentative}/builtin.tentative.html (94%) rename import-maps/{ => builtin-support.tentative}/data.sub.tentative.html (60%) rename import-maps/{ => builtin-support.tentative}/fallback-disallowed.sub.tentative.html (53%) rename import-maps/{ => builtin-support.tentative}/fallback.sub.tentative.html (82%) rename import-maps/{ => builtin-support.tentative}/http.sub.tentative.html (53%) rename import-maps/{ => builtin-support.tentative}/static-import.js (100%) create mode 100644 import-maps/core/bare.sub.tentative.html create mode 100644 import-maps/core/bare/__dir__.headers rename import-maps/{ => core}/bare/bare (100%) rename import-maps/{ => core}/bare/cross-origin-bare (100%) rename import-maps/{ => core}/bare/to-bare (100%) rename import-maps/{ => core}/bare/to-data (100%) create mode 100644 import-maps/core/data.sub.tentative.html create mode 100644 import-maps/core/http.sub.tentative.html rename import-maps/{ => core}/module-map-key.tentative.html (75%) create mode 100644 import-maps/core/static-import.js diff --git a/import-maps/@std/__dir__.headers b/import-maps/builtin-support.tentative/@std/__dir__.headers similarity index 100% rename from import-maps/@std/__dir__.headers rename to import-maps/builtin-support.tentative/@std/__dir__.headers diff --git a/import-maps/@std/blank b/import-maps/builtin-support.tentative/@std/blank similarity index 100% rename from import-maps/@std/blank rename to import-maps/builtin-support.tentative/@std/blank diff --git a/import-maps/@std/none b/import-maps/builtin-support.tentative/@std/none similarity index 100% rename from import-maps/@std/none rename to import-maps/builtin-support.tentative/@std/none diff --git a/import-maps/bare.sub.tentative.html b/import-maps/builtin-support.tentative/bare.sub.tentative.html similarity index 65% rename from import-maps/bare.sub.tentative.html rename to import-maps/builtin-support.tentative/bare.sub.tentative.html index cf99589f9bd567..e20424aed8a728 100644 --- a/import-maps/bare.sub.tentative.html +++ b/import-maps/builtin-support.tentative/bare.sub.tentative.html @@ -2,7 +2,7 @@ - + - + - + - + - + - + - + - + + + + + + diff --git a/import-maps/core/bare/__dir__.headers b/import-maps/core/bare/__dir__.headers new file mode 100644 index 00000000000000..e7ec0d6699d07e --- /dev/null +++ b/import-maps/core/bare/__dir__.headers @@ -0,0 +1 @@ +Content-Type: text/javascript diff --git a/import-maps/bare/bare b/import-maps/core/bare/bare similarity index 100% rename from import-maps/bare/bare rename to import-maps/core/bare/bare diff --git a/import-maps/bare/cross-origin-bare b/import-maps/core/bare/cross-origin-bare similarity index 100% rename from import-maps/bare/cross-origin-bare rename to import-maps/core/bare/cross-origin-bare diff --git a/import-maps/bare/to-bare b/import-maps/core/bare/to-bare similarity index 100% rename from import-maps/bare/to-bare rename to import-maps/core/bare/to-bare diff --git a/import-maps/bare/to-data b/import-maps/core/bare/to-data similarity index 100% rename from import-maps/bare/to-data rename to import-maps/core/bare/to-data diff --git a/import-maps/core/data.sub.tentative.html b/import-maps/core/data.sub.tentative.html new file mode 100644 index 00000000000000..25c18c45b7dc3e --- /dev/null +++ b/import-maps/core/data.sub.tentative.html @@ -0,0 +1,53 @@ + + + + + + + + diff --git a/import-maps/core/http.sub.tentative.html b/import-maps/core/http.sub.tentative.html new file mode 100644 index 00000000000000..a33a0945e31671 --- /dev/null +++ b/import-maps/core/http.sub.tentative.html @@ -0,0 +1,52 @@ + + + + + + + diff --git a/import-maps/module-map-key.tentative.html b/import-maps/core/module-map-key.tentative.html similarity index 75% rename from import-maps/module-map-key.tentative.html rename to import-maps/core/module-map-key.tentative.html index 13bd122c673144..6f2f18a02e12a9 100644 --- a/import-maps/module-map-key.tentative.html +++ b/import-maps/core/module-map-key.tentative.html @@ -5,7 +5,7 @@ @@ -17,8 +17,8 @@ // key will become the URL/specifier BEFORE import map resolution. // https://crbug.com/928435 promise_test(() => { - return import("./resources/log.js?pipe=sub&name=A") - .then(() => import("./resources/log.js?pipe=sub&name=B")) + return import("../resources/log.js?pipe=sub&name=A") + .then(() => import("../resources/log.js?pipe=sub&name=B")) .then(() => assert_array_equals(log, ["log:B"])) }, "Module map's key is the URL after import map resolution"); diff --git a/import-maps/core/static-import.js b/import-maps/core/static-import.js new file mode 100644 index 00000000000000..1686fc123a798b --- /dev/null +++ b/import-maps/core/static-import.js @@ -0,0 +1 @@ +import "{{GET[url]}}"; diff --git a/import-maps/resources/test-helper.js b/import-maps/resources/test-helper.js index 2447bfb94353e1..f21ad935baa5e1 100644 --- a/import-maps/resources/test-helper.js +++ b/import-maps/resources/test-helper.js @@ -153,7 +153,7 @@ function testStaticImport(importMapString, importMapBaseURL, specifier, expected const script = document.createElement("script"); script.setAttribute("type", "module"); script.setAttribute("src", - "/import-maps/static-import.js?pipe=sub(none)&url=" + + "static-import.js?pipe=sub(none)&url=" + encodeURIComponent("${specifier}")); script.addEventListener("load", handlers[Handler.ScriptLoadEvent]); script.addEventListener("error", handlers[Handler.ScriptErrorEvent]);