Closed Bug 2080467 Opened 1 month ago Closed 1 month ago

WebExtensionTest#testExtensionProcessCrash never crashes an extension process

Categories

(GeckoView :: Extensions, defect)

All
Android
defect

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: RyanVM, Assigned: RyanVM)

Details

Attachments

(1 external file)

WebExtensionTest#testExtensionProcessCrash, added in bug 1819737, loads about:crashextensions and expects ExtensionProcessDelegate.onDisabledProcessSpawning to be called once. In the GeckoView junit runtime it is never called, and the test passes only because end-of-test @AssertCalled counts are not checked (bug 2080318).

The junit runtime starts with extensions.webextensions.remote set to false, and ExtensionPolicyService caches that pref on first read, so setting it in the test does not move extensions out of the parent process. The test's extension, borderify.xpi, also has no background page, so there is no extension process for about:crashextensions to kill. With an extension that has a background page, its background load is refused in the parent process with NS_ERROR_CONTENT_BLOCKED.

Severity: -- → S4

The shared junit runtime starts with extensions.webextensions.remote=false and ExtensionPolicyService caches
that value, so the test's pref flip left extensions in the parent process, and borderify has no background
page, so about:crashextensions had nothing to kill. Start a TestRuntimeService in its own process with
extensionsProcessEnabled(true) and a crash threshold of 0, wait for the messaging extension's background page,
then check that crashing the extension process calls onDisabledProcessSpawning exactly once.

Attachment #9661450 - Attachment description: WIP: Bug 2080467 - Run testExtensionProcessCrash in a separate runtime with the extension process enabled. r=#geckoview-reviewers → Bug 2080467 - Run testExtensionProcessCrash in a separate runtime with the extension process enabled. r=#geckoview-reviewers
Pushed by rvandermeulen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bdd62939a224 https://hg.mozilla.org/integration/autoland/rev/03eb2b1b0144 Run testExtensionProcessCrash in a separate runtime with the extension process enabled. r=geckoview-reviewers,android-addons-reviewers,robwu,jonalmeida
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: