Bug
1690933 [wpt PR 27497] - Check MIME type against asserted module type in ModuleScriptFetcher, a=testonly
Automatic update from web-platform-tests
Check MIME type against asserted module type in ModuleScriptFetcher
Add module type to the module map key.
Plumb module type into ModuleScriptFetcher and its subclasses, and
require that the MIME type match the type that was specified with
import assertions.
Add the necessary import assertions to the JSON/CSS module web tests
so that they continue passing. Add tests to ensure that the modules
don't load when the correct assertion is not present.
A minor functional change to JSON modules is that trying to start a
a Worker with a top-level JSON module (e.g. new Worker("./foo.json"))
now results in a rejected Promise, instead of loading a no-op worker
without an error. This change follows the spec change at
https://github.com/whatwg/html/pull/5658/; note that the invocation
of 'fetch a single module script' from 'fetch a worklet/module worker
script graph' doesn't pass a ModuleRequest, so the type is assumed to
be JavaScript, and a failure will be triggered if the MIME type is
not JavaScript.
Some of the non-virtual versions of the tests now time out because
the import assertion syntax is seen as a syntax error when
--harmony-import-assertions is not enabled, causing <script>s not to
run. TestExpectations is updated to account for these.
Bug:
1132413
Change-Id: I01bf7d907a96e791208534c9c4f2af11434c76db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/
2674259
Commit-Queue: Dan Clark <daniec@microsoft.com>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#852991}
--
wpt-commits:
2c6f296858c62d4628bf58d2db4af687edbf674e
wpt-pr: 27497