Bug 1444680: Follow-up: Fix mozAddonManager API tests for non-HTTP test host access. r=bustage CLOSED TREE
authorKris Maglione <maglione.k@gmail.com>
Mon, 12 Mar 2018 14:47:30 -0700
changeset 407818 fb71712aceeb4be0ce59078c1e65f717a57582c8
parent 407817 139930cd68e2d8f138837b282b8101e550fc5f41
child 407819 edcbf982b033f497ed65c39a812e5252a1988f24
push id33621
push userapavel@mozilla.com
push dateTue, 13 Mar 2018 17:12:05 +0000
treeherdermozilla-central@deb7714a7bcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1444680
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1444680: Follow-up: Fix mozAddonManager API tests for non-HTTP test host access. r=bustage CLOSED TREE MozReview-Commit-ID: 1nYFNgbnzsX
toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js
toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
--- a/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_webRequest_permission.js
@@ -74,16 +74,17 @@ add_task(async function test_permissions
   await contentPage.loadFrameScript(frameScript);
 
   let results = await contentPage.sendMessage("Test:Check", {});
   equal(results.page, "redirected", "Regular webRequest redirect works on an unprivileged page");
   equal(results.script, "redirected", "Regular webRequest redirect works from an unprivileged page");
 
   Services.prefs.setBoolPref(PREF_DISABLE_SECURITY, true);
   Services.prefs.setBoolPref("extensions.webapi.testing", true);
+  Services.prefs.setBoolPref("extensions.webapi.testing.http", true);
 
   results = await contentPage.sendMessage("Test:Check", {});
   equal(results.page, "original", "webRequest redirect fails on a privileged page");
   equal(results.script, "original", "webRequest redirect fails from a privileged page");
 
   await extension.unload();
   await contentPage.close();
 });
--- a/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
+++ b/toolkit/mozapps/extensions/AddonManagerWebAPI.cpp
@@ -72,17 +72,17 @@ AddonManagerWebAPI::IsValidSite(nsIURI* 
 {
   if (!uri) {
     return false;
   }
 
   bool isSecure;
   nsresult rv = uri->SchemeIs("https", &isSecure);
   if (NS_FAILED(rv) || !isSecure) {
-    if (!(xpc::IsInAutomation() && Preferences::GetBool("extensions.webapi.testing", false))) {
+    if (!(xpc::IsInAutomation() && Preferences::GetBool("extensions.webapi.testing.http", false))) {
       return false;
     }
   }
 
   nsAutoCString host;
   rv = uri->GetHost(host);
   if (NS_FAILED(rv)) {
     return false;