Provide a way to use service workers as the background script in existing tests, possibly by only
requiring minimal changes to the existing test cases.
This patch includes:
- changes needed to detect when a test extension is being created for a test running in
the "background service worker mode" and automatically turn the background script into
a background service worker (instead of a background page) when not explicitly listed
in the test extension manifest
- a new mochitest-serviceworker.ini manifest where new or existing test files meant to be run on a
background service worker can be added to run them automatically in the "background service worker mode"
- a new test_verify_sw_mode.html smoke test that make sure the mochitest-serviceworker.ini manifest
is running in the expected mode.
- a new `sw-webextension` tag, which can be used locally to run a test file only in the
"background service worker mode"
- changes to test_ext_test.html to make it able to run in both background pages and background workers
- small tweaks to `test` API (both the WebIDL binding and the current bindings injected from privileged
js code, to better match each other behavior)
Differential Revision: https://phabricator.services.mozilla.com/D122536