Bug 1257972 - Put users currently running an experiment into the disqualified cohort of the e10s rollout system add-on. r=Mossop draft
authorFelipe Gomes <felipc@gmail.com>
Fri, 18 Mar 2016 18:08:38 -0300
changeset 342325 56650453bd09119c6cd35cb5ba73de61ba738632
parent 341653 3e04659fdf6aef792f7cf9840189c6c38d08d1e8
child 516557 7ec8d0b0af465a7389eeafbf8314f6411a2115e6
push id13391
push userfelipc@gmail.com
push dateFri, 18 Mar 2016 21:09:38 +0000
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: KM28xepdbIj
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,14 @@ 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 tmp = {};
+  Cu.import("resource:///modules/experiments/Experiments.jsm", tmp);
+  let experiments = tmp.Experiments.instance();
+  return (experiments.getActiveExperiment() !== null);
+}