Closed Bug 1464980 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 11216 - Worker: Clean up tests for module imports on dedicated workers using "export"


(Core :: DOM: Workers, enhancement, P4)




Tracking Status
firefox62 --- fixed


(Reporter: wptsync, Unassigned)




(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 11216 into mozilla-central (this bug is closed when the sync is complete).

Details from upstream follow.

Hiroki Nakagawa <> wrote:
>  Worker: Clean up tests for module imports on dedicated workers using "export"
>  This is a clean-up CL for existing tests, and doesn't add new tests.
>  Before this CL, the tests work as follows: the top-level script imports modules,
>  each module postMessage('LOADED') to the page on load, and the page waits for
>  them all. This pattern is easy to write but not easy to read because it's not
>  clear which modules are expected to be imported. Also, this pattern checks only
>  the number of imported modules, so a broken test, for example, importing a wrong
>  module can unexpectedly pass.
>  To improve the situation, this CL stops using the pattern and instead make tests
>  propagate the list of imported modules from child scripts to the top-level
>  script. The top-level script sends the list to the page as a representative.
>  This is less error-prone and clarifies which modules are expected to be
>  imported.
>  Change-Id: I08c4569b6dc69a1ecff6701df932e28dda6dc42a
>  Bug: 680046
>  Reviewed-on:
>  WPT-Export-Revision: 01bd493e2d2c9bde2fc7625a9aad7557a16b94a1
PR 11216 applied with additional changes from upstream: 8b68722d31dafa4e6ea81c2d80bb65b6408d01f3
Component: web-platform-tests → DOM: Workers
Product: Testing → Core
Ran 2 tests and 11 subtests
PASS   : 3
FAIL   : 1
ERROR  : 2

New tests that have failures or other problems:
/workers/modules/dedicated-worker-import-failure.html: ERROR
    Dynamic import for non-existent script should throw an exception.: TIMEOUT
    importScripts() on module worker should throw an exception.: FAIL
    Dynamic import and then static import.: NOTRUN
    Dynamic import.: NOTRUN
    Nested dynamic import.: NOTRUN
    Nested static import.: NOTRUN
    Static import and then dynamic import.: NOTRUN
    Static import.: TIMEOUT
Pushed by
[wpt PR 11216] - Worker: Clean up tests for module imports on dedicated workers using "export", a=testonly
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.