Bug 1223510, part 2 - Make ArchiveReader tests use pushPrefEnv. r=baku
authorAndrew McCreight <continuation@gmail.com>
Wed, 11 Nov 2015 14:10:26 -0800
changeset 272149 d75b1a6bc6bcf66701170c347f34bc1a8fb8f6f8
parent 272148 52d43b0a27eb82f39b3320c47cc4cb18a951e4b3
child 272150 178b6d4c6e30880cbe5d145e98a77ddb64d6eccb
push id67889
push useramccreight@mozilla.com
push dateWed, 11 Nov 2015 22:10:41 +0000
treeherdermozilla-inbound@178b6d4c6e30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1223510
milestone45.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 1223510, part 2 - Make ArchiveReader tests use pushPrefEnv. r=baku
dom/archivereader/test/helpers.js
--- a/dom/archivereader/test/helpers.js
+++ b/dom/archivereader/test/helpers.js
@@ -1,37 +1,23 @@
 /**
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-var archiveReaderEnabled = false;
-
 var testGenerator = testSteps();
 
 function runTest()
 {
-  enableArchiveReader();
+  SimpleTest.waitForExplicitFinish();
 
-  SimpleTest.waitForExplicitFinish();
-  testGenerator.next();
+  SpecialPowers.pushPrefEnv({'set': [ ["dom.archivereader.enabled", true] ]}, function() {
+    return testGenerator.next();
+  });
 }
 
 function finishTest()
 {
-  resetArchiveReader();
-
-  SimpleTest.executeSoon(function() {
+  SpecialPowers.popPrefEnv(function() {
     testGenerator.close();
     SimpleTest.finish();
   });
 }
-
-function enableArchiveReader()
-{
-  archiveReaderEnabled = SpecialPowers.getBoolPref("dom.archivereader.enabled");
-  SpecialPowers.setBoolPref("dom.archivereader.enabled", true);
-}
-
-function resetArchiveReader()
-{
-  SpecialPowers.setBoolPref("dom.archivereader.enabled", archiveReaderEnabled);
-}