Bug 1269267 - Remove SEC_NORMAL from browserElement_Auth.js (r=sicking)
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Fri, 06 May 2016 15:36:32 +0200
changeset 337413 09de5ebe553fe0c1e5d37dd594c7b8b52e0334ad
parent 337412 e9e6486b0d39dfe5421d229c8d29eac323bbad4b
child 337414 f9d3ea58c19507d754414b69bc7958d68ac80033
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1269267
milestone49.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 1269267 - Remove SEC_NORMAL from browserElement_Auth.js (r=sicking)
dom/browser-element/mochitest/browserElement_Auth.js
--- a/dom/browser-element/mochitest/browserElement_Auth.js
+++ b/dom/browser-element/mochitest/browserElement_Auth.js
@@ -3,16 +3,18 @@
 
 // Test that auth prompt works.
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
+const { NetUtil } = SpecialPowers.Cu.import('resource://gre/modules/NetUtil.jsm');
+
 function testFail(msg) {
   ok(false, JSON.stringify(msg));
 }
 
 var iframe;
 
 function runTest() {
   iframe = document.createElement('iframe');
@@ -134,30 +136,24 @@ function testProxyAuth(e) {
       }
       iframe.addEventListener("mozbrowserusernameandpasswordrequired",
                               onUserNameAndPasswordRequired);
 
       iframe.src = testingSJS;
     }
   });
 
-  var ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
-                  .getService(SpecialPowers.Ci.nsIIOService);
+  var channel = NetUtil.newChannel({
+    uri: testingSJS,
+    loadUsingSystemPrincipal: true
+  });
+
   var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"]
             .getService();
-  var systemPrincipal = SpecialPowers.Services.scriptSecurityManager
-                                     .getSystemPrincipal();
-  var channel = ioService.newChannel2(testingSJS,
-                                      null,
-                                      null,
-                                      null,
-                                      systemPrincipal,
-                                      null,
-                                      SpecialPowers.Ci.nsILoadInfo.SEC_NORMAL,
-                                      SpecialPowers.Ci.nsIContentPolicy.TYPE_OTHER);
+
   pps.asyncResolve(channel, 0, resolveCallback);
 }
 
 function testAuthJarNoInterfere(e) {
   var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
     .getService(SpecialPowers.Ci.nsIHttpAuthManager);
   var secMan = SpecialPowers.Cc["@mozilla.org/scriptsecuritymanager;1"]
                .getService(SpecialPowers.Ci.nsIScriptSecurityManager);