Closed Bug 1197266 Opened 9 years ago Closed 9 years ago

pushPrefEnv values aren't reset in between mochitest-browser tests

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: bgrins, Unassigned)

References

Details

Attachments

(2 files)

After setting some prefs via pushPrefEnv in one test, I noticed that the prefs weren't being reset in the next test.  It seems that flushPrefEnv isn't being called in between tests.
You can see the failure by applying this patch and then running:

./mach mochitest -f browser browser/base/content/test/general/ --start-at browser_mixedcontent_securityflags.js --end-at browser_no_mcb_on_http_site.js

100 INFO TEST-UNEXPECTED-FAIL | browser/base/content/test/general/browser_no_mcb_on_http_site.js | Default value has been restored - Got true, expected false
Stack trace:
Reminds me of bug 943152, which was for mochitest-chrome.
See Also: → 943152
I guess this is where the specialpowers stuff is injected for mochitest-browser:
http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/browser-test.js#156
Perhaps, it would just work if you replace in that line ChromePowers.js with specialpowers.js.

I tried the same in bug 1041563, but there it was part of the whole ChromePowers.js removal.
(In reply to Martijn Wargers [:mwargers] (QA) from comment #3)
> I guess this is where the specialpowers stuff is injected for
> mochitest-browser:
> http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/browser-test.
> js#156
> Perhaps, it would just work if you replace in that line ChromePowers.js with
> specialpowers.js.
> 
> I tried the same in bug 1041563, but there it was part of the whole
> ChromePowers.js removal.

Maybe we need to call SpecialPowers.flushPrefEnv in that file somewhere in a cleanup function
Yes, but it would be better if we could replace ChromePowers.js with specialpowers.js.
ChromePowers.js is meant as a stub for usage in chrome, where specialpowers.js wouldn't work. It would be better if ChromePowers.js be not used, if possible.
Blocks: 1168042
This patch just flushes during nextTest. It fixes the failure with the tests added in bug 1168042.
Attachment #8662137 - Flags: review?(martijn.martijn)
Attachment #8662137 - Flags: review?(martijn.martijn) → review+
url:        https://hg.mozilla.org/integration/mozilla-inbound/rev/af944d4a75f004837d28bf109c3956db63fc589d
changeset:  af944d4a75f004837d28bf109c3956db63fc589d
user:       Neil Deakin <neil@mozilla.com>
date:       Thu Sep 17 11:20:32 2015 -0400
description:
Bug 1197266, Reset pushed pref environment between browser tests, r=martijn
https://hg.mozilla.org/mozilla-central/rev/af944d4a75f0
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: