Closed Bug 668249 Opened 14 years ago Closed 14 years ago

mozprofile:preferences does not preserve the order of preferences

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jmaher, Assigned: k0scist)

References

Details

(Whiteboard: [mozmill-2.0+])

Attachments

(1 file, 1 obsolete file)

while looking into setting enablePrivilege for unittests that require it (for the time being), I found that I need these preferences in order: user_pref("capability.principal.codebase.p1.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalPreferencesRead"); user_pref("capability.principal.codebase.p1.id", "http://localhost"); user_pref("capability.principal.codebase.p1.subjectName", ""); In addition, these need to be in prefs.js, not user.js. I can easily work around this, but we should make some of this setup by default with the mozprofile:preferences.
Assignee: nobody → jhammel
prefs.js is doable..... i wasn't aware that preference order ever mattered. Really?
Attached patch WIP (obsolete) — Splinter Review
Found some difficulties going forward while I'll address in other bugs, but here's a WIP that works at the mozprofile level but breaks other things (currently)
(In reply to comment #1) > i wasn't aware that preference order ever mattered. Really? That's news to me too. There should be no requirement to the order of prefs in that file.
Depends on: 668676
These prefs need to be in order: http://hg.mozilla.org/build/talos/file/1128691728d8/base_profile/prefs.js Otherwise we never set the *.id pref and don't grant access to the value:( Yes, this sounds silly, but it is the truth for mozilla-central builds. Whether intended or not, I don't know.
Joel, that really sounds like a bug to me. Can you please file a new bug against the preferences system?
I also wonder if this is a bug. Regardless, in thinking it over I do think mozprofile should preserve the order of preferences. If, for whatever reason, a consumer feeds in preferences in a certain order, we should keep that order. (If the consumer gives us a dict, then by nature the order doesn't matter). There may be legitimate reasons to do this, but in any case it lets us test what we're testing instead of having an implicit abstraction layer that will make things harder to test and debug if things go wrong (including, e.g., looking at the file by hand and going "What happened to this preference that I thought I set?" when it was implicitly overridden). It is a little more legwork to do this in mozprofile, but I think its worth it.
Depends on: 668845
No longer depends on: 668845
Whiteboard: [mozmill-2.0?]
this deals with preferences in order in addition to fixing the problem of bug 668676 :jmaher, if you don't want to review, I can pass it on to :harth or :ctalbert. Also, please file any follow-up bugs if desired
Attachment #543277 - Attachment is obsolete: true
Attachment #543492 - Flags: review?(jmaher)
Attachment #543492 - Flags: review?(jmaher) → review?(fayearthur+bugs)
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
Comment on attachment 543492 [details] [diff] [review] preferences are now ordered looks good.
Attachment #543492 - Flags: review?(fayearthur+bugs) → review+
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: