Bug 1762225 - Test behavior of background page with extension process crash r=rpl...
commit1995f567af6302ffe742fbb3c6f861bead0272b8
authorRob Wu <rob@robwu.nl>
Mon, 14 Aug 2023 13:41:17 +0000 (14 13:41 +0000)
committerRob Wu <rob@robwu.nl>
Mon, 14 Aug 2023 13:41:17 +0000 (14 13:41 +0000)
tree1e61cb5d337ab0408e4225b6415d22fa63f2d54e
parent3292b9389e9e2bf01708006d9302f30c635130f0
Bug 1762225 - Test behavior of background page with extension process crash r=rpl,gsvelto

This does not only add new coverage, it also fixes a typo that prevented
the test from actually killing the extension process, due to an
always-false condition (like bug 1844192).

With that typo fixed, this xpcshell test will now actually trigger a
extension process crash. Because that triggers the generation of crash
dumps when MOZ_CRASHREPORTER is enabled, additional code is needed to
clean that up.

With all of that done, this test introduces coverage for the following
new scenarios:

- test_crash_while_starting_background_without_context
- test_crash_while_starting_background_with_context
- test_crash_while_starting_event_page_without_context
- test_crash_while_starting_event_page_with_context
- test_crash_after_background_startup
- test_crash_after_event_page_startup
- test_crash_and_wakeup_via_persistent_listeners

The last two tests tasks are the main scenarios of interest, because
they are the most likely to occur in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D183931
testing/mochitest/BrowserTestUtils/BrowserTestUtilsChild.sys.mjs
toolkit/components/extensions/test/xpcshell/test_ext_background_early_shutdown.js