Bug 1285903 - Force one content process for browser_use_counters.js because the test doesn't work if different tabs load in different processes. r=gabor
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 20 Jul 2016 14:28:00 +0200
changeset 346032 69ed8adfc7b8bc1bbcbb6ac873514baef5004ba3
parent 346031 414ef1361cd25cbf734e413b08be9538de551229
child 346033 5c7dda18ec0299ffd4059624eca09338e5124116
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor
bugs1285903
milestone50.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 1285903 - Force one content process for browser_use_counters.js because the test doesn't work if different tabs load in different processes. r=gabor
dom/base/test/browser_use_counters.js
--- a/dom/base/test/browser_use_counters.js
+++ b/dom/base/test/browser_use_counters.js
@@ -6,17 +6,22 @@ var {Promise: promise} = Cu.import("reso
 
 const gHttpTestRoot = "http://example.com/browser/dom/base/test/";
 
 /**
  * Enable local telemetry recording for the duration of the tests.
  */
 var gOldContentCanRecord = false;
 add_task(function* test_initialize() {
-   gOldContentCanRecord = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
+  // Because canRecordExtended is a per-process variable, we need to make sure
+  // that all of the pages load in the same content process. Limit the number
+  // of content processes to at most 1 (or 0 if e10s is off entirely).
+  yield SpecialPowers.pushPrefEnv({ set: [[ "dom.ipc.processCount", 1 ]] });
+
+  gOldContentCanRecord = yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
     let telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
     let old = telemetry.canRecordExtended;
     telemetry.canRecordExtended = true;
     return old;
   });
   info("canRecord for content: " + gOldContentCanRecord);
 });