Commit 72a6dcb3 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

[Import Maps] Add import-maps-without-builtin-modules virtual tests

To test import maps without built-in module support.

In import-maps-without-builtin-modules virtual tests,
we skip wpt/import-maps/builtin-support/ tests because
all of them are about built-in modules, but
still run wpt/import-maps/imported/ tests because
they still contain subtests that can pass without
built-in modules/fallbacks.

Bug: 1010751
Change-Id: I9ca8b9d2d40a699819ff38f6d652b7dc4be1b079
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841813
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: default avatarDomenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706585}
parent cb3d96ef
......@@ -3969,6 +3969,10 @@ crbug.com/826419 external/wpt/html/semantics/embedded-content/media-elements/tra
crbug.com/825798 external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-non-snap-to-lines.html [ Failure ]
crbug.com/927477 external/wpt/import-maps/acquire-import-maps-flag/worker-request/ [ Skip ]
crbug.com/927477 virtual/import-maps-without-builtin-modules/external/wpt/import-maps/acquire-import-maps-flag/worker-request/ [ Skip ]
# Excludes tests that require built-in module supports.
crbug.com/1010751 virtual/import-maps-without-builtin-modules/external/wpt/import-maps/builtin-support.tentative/ [ Skip ]
# This test requires a special browser flag and seems not suitable for a wpt test, see bug.
crbug.com/691944 external/wpt/service-workers/service-worker/update-after-oneday.https.html [ Skip ]
......
......@@ -1123,5 +1123,10 @@
"prefix": "out-of-blink-frame-ancestors",
"base": "external/wpt/content-security-policy/frame-ancestors",
"args": ["--enable-features=OutOfBlinkFrameAncestors"]
},
{
"prefix": "import-maps-without-builtin-modules",
"base": "external/wpt/import-maps",
"args": ["--enable-blink-features=ImportMaps", "--disable-blink-features=ExperimentalProductivityFeatures"]
}
]
This virtual test is for testing import maps without built-in module support.
In the non-virtual tests, import maps with built-in module support is tested
because built-in modules are enabled via ExperimentalProductivityFeatures.
This is a testharness.js-based test.
PASS Relative URL-like addresses / should accept strings prefixed with ./, ../, or /
FAIL Relative URL-like addresses / should not accept strings prefixed with ./, ../, or / for data: base URLs assert_equals: expected "{\"dotDotSlash\":[],\"dotSlash\":[],\"slash\":[]}" but got "{\"dotDotSlash\":[\"http://web-platform.test:8001/import-maps/foo\"],\"dotSlash\":[\"http://web-platform.test:8001/import-maps/imported/foo\"],\"slash\":[\"http://web-platform.test:8001/foo\"]}"
PASS Relative URL-like addresses / should accept the literal strings ./, ../, or / with no suffix
PASS Relative URL-like addresses / should ignore percent-encoded variants of ./, ../, or /
PASS Built-in module addresses / should accept URLs using the built-in module scheme
PASS Built-in module addresses / should ignore percent-encoded variants of the built-in module scheme
PASS Built-in module addresses / should allow built-in module URLs that contain "/" or "\"
FAIL Absolute URL addresses / should only accept absolute URL addresses with fetch schemes assert_equals: expected "{\"about\":[\"about:good\"],\"blob\":[\"blob:good\"],\"data\":[\"data:good\"],\"file\":[\"file:///good\"],\"filesystem\":[\"filesystem:good\"],\"ftp\":[\"ftp://good/\"],\"http\":[\"http://good/\"],\"https\":[\"https://good/\"],\"import\":[],\"javascript\":[],\"mailto\":[],\"wss\":[]}" but got "{\"about\":[\"about:good\"],\"blob\":[\"blob:good\"],\"data\":[\"data:good\"],\"file\":[\"file:///good\"],\"filesystem\":[],\"ftp\":[\"ftp://good/\"],\"http\":[\"http://good/\"],\"https\":[\"https://good/\"],\"import\":[\"import:bad\"],\"javascript\":[\"javascript:bad\"],\"mailto\":[\"mailto:bad\"],\"wss\":[\"wss://bad/\"]}"
FAIL Absolute URL addresses / should only accept absolute URL addresses with fetch schemes inside arrays assert_equals: expected "{\"about\":[\"about:good\"],\"blob\":[\"blob:good\"],\"data\":[\"data:good\"],\"file\":[\"file:///good\"],\"filesystem\":[\"filesystem:good\"],\"ftp\":[\"ftp://good/\"],\"http\":[\"http://good/\"],\"https\":[\"https://good/\"],\"import\":[],\"javascript\":[],\"mailto\":[],\"wss\":[]}" but got "{}"
FAIL Absolute URL addresses / should parse absolute URLs, ignoring unparseable ones assert_equals: expected "{\"invalidButParseable1\":[\"https://example.org/\"],\"invalidButParseable2\":[\"https://example.com///\"],\"noPercentDecoding\":[\"https://example.com/%41\"],\"percentDecoding\":[\"https://example.com/\"],\"prettyNormal\":[\"https://example.net/\"],\"unparseable1\":[],\"unparseable2\":[],\"unparseable3\":[]}" but got "{\"invalidButParseable1\":[\"https://example.org/\"],\"invalidButParseable2\":[\"https://example.com///\"],\"noPercentDecoding\":[\"https://example.com/A\"],\"percentDecoding\":[\"https://example.com/\"],\"prettyNormal\":[\"https://example.net/\"],\"unparseable1\":[\"https://ex%20ample.org/\"],\"unparseable2\":[],\"unparseable3\":[]}"
FAIL Absolute URL addresses / should parse absolute URLs, ignoring unparseable ones inside arrays assert_equals: expected "{\"invalidButParseable1\":[\"https://example.org/\"],\"invalidButParseable2\":[\"https://example.com///\"],\"noPercentDecoding\":[\"https://example.com/%41\"],\"percentDecoding\":[\"https://example.com/\"],\"prettyNormal\":[\"https://example.net/\"],\"unparseable1\":[],\"unparseable2\":[],\"unparseable3\":[]}" but got "{}"
PASS Failing addresses: mismatched trailing slashes / should warn for the simple case
FAIL Failing addresses: mismatched trailing slashes / should warn for a mismatch alone in an array assert_equals: expected "{\"std:trailer/\":[],\"trailer/\":[]}" but got "{}"
FAIL Failing addresses: mismatched trailing slashes / should warn for a mismatch alongside non-mismatches in an array assert_equals: expected "{\"std:trailer/\":[\"https://base.example/bim-atrailer/\"],\"trailer/\":[\"https://base.example/atrailer/\"]}" but got "{}"
PASS Other invalid addresses / should ignore unprefixed strings that are not absolute URLs
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS Invalid JSON
PASS Mismatching the top-level schema / should throw for top-level non-objects
PASS Mismatching the top-level schema / should throw if imports is a non-object
PASS Mismatching the top-level schema / should throw if scopes is a non-object
FAIL Mismatching the top-level schema / should ignore unspecified top-level entries assert_object_equals: expected property "0" missing
FAIL Mismatching the specifier map schema / should ignore entries where the address is not a string, array, or null assert_equals: expected "{\"bar\":[\"https://example.com/\"]}" but got "{}"
PASS Mismatching the specifier map schema / should ignore entries where the specifier key is an empty string
FAIL Mismatching the specifier map schema / should ignore members of an address array that are not strings assert_equals: expected "{\"bar\":[\"https://example.com/\"],\"foo\":[\"https://example.com/\"]}" but got "{}"
PASS Mismatching the specifier map schema / should throw if a scope's value is not an object
PASS Normalization / should normalize empty import maps to have imports and scopes keys
PASS Normalization / should normalize an import map without imports to have imports
PASS Normalization / should normalize an import map without scopes to have scopes
FAIL Normalization / should normalize addresses to arrays assert_equals: expected "{\"bar\":[\"https://example.com/2\"],\"baz\":[],\"foo\":[\"https://example.com/1\"]}" but got "{\"foo\":[\"https://example.com/1\"]}"
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS Unmapped built-in module specifiers / should resolve "std:blank" to "std:blank"
FAIL Unmapped built-in module specifiers / should error resolving "std:none" assert_throws: function "() => resolveUnderTest(NONE)" did not throw
PASS Remapping built-in module specifiers / should remap built-in modules
FAIL Remapping built-in module specifiers / should remap built-in modules with slashes assert_equals: expected "https://example.com/app/blank-slash/bar" but got "std:blank/bar"
FAIL Remapping built-in module specifiers / should remap built-in modules with fallbacks assert_equals: expected "https://example.com/app/none.mjs" but got "std:none"
FAIL Remapping built-in module specifiers / should remap built-in modules with slashes and fallbacks assert_equals: expected "https://example.com/app/blank/" but got "std:blank/"
PASS Remapping to built-in modules / should remap to "std:blank"
FAIL Remapping to built-in modules / should fail when remapping to "std:blank/" assert_throws: function "() => resolveUnderTest('/blank/')" did not throw
FAIL Remapping to built-in modules / should remap to "std:blank/for-testing" assert_equals: expected "std:blank/for-testing" but got "https://example.com/blank/for-testing"
PASS Remapping to built-in modules / should remap to "std:blank" for URL-like specifiers
FAIL Remapping to built-in modules / should fail when remapping to "std:none" assert_throws: function "() => resolveUnderTest('none')" did not throw
FAIL Fallbacks with built-in module addresses / should resolve to "std:blank" Failed to resolve module specifier blank: Relative references must start with either "/", "./", or "../".
FAIL Fallbacks with built-in module addresses / should fall back past "std:none" Failed to resolve module specifier none: Relative references must start with either "/", "./", or "../".
Harness: the test ran to completion.
This is a testharness.js-based test.
PASS Unmapped / should resolve ./ specifiers as URLs
PASS Unmapped / should resolve ../ specifiers as URLs
PASS Unmapped / should resolve / specifiers as URLs
PASS Unmapped / should parse absolute fetch-scheme URLs
FAIL Unmapped / should fail for absolute non-fetch-scheme URLs assert_throws: function "() => resolveUnderTest('mailto:bad')" did not throw
FAIL Unmapped / should fail for strings not parseable as absolute URLs and not starting with ./ ../ or / assert_throws: function "() => resolveUnderTest('https://ex ample.org/')" did not throw
PASS Mapped using the "imports" key only (no scopes) / should fail when the mapping is to an empty array
PASS Mapped using the "imports" key only (no scopes) / Package-like scenarios / should work for package main modules
PASS Mapped using the "imports" key only (no scopes) / Package-like scenarios / should work for package submodules
PASS Mapped using the "imports" key only (no scopes) / Package-like scenarios / should work for package names that end in a slash by just passing through
PASS Mapped using the "imports" key only (no scopes) / Package-like scenarios / should still fail for package modules that are not declared
PASS Mapped using the "imports" key only (no scopes) / Package-like scenarios / should fail for package submodules that map to nowhere
PASS Mapped using the "imports" key only (no scopes) / Tricky specifiers / should work for explicitly-mapped specifiers that happen to have a slash
PASS Mapped using the "imports" key only (no scopes) / Tricky specifiers / should work when the specifier has punctuation
PASS Mapped using the "imports" key only (no scopes) / Tricky specifiers / should fail for attempting to get a submodule of something not declared with a trailing slash
PASS Mapped using the "imports" key only (no scopes) / URL-like specifiers / should remap to other URLs
FAIL Mapped using the "imports" key only (no scopes) / URL-like specifiers / should fail for URLs that remap to empty arrays assert_throws: function "() => resolveUnderTest('https://example.com/lib/no.mjs')" did not throw
PASS Mapped using the "imports" key only (no scopes) / URL-like specifiers / should remap URLs that are just composed from / and .
FAIL Mapped using the "imports" key only (no scopes) / URL-like specifiers / should remap URLs that are prefix-matched by keys with trailing slashes assert_equals: expected "https://example.com/lib/url-trailing-slash/foo.mjs" but got "https://example.com/test/foo.mjs"
PASS Mapped using the "imports" key only (no scopes) / URL-like specifiers / should use the last entry's address when URL-like specifiers parse to the same absolute URL
PASS Mapped using the "imports" key only (no scopes) / Overlapping entries with trailing slashes / should favor the most-specific key (no empty arrays)
PASS Mapped using the "imports" key only (no scopes) / Overlapping entries with trailing slashes / should favor the most-specific key when empty arrays are involved for less-specific keys
FAIL Mapped using the "imports" key only (no scopes) / Overlapping entries with trailing slashes / should favor the most-specific key when empty arrays are involved for more-specific keys assert_throws: function "() => resolveUnderTest('a/b')" did not throw
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment