diff --git a/import-maps/acquiring/dynamic-import.html b/import-maps/acquiring/dynamic-import.html index 49d8a701da2e43..2521b2fb7f4dec 100644 --- a/import-maps/acquiring/dynamic-import.html +++ b/import-maps/acquiring/dynamic-import.html @@ -3,8 +3,6 @@ - diff --git a/import-maps/acquiring/modulepreload-link-header.html b/import-maps/acquiring/modulepreload-link-header.html index dde8cabb9323f0..5d3eaabd8f5217 100644 --- a/import-maps/acquiring/modulepreload-link-header.html +++ b/import-maps/acquiring/modulepreload-link-header.html @@ -3,11 +3,9 @@ - diff --git a/import-maps/acquiring/modulepreload.html b/import-maps/acquiring/modulepreload.html index 68b66a8ae330e4..0571c7dcbe4c4f 100644 --- a/import-maps/acquiring/modulepreload.html +++ b/import-maps/acquiring/modulepreload.html @@ -3,12 +3,10 @@ - diff --git a/import-maps/acquiring/script-tag-inline.html b/import-maps/acquiring/script-tag-inline.html index 683ce83c3a4b35..602ddc41a257b1 100644 --- a/import-maps/acquiring/script-tag-inline.html +++ b/import-maps/acquiring/script-tag-inline.html @@ -3,18 +3,11 @@ - diff --git a/import-maps/acquiring/script-tag.html b/import-maps/acquiring/script-tag.html index 2792c2a31d9718..e03f24dc0afb45 100644 --- a/import-maps/acquiring/script-tag.html +++ b/import-maps/acquiring/script-tag.html @@ -3,12 +3,10 @@ - diff --git a/import-maps/multiple-import-maps/already-resolved-dropped.html b/import-maps/multiple-import-maps/already-resolved-dropped.html new file mode 100644 index 00000000000000..631af5dc3ce39a --- /dev/null +++ b/import-maps/multiple-import-maps/already-resolved-dropped.html @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/import-maps/multiple-import-maps/basic.html b/import-maps/multiple-import-maps/basic.html index 9ab03ddc302af1..1c55e09e79f42e 100644 --- a/import-maps/multiple-import-maps/basic.html +++ b/import-maps/multiple-import-maps/basic.html @@ -22,15 +22,13 @@ } diff --git a/import-maps/multiple-import-maps/conflict-first-persists.html b/import-maps/multiple-import-maps/conflict-first-persists.html new file mode 100644 index 00000000000000..2e197244be55c6 --- /dev/null +++ b/import-maps/multiple-import-maps/conflict-first-persists.html @@ -0,0 +1,49 @@ + + + + + + + + diff --git a/import-maps/multiple-import-maps/resolution-consistency-in-module-tree-inline.html b/import-maps/multiple-import-maps/resolution-consistency-in-module-tree-inline.html new file mode 100644 index 00000000000000..a248977b90dd9e --- /dev/null +++ b/import-maps/multiple-import-maps/resolution-consistency-in-module-tree-inline.html @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + diff --git a/import-maps/multiple-import-maps/resolution-consistency-in-module-tree.html b/import-maps/multiple-import-maps/resolution-consistency-in-module-tree.html new file mode 100644 index 00000000000000..e0767a6c61056d --- /dev/null +++ b/import-maps/multiple-import-maps/resolution-consistency-in-module-tree.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + diff --git a/import-maps/multiple-import-maps/url-resolution-conflict.html b/import-maps/multiple-import-maps/url-resolution-conflict.html new file mode 100644 index 00000000000000..e8d06bdf524897 --- /dev/null +++ b/import-maps/multiple-import-maps/url-resolution-conflict.html @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/import-maps/multiple-import-maps/with-errors.html b/import-maps/multiple-import-maps/with-errors.html index a93ecaaeff5b32..3ba9b073592532 100644 --- a/import-maps/multiple-import-maps/with-errors.html +++ b/import-maps/multiple-import-maps/with-errors.html @@ -18,15 +18,11 @@ } diff --git a/import-maps/not-overridden/dynamic.html b/import-maps/not-overridden/dynamic.html new file mode 100644 index 00000000000000..dbc839a928c0cb --- /dev/null +++ b/import-maps/not-overridden/dynamic.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/external-script-bare-descendent.html b/import-maps/not-overridden/external-script-bare-descendent.html new file mode 100644 index 00000000000000..bff33f8d6abc2b --- /dev/null +++ b/import-maps/not-overridden/external-script-bare-descendent.html @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/external-script-descendent-with-scope.html b/import-maps/not-overridden/external-script-descendent-with-scope.html new file mode 100644 index 00000000000000..9f04548cc2d749 --- /dev/null +++ b/import-maps/not-overridden/external-script-descendent-with-scope.html @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/external-script-descendent.html b/import-maps/not-overridden/external-script-descendent.html new file mode 100644 index 00000000000000..122e8204f18fce --- /dev/null +++ b/import-maps/not-overridden/external-script-descendent.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/failed-resolution.html b/import-maps/not-overridden/failed-resolution.html new file mode 100644 index 00000000000000..eae6febddf157b --- /dev/null +++ b/import-maps/not-overridden/failed-resolution.html @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/integrity.html b/import-maps/not-overridden/integrity.html new file mode 100644 index 00000000000000..7770899728706c --- /dev/null +++ b/import-maps/not-overridden/integrity.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/modulepreload-header.html.headers b/import-maps/not-overridden/modulepreload-header.html.headers new file mode 100644 index 00000000000000..785378622d4d81 --- /dev/null +++ b/import-maps/not-overridden/modulepreload-header.html.headers @@ -0,0 +1,2 @@ +Link: <../resources/log.js?pipe=sub&name=A>;rel=modulepreload + diff --git a/import-maps/not-overridden/prefix.html b/import-maps/not-overridden/prefix.html new file mode 100644 index 00000000000000..99449b890e6021 --- /dev/null +++ b/import-maps/not-overridden/prefix.html @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/script-descendent.html b/import-maps/not-overridden/script-descendent.html new file mode 100644 index 00000000000000..4d1e08d41298e4 --- /dev/null +++ b/import-maps/not-overridden/script-descendent.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff --git a/import-maps/not-overridden/url-resolution-conflict.html b/import-maps/not-overridden/url-resolution-conflict.html new file mode 100644 index 00000000000000..d0708632164393 --- /dev/null +++ b/import-maps/not-overridden/url-resolution-conflict.html @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/import-maps/resources/importer.sub.js b/import-maps/resources/importer.sub.js new file mode 100644 index 00000000000000..6b55546d0d9a5c --- /dev/null +++ b/import-maps/resources/importer.sub.js @@ -0,0 +1 @@ +import "{{GET[name]}}"; diff --git a/import-maps/resources/in-scope-test.js b/import-maps/resources/in-scope-test.js new file mode 100644 index 00000000000000..aa64e89514c698 --- /dev/null +++ b/import-maps/resources/in-scope-test.js @@ -0,0 +1,3 @@ +// Testing that the resolution is correct using `resolve`, as you can't import +// the same module twice. +window.inscope_test_result = import.meta.resolve("a"); diff --git a/import-maps/resources/log.sub.js b/import-maps/resources/log.sub.js new file mode 100644 index 00000000000000..3588867d52cc96 --- /dev/null +++ b/import-maps/resources/log.sub.js @@ -0,0 +1,2 @@ +log.push("log:{{GET[name]}}"); + diff --git a/import-maps/resources/test-helper.js b/import-maps/resources/test-helper.js index f12e84c685d548..258d8f4afe93f5 100644 --- a/import-maps/resources/test-helper.js +++ b/import-maps/resources/test-helper.js @@ -244,3 +244,11 @@ function doTests(importMapString, importMapBaseURL, tests) { }); }, { explicit_done: true }); } + +function test_loaded(specifier, expected_log, description) { + promise_test(async t => { + log = []; + await import(specifier); + assert_array_equals(log, expected_log); + }, description); +}; diff --git a/resources/out-of-scope-test.js b/resources/out-of-scope-test.js new file mode 100644 index 00000000000000..ce24124646dc83 --- /dev/null +++ b/resources/out-of-scope-test.js @@ -0,0 +1,5 @@ +// Testing that the resolution is correct using `resolve`, as you can't import +// the same module twice. +window.outscope_test_result = import.meta.resolve("a"); +window.outscope_test_result2 = import.meta.resolve("../resources/log.sub.js?name=E"); +