Closed Bug 841249 Opened 10 years ago Closed 10 years ago

[Robocop] Tests for distribution preferences

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: Margaret, Assigned: capella)

References

Details

Attachments

(1 file, 1 obsolete file)

In preferences.json, you can specify preferences like this:

  "Preferences": {
    "distribution.test.string": "my test string pref",
    "distribution.test.boolean": true,
    "distribution.test.int": 5
  }

We should make sure this works. Once bug 840825 lands, it should be pretty simple to add this testcase there.
Attached patch Patch (v1) (obsolete) — Splinter Review
First try, small patch.
Assignee: nobody → markcapella
Status: NEW → ASSIGNED
Attachment #718135 - Flags: review?(margaret.leibovic)
Comment on attachment 718135 [details] [diff] [review]
Patch (v1)

Review of attachment 718135 [details] [diff] [review]:
-----------------------------------------------------------------

Nice! Thanks for helping out. I was about to say that you need to update mock-package.zip, but then I realized that we're already setting these prefs in there, which is cool.

::: mobile/android/base/tests/testDistribution.java.in
@@ +120,3 @@
>                  }
>              }
> +            mAsserter.is(mTestPrefCount, TEST_PREF_STORED, "check all stored preferences found");

Is there any reason we wouldn't get all 6 preferences back? Could we just check that preferences.length() is 6? If we do decide to explicitly check that we checked each preference, I think we could just make a local testPrefCount variable, instead of making a member variable for the count.
I can remove that ... I had put that in during testing various options and accidentally misnamed a pref ... for finalized / controlled tests like this getting back preferences we've explicitly set should be a safe assumption.
Attached patch Patch (v2)Splinter Review
Removed prefs counting test ...
Attachment #718135 - Attachment is obsolete: true
Attachment #718135 - Flags: review?(margaret.leibovic)
Attachment #718746 - Flags: review?(margaret.leibovic)
Attachment #718746 - Flags: review?(margaret.leibovic) → review+
https://hg.mozilla.org/mozilla-central/rev/62f32eb94356
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.