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
--- 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);
+}