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"

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: wptsync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

PR: https://github.com/web-platform-tests/wpt/pull/11216
Details from upstream follow.

Hiroki Nakagawa <nhiroki@chromium.org> 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: https://chromium-review.googlesource.com/1075843
>  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
TIMEOUT: 2
ERROR  : 2
NOTRUN : 5

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
/workers/modules/dedicated-worker-import.html
    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 james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2328200e4c9b
[wpt PR 11216] - Worker: Clean up tests for module imports on dedicated workers using "export", a=testonly
https://hg.mozilla.org/mozilla-central/rev/2328200e4c9b
Status: NEW → RESOLVED
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.