Closed Bug 908439 Opened 11 years ago Closed 11 years ago

Rewrite some tests to SpecialPowers.pushPrefEnv/pushPermissions

Categories

(Testing :: Mochitest, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla26

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

References

()

Details

Attachments

(1 file, 5 obsolete files)

Attached patch 629535.diff (obsolete) (deleted) — Splinter Review
That makes this test work in b2g mochitest.
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 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+
Yes, will do.
Attached patch test_bug629535.diff (obsolete) (deleted) — Splinter Review
Attached patch 908439.diff (obsolete) (deleted) — Splinter Review
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
Summary: Make test_bug629535.html use SpecialPowers.pushPrefEnv → Rewrite some tests to SpecialPowers.pushPrefEnv/pushPermissions
Attached patch 908439.diff (obsolete) (deleted) — Splinter Review
Attachment #795401 - Attachment is obsolete: true
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.
Attached patch 908439_final.diff (obsolete) (deleted) — Splinter Review
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 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+
(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
Keywords: checkin-needed
(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.
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.

Attachment

General

Created:
Updated:
Size: