commit | 610407096586f474c58dc05c7ed5c051384fcd27 | [log] [tgz] |
---|---|---|
author | Hiroki Nakagawa <nhiroki@chromium.org> | Tue May 29 09:52:13 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Tue May 29 09:52:13 2018 |
tree | a6924536a926c99f1b3c8b8d41731304cdf63447 | |
parent | 98fe9fd252710d87f6f2c67fcee432aae4fd8501 [diff] |
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 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#562380}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .