Bug 1202421 - Rename the network.auth.allow-subresource-auth pref. r=michal
authorDragana Damjanovic dd.mozilla@gmail.com
Tue, 08 Sep 2015 08:21:19 -0700
changeset 294039 e009d40f03dce35125867be0b32840888c3356b9
parent 294038 7364ae67d69e4b0579de19296f354f0fef26335f
child 294040 ce582bee57cb1a7a81303dc3b41289c01345b06a
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1202421
milestone43.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 1202421 - Rename the network.auth.allow-subresource-auth pref. r=michal
dom/media/webaudio/test/test_mediaElementAudioSourceNodeCrossOrigin.html
modules/libpref/init/all.js
netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
netwerk/test/unit/test_auth_dialog_permission.js
netwerk/test/unit/test_auth_proxy.js
netwerk/test/unit/test_authentication.js
toolkit/components/passwordmgr/test/test_prompt_async.html
toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
--- a/dom/media/webaudio/test/test_mediaElementAudioSourceNodeCrossOrigin.html
+++ b/dom/media/webaudio/test/test_mediaElementAudioSourceNodeCrossOrigin.html
@@ -7,17 +7,17 @@
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 </head>
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 SimpleTest.waitForExplicitFinish();
 
 // Turn off the authentication dialog blocking for this test.
-SpecialPowers.setIntPref("network.auth.allow-subresource-auth", 2)
+SpecialPowers.setIntPref("network.auth.subresource-http-auth-allow", 2)
 
 var tests = [
   // Not the same origin no CORS asked for, should have silence
   { url: "http://example.org:80/tests/dom/media/webaudio/test/small-shot.ogg",
     cors: null,
     expectSilence: true },
   // Same origin, should have sound
   { url: "small-shot.ogg",
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1781,17 +1781,17 @@ pref("network.automatic-ntlm-auth.truste
 pref("network.generic-ntlm-auth.workstation", "WORKSTATION");
 
 // Sub-resources HTTP-authentication:
 //   0 - don't allow sub-resources to open HTTP authentication credentials
 //       dialogs
 //   1 - allow sub-resources to open HTTP authentication credentials dialogs,
 //       but don't allow it for cross-origin sub-resources
 //   2 - allow the cross-origin authentication as well.
-pref("network.auth.allow-subresource-auth", 2);
+pref("network.auth.subresource-http-auth-allow", 2);
 
 pref("permissions.default.image",           1); // 1-Accept, 2-Deny, 3-dontAcceptForeign
 
 pref("network.proxy.type",                  5);
 pref("network.proxy.ftp",                   "");
 pref("network.proxy.ftp_port",              0);
 pref("network.proxy.http",                  "");
 pref("network.proxy.http_port",             0);
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
@@ -70,25 +70,25 @@ nsHttpChannelAuthProvider::nsHttpChannel
 }
 
 nsHttpChannelAuthProvider::~nsHttpChannelAuthProvider()
 {
     MOZ_ASSERT(!mAuthChannel, "Disconnect wasn't called");
 }
 
 uint32_t nsHttpChannelAuthProvider::sAuthAllowPref =
-    SUBRESOURCE_AUTH_DIALOG_DISALLOW_CROSS_ORIGIN;
+    SUBRESOURCE_AUTH_DIALOG_ALLOW_ALL;
 
 void
 nsHttpChannelAuthProvider::InitializePrefs()
 {
   MOZ_ASSERT(NS_IsMainThread());
   mozilla::Preferences::AddUintVarCache(&sAuthAllowPref,
-                                        "network.auth.allow-subresource-auth",
-                                        SUBRESOURCE_AUTH_DIALOG_DISALLOW_CROSS_ORIGIN);
+                                        "network.auth.subresource-http-auth-allow",
+                                        SUBRESOURCE_AUTH_DIALOG_ALLOW_ALL);
 }
 
 NS_IMETHODIMP
 nsHttpChannelAuthProvider::Init(nsIHttpAuthenticableChannel *channel)
 {
     MOZ_ASSERT(channel, "channel expected!");
 
     mAuthChannel = channel;
--- a/netwerk/test/unit/test_auth_dialog_permission.js
+++ b/netwerk/test/unit/test_auth_dialog_permission.js
@@ -1,10 +1,10 @@
 // This file tests authentication prompt depending on pref
-// network.auth.allow-subresource-auth:
+// network.auth.subresource-http-auth-allow:
 //   0 - don't allow sub-resources to open HTTP authentication credentials
 //       dialogs
 //   1 - allow sub-resources to open HTTP authentication credentials dialogs,
 //       but don't allow it for cross-origin sub-resources
 //   2 - allow the cross-origin authentication as well.
 
 Cu.import("resource://testing-common/httpd.js");
 
@@ -125,27 +125,27 @@ function makeChan(loadingUrl, url, conte
                              null,
                              Ci.nsILoadInfo.SEC_NORMAL,
                              contentPolicy)
                 .QueryInterface(Components.interfaces.nsIHttpChannel);
 
   return chan;
 }
 
-function Test(allow_subresource_auth_pref, loadingUri, uri, contentPolicy,
+function Test(subresource_http_auth_allow_pref, loadingUri, uri, contentPolicy,
               expectedCode) {
-  this._allow_subresource_auth_pref = allow_subresource_auth_pref;
+  this._subresource_http_auth_allow_pref = subresource_http_auth_allow_pref;
   this._loadingUri = loadingUri;
   this._uri = uri;
   this._contentPolicy = contentPolicy;
   this._expectedCode = expectedCode;
 }
 
 Test.prototype = {
-  _allow_subresource_auth_pref: 1,
+  _subresource_http_auth_allow_pref: 1,
   _loadingUri: null,
   _uri: null,
   _contentPolicy: Ci.nsIContentPolicy.TYPE_OTHER,
   _expectedCode: 200,
 
   onStartRequest: function(request, ctx) {
     try {
       if (!Components.isSuccessCode(request.status)) {
@@ -178,24 +178,24 @@ Test.prototype = {
     Components.classes["@mozilla.org/network/http-auth-manager;1"]
               .getService(Components.interfaces.nsIHttpAuthManager)
               .clearAll();
 
     do_timeout(0, run_next_test);
   },
 
   run: function() {
-    dump("Run test: " + this._allow_subresource_auth_pref
+    dump("Run test: " + this._subresource_http_auth_allow_pref
                       + this._loadingUri
                       + this._uri
                       + this._contentPolicy
                       + this._expectedCode + " \n");
 
-    prefs.setIntPref("network.auth.allow-subresource-auth",
-                     this._allow_subresource_auth_pref);
+    prefs.setIntPref("network.auth.subresource-http-auth-allow",
+                     this._subresource_http_auth_allow_pref);
     let chan = makeChan(this._loadingUri, this._uri, this._contentPolicy);
     chan.notificationCallbacks = new Requestor(this._expectedCode == 200);
     chan.asyncOpen(this, null);
   }
 };
 
 var tests = [
   // For the next 3 tests the preference is set to 2 - allow the cross-origin
--- a/netwerk/test/unit/test_auth_proxy.js
+++ b/netwerk/test/unit/test_auth_proxy.js
@@ -240,17 +240,17 @@ function run_test() {
   const prefs = Cc["@mozilla.org/preferences-service;1"]
                          .getService(Ci.nsIPrefBranch);
   prefs.setCharPref("network.proxy.http", "localhost");
   prefs.setIntPref("network.proxy.http_port", httpserv.identity.primaryPort);
   prefs.setCharPref("network.proxy.no_proxies_on", "");
   prefs.setIntPref("network.proxy.type", 1);
 
   // Turn off the authentication dialog blocking for this test.
-  prefs.setIntPref("network.auth.allow-subresource-auth", 2);
+  prefs.setIntPref("network.auth.subresource-http-auth-allow", 2);
 
   tests[current_test]();
 }
 
 function test_proxy_returnfalse() {
   dump("\ntest: proxy returnfalse\n");
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(FLAG_RETURN_FALSE, 0);
--- a/netwerk/test/unit/test_authentication.js
+++ b/netwerk/test/unit/test_authentication.js
@@ -2,17 +2,17 @@
 // TODO NIT use do_check_eq(expected, actual) consistently, not sometimes eq(actual, expected)
 
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://gre/modules/Services.jsm");
 
 // Turn off the authentication dialog blocking for this test.
 var prefs = Cc["@mozilla.org/preferences-service;1"].
               getService(Ci.nsIPrefBranch);
-prefs.setIntPref("network.auth.allow-subresource-auth", 2);
+prefs.setIntPref("network.auth.subresource-http-auth-allow", 2);
 
 XPCOMUtils.defineLazyGetter(this, "URL", function() {
   return "http://localhost:" + httpserv.identity.primaryPort;
 });
 
 XPCOMUtils.defineLazyGetter(this, "PORT", function() {
   return httpserv.identity.primaryPort;
 });
--- a/toolkit/components/passwordmgr/test/test_prompt_async.html
+++ b/toolkit/components/passwordmgr/test/test_prompt_async.html
@@ -9,17 +9,17 @@
     <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
 
     <script class="testbody" type="text/javascript">
         SimpleTest.waitForExplicitFinish();
         SimpleTest.requestFlakyTimeout("untriaged");
 
         var prefs = Cc["@mozilla.org/preferences-service;1"].
                         getService(Ci.nsIPrefBranch);
-        prefs.setIntPref("network.auth.allow-subresource-auth", 2);
+        prefs.setIntPref("network.auth.subresource-http-auth-allow", 2);
         // Class monitoring number of open dialog windows
         // It checks there is always open just a single dialog per application
         function dialogMonitor() {
             var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
                                                .getService(Ci.nsIObserverService);
             observerService.addObserver(this, "domwindowopened", false);
             observerService.addObserver(this, "domwindowclosed", false);
         }
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_auth.js
@@ -5,17 +5,17 @@ function test() {
   Harness.authenticationCallback = get_auth_info;
   Harness.downloadFailedCallback = download_failed;
   Harness.installEndedCallback = install_ended;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   var prefs = Cc["@mozilla.org/preferences-service;1"].
                         getService(Ci.nsIPrefBranch);
-  prefs.setIntPref("network.auth.allow-subresource-auth", 2);
+  prefs.setIntPref("network.auth.subresource-http-auth-allow", 2);
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
   var triggers = encodeURIComponent(JSON.stringify({
     "Unsigned XPI": TESTROOT + "authRedirect.sjs?" + TESTROOT + "unsigned.xpi"
   }));
   gBrowser.selectedTab = gBrowser.addTab();