Closed Bug 1452957 Opened 7 years ago Closed 7 years ago

reftests should support preferences with Unicode strings

Categories

(Testing :: Reftest, enhancement, P1)

enhancement

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Right now the reftest extension makes use of `getCharPref` for retrieving strings from preferences, which includes the reftest file objects list which is located in the profile. Sadly this method doesn't support Unicode characters, and as such we have failures like bug 1452913. To fix that we have to make use of `getStringPref` or even better the Preferences.jsm Javascript module.
All the sanity reftest tests fail for this try build: https://treeherder.mozilla.org/#/jobs?repo=try&revision=4ae1a6e0ef316c75c808aafacb73ee567e278d1a&selectedJob=172881274 The problem is that the negative tests are causing problems in resetting a preference. I would suggest that in this case we keep it simple and simply make the change from `getCharPref` to `getStringPref`, and the same for `setCharPref`.
Summary: Use Preferences.jsm to support preferences with Unicode strings → reftests should support preferences with Unicode strings
FYI `getStringPref` and `setStringPref` are new and have been added for Firefox 58. So we will be fine on central.
Attachment #8966600 - Flags: review?(gbrown)
Comment on attachment 8966600 [details] Bug 1452957 - reftests should support preferences with Unicode strings. https://reviewboard.mozilla.org/r/235318/#review241078 I suppose that for any pref with an all-ascii value, getStringPref will return the same content as getCharPref (but in a different type of course) -- that seems safe. I am a little surprised that changing the type of all of these variables (g.logLevel, etc) to Unicode strings doesn't require any other changes, but I can't see anything specifically wrong, and your try run seems to be greening up nicely.
Attachment #8966600 - Flags: review?(gbrown) → review+
Comment on attachment 8966600 [details] Bug 1452957 - reftests should support preferences with Unicode strings. https://reviewboard.mozilla.org/r/235318/#review241078 It seems that all of that depends on which internal string class is used for the argument and return value. So what's used here seems to handle both nicely. It's definitely easier to handle as in legacy Python.
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a78a6a4e6bf4 reftests should support preferences with Unicode strings. r=gbrown
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: