Open Bug 1722683 Opened 3 years ago Updated 3 years ago

openPreferencesViaOpenPreferencesAPI assumes pref pane initialization is synchronous, but experimental prefs init is asynchronous, which breaks browser_basic_rebuild_fonts_test.js

Categories

(Firefox :: Settings UI, defect, P3)

Desktop
All
defect

Tracking

()

Tracking Status
firefox92 --- affected

People

(Reporter: Gijs, Unassigned)

References

Details

https://searchfox.org/mozilla-central/rev/a9db89754fb507254cb8422e5a00af7c10d98264/browser/components/preferences/tests/head.js#97-118

expects that once the sync or privacy pane loads, that's it.

Unfortunately, the init for experimental prefs is async (!) and can thus finish later. If/when that happens, it calls updateAllElements some more, which re-sets prefs. If tests try to change prefs with delayprefsave before this call happens, their changes get reset and this breaks tests.

The patch in bug 1722561 will fix this by removing the updateAllElements call, but it still seems wise to update the helper to be more robust and wait for the experimental prefs init to have finished. My comment on the patch review:

Can we make preferencesBindings.js fire a custom event on the document root, and use waitForEvent here if updateQueued is true, to avoid the yucky waitForCondition?

seems like it might be a worthwhile addition to this helper as well...

Mentor: jaws
Severity: -- → S4
Priority: -- → P3

I have a WIP patch but it causes leaks: https://treeherder.mozilla.org/jobs?repo=try&revision=a8713d27cd06696daa8696d4d0238e87c66d74db&selectedTaskRun=UT6mvFQuS8u0SwyFXWFOUw.0

Not sure if keeping this as a mentored bug is likely to pan out given that... Jared, wdyt?

Flags: needinfo?(jaws)

Yeah, I'll remove myself as mentor

Mentor: jaws
Flags: needinfo?(jaws)
You need to log in before you can comment on or make changes to this bug.