Bug 948569 - Follow-up: disable test if feature is disabled. r=self, a=bustage
authorRichard Newman <rnewman@mozilla.com>
Fri, 13 Dec 2013 18:41:18 -0800
changeset 167700 ecfaa4a0cd8d4c64e87f4d7766a98d6d01198fee
parent 167699 10ecc8f4258ec36e24f502c6e8897a7149cb9398
child 167701 0ecb757f94de7e8a5effbd35d32fbf9bc94c0d2a
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersself, bustage
bugs948569
milestone27.0
Bug 948569 - Follow-up: disable test if feature is disabled. r=self, a=bustage
netwerk/test/unit/test_seer.js
--- a/netwerk/test/unit/test_seer.js
+++ b/netwerk/test/unit/test_seer.js
@@ -282,14 +282,20 @@ var tests = [
   test_pageload,
   test_redirect,
   test_startup,
   test_dns,
   test_origin
 ];
 
 function run_test() {
+  let prefs = Cc["@mozilla.org/preferences-service;1"]
+                .getService(Components.interfaces.nsIPrefBranch);
+  if (!prefs.getBoolPref("network.seer.enabled")) {
+    return;
+  }
+
   tests.forEach(add_test);
   profile = do_get_profile();
   seer = Cc["@mozilla.org/network/seer;1"].getService(Ci.nsINetworkSeer);
   do_register_cleanup(reset_seer);
   run_next_test();
 }