Closed
Bug 908439
Opened 11 years ago
Closed 11 years ago
Rewrite some tests to SpecialPowers.pushPrefEnv/pushPermissions
Categories
(Testing :: Mochitest, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla26
People
(Reporter: martijn.martijn, Assigned: martijn.martijn)
References
()
Details
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
That makes this test work in b2g mochitest.
Assignee | ||
Comment 1•11 years ago
|
||
Comment on attachment 794254 [details] [diff] [review]
629535.diff
Review of attachment 794254 [details] [diff] [review]:
-----------------------------------------------------------------
I'll put this on tryserver later at some point, when I have to test some more patches.
Attachment #794254 -
Flags: review?(jmaher)
Comment 2•11 years ago
|
||
Comment on attachment 794254 [details] [diff] [review]
629535.diff
Review of attachment 794254 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/tests/mochitest/general/test_bug629535.html
@@ +18,2 @@
> const dntPref = 'privacy.donottrackheader.enabled';
> const oldDNT = SpecialPowers.getBoolPref(dntPref);
can we remove oldDNT?
Attachment #794254 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 3•11 years ago
|
||
Yes, will do.
Assignee | ||
Comment 4•11 years ago
|
||
Assignee | ||
Comment 5•11 years ago
|
||
I'm morphing this bug into adding some more tests that I'm rewriting, so they will (hopefully) work in b2g mochitest.
I pushed this to try: https://tbpl.mozilla.org/?tree=Try&rev=6630fb3d2340
Attachment #794254 -
Attachment is obsolete: true
Attachment #795147 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Summary: Make test_bug629535.html use SpecialPowers.pushPrefEnv → Rewrite some tests to SpecialPowers.pushPrefEnv/pushPermissions
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #795401 -
Attachment is obsolete: true
Assignee | ||
Comment 7•11 years ago
|
||
That last patch is with test_bug369306.html and test_idleapi_permissions.html rewritten, but still disabled in the b2g.json file, because they keep on failing.
For test_sms_basics.html, I could use the 'remove' option from pushPermissions and I then noticed I made an error with the patch from bug 909012. When the permission doesn't exist, 'remove' causes a 'hang'. This patch fixes that.
Assignee | ||
Comment 8•11 years ago
|
||
Pushed to try: https://tbpl.mozilla.org/?tree=Try&rev=bef0aecdd624
Assignee | ||
Comment 10•11 years ago
|
||
Ok, it turns out that test_idleapi_permissions.html fails when running it from inside the testrunner. It doesn't fail when running standalone.
I removed the test_idleapi_permissions.html in this patch and I'll investigate that in a new bug.
The tryserver is for the rest all green. I triggered some reruns for the chunks in b2g mochitest to make sure there is no intermittent orange.
Attachment #796879 -
Attachment is obsolete: true
Attachment #797116 -
Flags: review?(jmaher)
Comment 11•11 years ago
|
||
Comment on attachment 797116 [details] [diff] [review]
908439_final.diff
Review of attachment 797116 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/tests/test_sms_basics.html
@@ +23,5 @@
> }
>
> function checkSmsEnabled() {
> // Bug 784617: WebSms is disabled on all platforms except Android for the moment.
> + if (navigator.appVersion.indexOf("Android") == -1 && SpecialPowers.Services.appinfo.name != "B2G") {
is there not a way to check for android in appinfo?
@@ +90,5 @@
> +function test5() {
> + if (!defaultEnabled)
> + checkSmsDisabled();
> + else
> + checkSmsEnabled();
this is repeated 4 times, could we make a function for this?
::: dom/tests/mochitest/bugs/test_bug265203.html
@@ +97,5 @@
> if (gTestStarted)
> return;
> gTestStarted = true;
>
> + SpecialPowers.pushPrefEnv({"set": [["accessibility.browsewithcaret", true]]}, test0);
this test case is cleaned up very nicely!
Attachment #797116 -
Flags: review?(jmaher) → review+
Assignee | ||
Comment 12•11 years ago
|
||
(In reply to Joel Maher (:jmaher) from comment #11)
> Comment on attachment 797116 [details] [diff] [review]
> is there not a way to check for android in appinfo?
Yeah, there is. However, I'll do that in a different patch. There are more test files that do the same and I can change them at the same time.
> this is repeated 4 times, could we make a function for this?
I did that in this patch and named it "checkSmsDisabledOrEnabled".
Attachment #797116 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 13•11 years ago
|
||
(In reply to Martijn Wargers [:mwargers] (QA) from comment #10)
> I removed the test_idleapi_permissions.html in this patch and I'll
> investigate that in a new bug.
I filed bug 910907 for it.
Comment 14•11 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Comment 15•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•