Bug 1288178 - add Test Pilot to mozAddonManager allow list r?rhelmer draft
authorWil Clouser <wclouser@mozilla.com>
Tue, 09 Aug 2016 15:15:01 -0700
changeset 398877 4854608587635b59d2f387b00551c1f88b590609
parent 398604 6cf0089510fad8deb866136f5b92bbced9498447
child 527781 1fb657496ba57b0c227ea8ff85db43a7c04e1a74
push id25665
push userbmo:wclouser@mozilla.com
push dateTue, 09 Aug 2016 22:34:03 +0000
reviewersrhelmer
bugs1288178
milestone51.0a1
Bug 1288178 - add Test Pilot to mozAddonManager allow list r?rhelmer MozReview-Commit-ID: Klx75vFhKUI
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -62,20 +62,21 @@ const PREF_EM_CHECK_COMPATIBILITY_BASE =
 var PREF_EM_CHECK_COMPATIBILITY = MOZ_COMPATIBILITY_NIGHTLY ?
                                   PREF_EM_CHECK_COMPATIBILITY_BASE + ".nightly" :
                                   undefined;
 
 const TOOLKIT_ID                      = "toolkit@mozilla.org";
 
 const VALID_TYPES_REGEXP = /^[\w\-]+$/;
 
-const WEBAPI_INSTALL_HOSTS = ["addons.mozilla.org", "addons.cdn.mozilla.net"];
+const WEBAPI_INSTALL_HOSTS = ["addons.mozilla.org", "addons.cdn.mozilla.net", "testpilot.firefox.com"];
 const WEBAPI_TEST_INSTALL_HOSTS = [
   "addons.allizom.org", "addons-stage-cdn.allizom.org",
   "addons-dev.allizom.org", "addons-dev-cdn-allizom.org",
+  "testpilot.stage.mozaws.net", "testpilot.dev.mozaws.net",
   "example.com",
 ];
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/AsyncShutdown.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
--- a/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
+++ b/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
@@ -35,26 +35,29 @@ AddonManagerWebAPI::IsValidSite(nsIURI* 
 
   nsCString host;
   rv = uri->GetHost(host);
   if (NS_FAILED(rv)) {
     return false;
   }
 
   if (host.Equals("addons.mozilla.org") ||
-      host.Equals("discovery.addons.mozilla.org")) {
+      host.Equals("discovery.addons.mozilla.org") ||
+      host.Equals("testpilot.firefox.com")) {
     return true;
   }
 
   // When testing allow access to the developer sites.
   if (Preferences::GetBool("extensions.webapi.testing", false)) {
     if (host.Equals("addons.allizom.org") ||
         host.Equals("discovery.addons.allizom.org") ||
         host.Equals("addons-dev.allizom.org") ||
         host.Equals("discovery.addons-dev.allizom.org") ||
+        host.Equals("testpilot.stage.mozaws.net") ||
+        host.Equals("testpilot.dev.mozaws.net") ||
         host.Equals("example.com")) {
       return true;
     }
   }
 
   return false;
 }