Closed Bug 1584132 Opened 5 years ago Closed 3 years ago

Add test to ensure "choose what to sync" dialog's preferences are updated before we enable sync

Categories

(Firefox :: Sync, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: markh, Assigned: skhamis)

References

Details

Attachments

(1 file)

In the review for bug 1570567, Gijs suggested we add tests to ensure that the <preference> elements in our subdialog are updated before the completionCallback fires and we enable sync - in his words, "Seems like something that could accidentally break if we ever become more lazy about how we process preference changes in non-instantapply dialogs like this one."

Priority: -- → P3

The ask here is to add a test for https://searchfox.org/mozilla-central/source/browser/components/preferences/dialogs/syncChooseWhatToSync.xhtml, and specifically, that by the time this callback is called, the actual preferences match the state of the buttons in the dialog.

This will involve adding a new test file in browser/components/preferences/tests/ - it's probably OK to just test the dialog itself - ie, to have the test make the same call that sync.js does - eg, the test could just call openAndLoadSubDialog (in head.js in that same directory), passing in a custom close callback as a param. It should programatically hit the checkboxes before hitting "Accept" then checking that `Services.prefs.getBoolPref('pref-name') is correct for each of the buttons. While we are at it, we should also set some checkboxes then hit the cancel button and ensure the prefs were not set for the enabled checkboxes.

This is going to require additional guidance but should be enough to get started.

Assignee: nobody → skhamis
Status: NEW → ASSIGNED
Pushed by lobailey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6a07d274ce0e
Added test to ensure chooseWhatToSync dialog correctly updates. r=markh,preferences-reviewers,Gijs
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: