Bug 1710945 [wpt PR 28980] - Extend CSS module test coverage, a=testonly
commit95b918cc7f6abcc43af334a73b3adf8001c1c1cf
authorDan Clark <daniec@microsoft.com>
Mon, 7 Jun 2021 14:07:57 +0000 (7 14:07 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Tue, 8 Jun 2021 19:05:22 +0000 (8 19:05 +0000)
tree13edc6c3b0130d454f45d371291122754565993c
parent1a5136f06f10ff4fa7c0c12bf310e2f62aba13a8
Bug 1710945 [wpt PR 28980] - Extend CSS module test coverage, a=testonly

Automatic update from web-platform-tests
Extend CSS module test coverage

Add tests for CSS modules to match the level of coverage that currently
exists for JSON modules. The new tests are mostly straightforward
copies of the JSON modules tests, switched over to CSS.

- Cross-origin imports fail without the
  Access-Control-Allow-Origin response header.
- The crossOrigin CORS policy is respected
- referrerPolicy is respected.
- The <script> element's integrity attribute is respected.
- CSS modules are always decoded as UTF-8 regardless of Content-Type
  or the document's encoding.  The existing coverage we had on this in
  utf8.tentative.html was renamed to charset.html, refactored, and
  expanded.
- CSS MIME type checks work correctly.
- Validate that the load event fires when appropriate for
a <script> element containing a CSS module import. Also check that
the error event is fired when a CSS module 404s.
- A <script type="module"> with a src that is CSS doesn't load.

Also add a couple of checks for @import and parse error behavior in
import-css-module-basic.html.

Bug: 992499
Change-Id: I93c7196918876d3657ecfd7d38daee7504fa98b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2877633
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#888146}

--

wpt-commits: d94d1a58eaf5bada062c280d527202eff816fcb7
wpt-pr: 28980
30 files changed:
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/charset-2.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/charset.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/content-type-checking.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/cors-crossorigin-requests.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/credentials.sub.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/import-css-module-basic.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/import-css-module-dynamic.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/integrity.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/load-error-events.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/referrer-policies.sub.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/bad-import.css
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/basic.css
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/credentials-iframe.sub.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/cross-origin.py [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/crossorigin-import-parse-error-with-cors.sub.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/crossorigin-import-with-cors.sub.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/crossorigin-import-without-cors.sub.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/css-module-at-import-iframe.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/integrity-matches.js [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/integrity-mismatches.js [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/load-error-events.py [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/malformed-iframe.html
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/malformed.css
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/parse-error.css [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/referrer-checker.py [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/utf-8.css [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/utf8.css [deleted file]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/resources/windows-1250.css [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/script-element-css-src.html [new file with mode: 0644]
testing/web-platform/tests/html/semantics/scripting-1/the-script-element/css-module/utf8.tentative.html [deleted file]