Bug 1257972 - Put users currently running an experiment into the disqualified cohort of the e10s rollout system add-on. r=Mossop
authorFelipe Gomes <felipc@gmail.com>
Mon, 21 Mar 2016 13:20:17 -0300
changeset 289730 08e7097a302f34a66812f609d0b53394670b06e2
parent 289729 66ee9fcbbbd3f207c3fcc141aa2da12ca9534894
child 289731 d1cd0639aa524dd2f04a3111e4a4e051af4a39c7
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1257972
milestone48.0a1
Bug 1257972 - Put users currently running an experiment into the disqualified cohort of the e10s rollout system add-on. r=Mossop MozReview-Commit-ID: 4NQo6d672rR
browser/extensions/e10srollout/bootstrap.js
--- a/browser/extensions/e10srollout/bootstrap.js
+++ b/browser/extensions/e10srollout/bootstrap.js
@@ -51,17 +51,18 @@ function defineCohort() {
   let updateChannel = UpdateUtils.getUpdateChannel(false);
   if (!(updateChannel in TEST_THRESHOLD)) {
     setCohort("unsupportedChannel");
     return;
   }
 
   let userOptedOut = optedOut();
   let userOptedIn = optedIn();
-  let disqualified = (Services.appinfo.multiprocessBlockPolicy != 0);
+  let disqualified = (Services.appinfo.multiprocessBlockPolicy != 0) ||
+                     isThereAnActiveExperiment();
   let testGroup = (getUserSample() < TEST_THRESHOLD[updateChannel]);
 
   if (userOptedOut) {
     setCohort("optedOut");
   } else if (userOptedIn) {
     setCohort("optedIn");
   } else if (disqualified) {
     setCohort("disqualified");
@@ -107,8 +108,12 @@ function optedOut() {
   // Users can also opt-out by toggling back the pref to false.
   // If they reset the pref instead they might be re-enabled if
   // they are still part of the threshold.
   return Preferences.get(PREF_E10S_FORCE_DISABLED, false) ||
          (Preferences.isSet(PREF_TOGGLE_E10S) &&
           Preferences.get(PREF_TOGGLE_E10S) == false);
 }
 
+function isThereAnActiveExperiment() {
+  let { Experiments } = Cu.import("resource:///modules/experiments/Experiments.jsm", {});
+  return (Experiments.instance().getActiveExperiment() !== null);
+}