diff --git a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html index 05e6ba0abe5b..3a6ae91efa3c 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html @@ -81,19 +81,14 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; Cu.import("resource://gre/modules/Services.jsm"); + Cu.import("resource://gre/modules/NetUtil.jsm"); Cu.import("resource://gre/modules/Timer.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - let channel = Services.io.newChannel2( - "http://example.com", - null, - null, - null, // aLoadingNode - Services.scriptSecurityManager.getSystemPrincipal(), - null, // aTriggeringPrincipal - Ci.nsILoadInfo.SEC_NORMAL, - Ci.nsIContentPolicy.TYPE_OTHER - ); + let channel = NetUtil.newChannel({ + uri: "http://example.com", + loadUsingSystemPrincipal: true + }); let pps = Cc["@mozilla.org/network/protocol-proxy-service;1"]. getService(Ci.nsIProtocolProxyService); diff --git a/toolkit/components/passwordmgr/test/test_prompt_async.html b/toolkit/components/passwordmgr/test/test_prompt_async.html index 52417b8d815f..c9a356d447fe 100644 --- a/toolkit/components/passwordmgr/test/test_prompt_async.html +++ b/toolkit/components/passwordmgr/test/test_prompt_async.html @@ -12,6 +12,8 @@ SimpleTest.waitForExplicitFinish(); SimpleTest.requestFlakyTimeout("untriaged"); + const { NetUtil } = SpecialPowers.Cu.import('resource://gre/modules/NetUtil.jsm'); + var prefs = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); prefs.setIntPref("network.auth.subresource-http-auth-allow", 2); @@ -144,23 +146,14 @@ function startup() { //need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy. - var ios = SpecialPowers.Cc["@mozilla.org/network/io-service;1"] - .getService(SpecialPowers.Ci.nsIIOService); + var channel = NetUtil.newChannel({ + uri: "http://example.com", + loadUsingSystemPrincipal: true + }); var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"] .getService(); - var systemPrincipal = SpecialPowers.Services.scriptSecurityManager - .getSystemPrincipal(); - - var channel = ios.newChannel2("http://example.com", - null, - null, - null, // aLoadingNode - systemPrincipal, - null, // aTriggeringPrincipal - Ci.nsILoadInfo.SEC_NORMAL, - Ci.nsIContentPolicy.TYPE_OTHER); pps.asyncResolve(channel, 0, resolveCallback); }