Bug 1363760 - Part 2 - Corrected the permission that is reset at the end of a test r=aswan
authorAlex Gaynor <agaynor@mozilla.com>
Tue, 30 May 2017 10:08:55 -0400
changeset 361849 0205cdd17a67
parent 361848 65fcedb6c1f8
child 361850 71e0ff5a6c76
push id31945
push userryanvm@gmail.com
push dateThu, 01 Jun 2017 20:42:17 +0000
treeherdermozilla-central@15e32469eb04 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1363760
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1363760 - Part 2 - Corrected the permission that is reset at the end of a test r=aswan Without this change, browser_update.js "resets" a preference that it never changed to a different value, which leaks through to future tests. This was introduced in a8fcca075fde, and appears to be a simple mistake since that change removes a setup/teardown pref change pair, but the prefs it changes are two different ones! This leaked pref change leads to test failures when special powers and mochitest are installed as non-temporary addons. MozReview-Commit-ID: 2jx3fB1iZMx
toolkit/mozapps/extensions/test/browser/browser_update.js
--- a/toolkit/mozapps/extensions/test/browser/browser_update.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_update.js
@@ -3,17 +3,19 @@
  */
 
 // Tests that updates correctly flush caches and that new files gets updated.
 
 function test() {
   requestLongerTimeout(2);
   waitForExplicitFinish();
 
-  Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
+  SpecialPowers.pushPrefEnv({"set": [
+    ["extensions.checkUpdateSecurity", false],
+  ]});
 
   run_next_test();
 }
 
 // Install a first version
 add_test(function() {
   AddonManager.getInstallForURL(TESTROOT + "addons/browser_update1_1.xpi",
                                 function(aInstall) {
@@ -38,16 +40,14 @@ add_test(function() {
     Services.ppmm.removeMessageListener("my-addon-2", messageListener);
     ok(true, "second version sent frame script message");
     run_next_test();
   });
 });
 
 // Finally, cleanup things
 add_test(function() {
-  Services.prefs.setBoolPref("xpinstall.signatures.required", true);
-
   AddonManager.getAddonByID("update1@tests.mozilla.org", function(aAddon) {
     aAddon.uninstall();
 
     finish();
   });
 });