Closed Bug 2025775 Opened 4 months ago Closed 4 months ago

browser_elevationDialog.js fails standalone due to uninitialized UpdateServiceStub causing extra elevation dialog

Categories

(Toolkit :: Application Update, defect)

defect

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: florian, Assigned: florian)

References

Details

Attachments

(1 file)

browser_elevationDialog.js fails when run standalone but passes in the full folder.

The root cause is that when run standalone, the UpdateServiceStub has not been initialized (because app.update.disabledForTesting is true during browser startup). When the elevation dialog's onLoad calls getReadyUpdate()AUS.init(), this triggers a full stub initialization including UpdateServiceStub.#initUpdate()reload(false) + aus.internal.init(false). The init(false) creates a new #asyncInit() (since #initPromise was never cached — testPostUpdateProcessing() uses force=true which bypasses it). This extra #asyncInit() sees the pending-elevate state and schedules an extra elevation dialog via setTimeout. The extra dialog gets captured by the window listener for the next test iteration, and its onLoad crashes with update is null.

In folder runs, a previous test already initializes the stub, so the dialog's getReadyUpdate() returns immediately without triggering another init.

The fix is to add await gAUS.init() after setting PREF_APP_UPDATE_DISABLEDFORTESTING to false, ensuring the stub is initialized before elevation dialogs are opened.

Note: this bug description was written by Claude and I have not fully verified it, so take it more as a hint than as solid statement of facts. I have however verified that ./mach test toolkit/mozapps/update/tests/browser/browser_elevationDialog.js --headless fails locally without the patch, and ./mach test toolkit/mozapps/update/tests/browser/browser_elevationDialog.js --headless --verify passes locally with the patch.

Attachment #9557363 - Attachment description: Bug 2025775 - Initialize UpdateServiceStub before opening elevation dialogs in browser_elevationDialog.js, r=#application-update-reviewers. → Bug 2025775 - Initialize update service before opening elevation dialogs in browser_elevationDialog.js, r=#application-update-reviewers.
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/6c022cc9374d https://hg.mozilla.org/integration/autoland/rev/46d682127d9a Initialize update service before opening elevation dialogs in browser_elevationDialog.js, r=application-update-reviewers,nalexander.
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: