Bug 1359495 - Expose webextension status in the multi cohorts. r=Felipe draft
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 25 Apr 2017 13:59:16 -0700
changeset 568183 d8b27f59e94be16a84f1f71020ec9a9c3bd9ce53
parent 568182 3015ebd8b99f4118b1eb5459b53eb320a1ec40f3
child 568184 852530b236e845d6de3ae43f40278f9ad370bea6
child 568209 45c575431a36e0b77f13116b55de523b3f97b1b6
push id55783
push userbmo:mrbkap@mozilla.com
push dateTue, 25 Apr 2017 21:08:31 +0000
reviewersFelipe
bugs1359495
milestone55.0a1
Bug 1359495 - Expose webextension status in the multi cohorts. r=Felipe
browser/extensions/e10srollout/bootstrap.js
--- a/browser/extensions/e10srollout/bootstrap.js
+++ b/browser/extensions/e10srollout/bootstrap.js
@@ -170,29 +170,36 @@ function defineCohort() {
       !inMultiExperiment ||
       userOptedIn.multi ||
       disqualified ||
       getAddonsDisqualifyForMulti()) {
     Preferences.reset(PREF_E10S_PROCESSCOUNT + ".web");
     return;
   }
 
+  // If we got here with a cohortPrefix, it must be "addons-set50allmpc-",
+  // and we know because of getAddonsDisqualifyForMulti that the addons that
+  // are installed must be web extensions.
+  if (cohortPrefix) {
+    cohortPrefix = "webextensions-";
+  }
+
   // The user is in the multi experiment!
   // Decide how many content processes to use for this user.
   let BUCKETS = {
     1: .25,
     2: .5,
     4: .75,
     8: 1
   };
 
   let multiUserSample = getUserSample(true);
   for (let sampleName of Object.getOwnPropertyNames(BUCKETS)) {
     if (multiUserSample < BUCKETS[sampleName]) {
-      setCohort(`multiBucket${sampleName}`);
+      setCohort(`${cohortPrefix}multiBucket${sampleName}`);
       Preferences.set(PREF_E10S_PROCESSCOUNT + ".web", sampleName);
       break;
     }
   }
 }
 
 function shutdown(data, reason) {
 }