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}
11 files changed