Bug 1401249 - Fix getStringPref usage in clicktoplay-rollout. r=Gijs draft
authorFelipe Gomes <felipc@gmail.com>
Tue, 19 Sep 2017 13:32:19 -0300
changeset 667040 4315164cc3f65269ac1d94061c416d5796adc0b5
parent 667039 2a8f5f48a4b43b6ba44669a8df9b398057c7880f
child 732282 99456b89cd74331264df3125720df6d6ff55c5c7
push id80597
push userfelipc@gmail.com
push dateTue, 19 Sep 2017 16:33:20 +0000
reviewersGijs
bugs1401249
milestone56.0
Bug 1401249 - Fix getStringPref usage in clicktoplay-rollout. r=Gijs getStringPref(.., undefined) actually returns null instead of undefined. MozReview-Commit-ID: H7aSQGnH8rK
browser/extensions/clicktoplay-rollout/bootstrap.js
--- a/browser/extensions/clicktoplay-rollout/bootstrap.js
+++ b/browser/extensions/clicktoplay-rollout/bootstrap.js
@@ -66,16 +66,18 @@ function defineCohort() {
         // intentionally missing from the list is STATE_ENABLED,
         // which will keep cohort undefined.
         break;
     }
   }
 
   switch (cohort) {
     case undefined:
+    case null:
+    case "":
     case "test":
     case "control":
     case "excluded":
     {
       // If it's either test/control, the cohort might have changed
       // if the desired sampling has been changed.
       let testThreshold = TEST_THRESHOLD[updateChannel];
       let userSample = getUserSample();