Bug 1334261 - script-generated patch to remove more newURI null parameters, r=jaws.

This commit is contained in:
Florian Quèze 2017-01-27 10:51:02 +01:00
parent 9815fa9ed8
commit 2cf30507bd
42 changed files with 70 additions and 70 deletions

View File

@ -54,7 +54,7 @@
// directory does not have origin set, in that case use the url origin for
// the error message.
if (!config.origin) {
let URI = Services.io.newURI(url, null, null);
let URI = Services.io.newURI(url);
config.origin =
Services.scriptSecurityManager.createCodebasePrincipal(URI, {}).origin;
}

View File

@ -50,8 +50,8 @@
(async function testBody() {
let frame1 = document.getElementById("frame1");
let frame2 = document.getElementById("frame2");
let uri1 = Services.io.newURI("http://www.example.com/1", null, null);
let uri2 = Services.io.newURI("http://www.example.com/2", null, null);
let uri1 = Services.io.newURI("http://www.example.com/1");
let uri2 = Services.io.newURI("http://www.example.com/2");
let errorPageReady = waitForErrorPage(frame1);
frame1.docShell.chromeEventHandler.setAttribute("crashedPageTitle", "pageTitle");

View File

@ -42,7 +42,7 @@
Task.spawn(function* () {
let testTag = "foo";
let testTagUpper = "Foo";
let testURI = Services.io.newURI("http://www.example.com/", null, null);
let testURI = Services.io.newURI("http://www.example.com/");
// Add a bookmark.
let bm = yield PlacesUtils.bookmarks.insert({

View File

@ -58,11 +58,11 @@
let vtime = Date.now() * 1000;
const ttype = PlacesUtils.history.TRANSITION_TYPED;
let places =
[{ uri: Services.io.newURI("http://example.tld/", null, null),
[{ uri: Services.io.newURI("http://example.tld/"),
visitDate: newTimeInMicroseconds(), transition: ttype },
{ uri: Services.io.newURI("http://example2.tld/", null, null),
{ uri: Services.io.newURI("http://example2.tld/"),
visitDate: newTimeInMicroseconds(), transition: ttype },
{ uri: Services.io.newURI("http://example3.tld/", null, null),
{ uri: Services.io.newURI("http://example3.tld/"),
visitDate: newTimeInMicroseconds(), transition: ttype }];
yield PlacesTestUtils.addVisits(places);

View File

@ -51,7 +51,7 @@
yield PlacesTestUtils.clearHistory();
yield PlacesTestUtils.addVisits({
uri: Services.io.newURI("http://example.tld/", null, null),
uri: Services.io.newURI("http://example.tld/"),
transition: PlacesUtils.history.TRANSITION_TYPED
});

View File

@ -50,7 +50,7 @@
"h", "i", "l", "m", "n", "o", "p"];
// Add a bookmark and tag it.
let uri1 = Services.io.newURI("http://www1.mozilla.org/", null, null);
let uri1 = Services.io.newURI("http://www1.mozilla.org/");
let bm1 = yield bs.insert({
parentGuid: bs.toolbarGuid,
index: bs.DEFAULT_INDEX,
@ -61,7 +61,7 @@
PlacesUtils.tagging.tagURI(uri1, tags);
// Add a second bookmark so that tags won't disappear when unchecked.
let uri2 = Services.io.newURI("http://www2.mozilla.org/", null, null);
let uri2 = Services.io.newURI("http://www2.mozilla.org/");
let bm2 = yield bs.insert({
parentGuid: bs.toolbarGuid,
index: bs.DEFAULT_INDEX,

View File

@ -56,8 +56,8 @@
SimpleTest.waitForExplicitFinish();
Task.spawn(function* () {
const TEST_URI = Services.io.newURI("http://www.test.me/", null, null);
const TEST_URI2 = Services.io.newURI("http://www.test.again.me/", null, null);
const TEST_URI = Services.io.newURI("http://www.test.me/");
const TEST_URI2 = Services.io.newURI("http://www.test.again.me/");
const TEST_TAG = "test-tag";
ok(gEditItemOverlay, "Sanity check: gEditItemOverlay is in context");

View File

@ -54,7 +54,7 @@
SimpleTest.waitForExplicitFinish();
function uri(spec) {
return Services.io.newURI(spec, null, null);
return Services.io.newURI(spec);
}
Task.spawn(function* () {

View File

@ -39,11 +39,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1180921
return p;
}
let exampleCom_addonA = new Cu.Sandbox(ssm.createCodebasePrincipal(Services.io.newURI('http://example.com', null, null), {addonId: 'addonA'}),
let exampleCom_addonA = new Cu.Sandbox(ssm.createCodebasePrincipal(Services.io.newURI('http://example.com'), {addonId: 'addonA'}),
{wantGlobalProperties: ['XMLHttpRequest']});
let nullPrin_addonA = new Cu.Sandbox(ssm.createNullPrincipal({addonId: 'addonA'}),
{wantGlobalProperties: ['XMLHttpRequest']});
let exampleCom_addonB = new Cu.Sandbox(ssm.createCodebasePrincipal(Services.io.newURI('http://example.com', null, null), {addonId: 'addonB'}),
let exampleCom_addonB = new Cu.Sandbox(ssm.createCodebasePrincipal(Services.io.newURI('http://example.com'), {addonId: 'addonB'}),
{wantGlobalProperties: ['XMLHttpRequest']});
function uriForDomain(d) { return d + '/tests/caps/tests/mochitest/file_data.txt' }

View File

@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=840488
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Services.jsm");
const ssm = Services.scriptSecurityManager;
function makeURI(uri) { return Services.io.newURI(uri, null, null); }
function makeURI(uri) { return Services.io.newURI(uri); }
const path = "/tests/caps/tests/mochitest/file_disableScript.html";
const uri = "http://www.example.com" + path;
var rootFrame = document.getElementById('root');

View File

@ -34,7 +34,7 @@ is(secMan.isSystemPrincipal(sysPrincipal), true,
var ioService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"].
getService(SpecialPowers.Ci.nsIIOService);
var inheritingURI = ioService.newURI("javascript:1+1", null, null);
var inheritingURI = ioService.newURI("javascript:1+1");
// First try a normal call to checkLoadURIWithPrincipal
try {

View File

@ -33,16 +33,16 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1161831
// First, get a file:// URI to something - open to suggestions on how to do
// this more easily.
var resURI = SpecialPowers.Services.io.newURI('resource://testing-common/resource_test_file.html', null, null);
var resURI = SpecialPowers.Services.io.newURI('resource://testing-common/resource_test_file.html');
var filePath = resourceHandler.resolveURI(resURI);
ok(filePath.startsWith('file://'), 'resource:// URI resolves where we expect: ' + filePath);
var fileURI = SpecialPowers.Services.io.newURI(filePath, null, null);
var fileURI = SpecialPowers.Services.io.newURI(filePath);
// Register a moz-extension:// URI.
extensionHandler.setSubstitution('cherise', fileURI);
// Alias the above.
extensionHandler.setSubstitution('liebchen', SpecialPowers.Services.io.newURI('moz-extension://cherise', null, null));
extensionHandler.setSubstitution('liebchen', SpecialPowers.Services.io.newURI('moz-extension://cherise'));
//
// Make sure that non-file:// URIs don't work.
@ -58,7 +58,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1161831
// chrome://
try {
var chromeURI = SpecialPowers.Services.io.newURI('chrome://global/content/mozilla.xhtml', null, null);
var chromeURI = SpecialPowers.Services.io.newURI('chrome://global/content/mozilla.xhtml');
extensionHandler.setSubstitution('verboten', chromeURI);
ok(false, "Should have thrown for mapping moz-extension to chrome");
} catch (e) {

View File

@ -54,7 +54,7 @@ function startTest()
let gIOService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
for (let {url} of TEST_CASES) {
let uri = gIOService.newURI(url, null, null);
let uri = gIOService.newURI(url);
gSSService.removeState(Ci.nsISiteSecurityService.HEADER_HPKP, uri, 0);
}
});

View File

@ -47,7 +47,7 @@ function startTest()
let gIOService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
let uri = gIOService.newURI(TEST_CASES[0].url, null, null);
let uri = gIOService.newURI(TEST_CASES[0].url);
gSSService.removeState(Ci.nsISiteSecurityService.HEADER_HSTS, uri, 0);
});

View File

@ -25,7 +25,7 @@ function translateChrome(uriStr) {
const { Cc, Ci } = SpecialPowers;
let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
let uri = ios.newURI(uriStr, null, ios.newURI(document.baseURI, null, null));
let uri = ios.newURI(uriStr, null, ios.newURI(document.baseURI));
return chromeReg.convertChromeURL(uri).spec;
}

View File

@ -52,7 +52,7 @@ function testCancelPrefetchNotCrash(url) {
// Not actually verifying any value, just to ensure cancelPrefetch
// won't cause crash.
prefetch.cancelPrefetchURI(ios.newURI(url, null, null), link);
prefetch.cancelPrefetchURI(ios.newURI(url), link);
}
const SJS_PATH = window.location.pathname.replace(/[^/]+$/, "file_bug1268962.sjs");

View File

@ -21,7 +21,7 @@ function translateChrome(uriStr) {
const { Cc, Ci } = SpecialPowers;
let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
let uri = ios.newURI(uriStr, null, ios.newURI(document.baseURI, null, null));
let uri = ios.newURI(uriStr, null, ios.newURI(document.baseURI));
return chromeReg.convertChromeURL(uri).spec;
}

View File

@ -9,7 +9,7 @@ function testSteps()
{
let uri = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).
newURI("https://www.example.com", null, null);
newURI("https://www.example.com");
let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
let principal = ssm.createCodebasePrincipal(uri, {});

View File

@ -139,7 +139,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=803225
Services.ppmm.loadProcessScript(pScript, true);
var uri = ioService.newURI("mailto:foo@bar.com", null, null);
var uri = ioService.newURI("mailto:foo@bar.com");
webHandler.launchWithURI(uri);
});

View File

@ -6,7 +6,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
// Returns a promise which resolves to whether or not PRERENDERED_URL has been visited.
function prerenderedVisited() {
let uri = Services.io.newURI(PRERENDERED_URL, null, null);
let uri = Services.io.newURI(PRERENDERED_URL);
return new Promise(resolve => {
PlacesUtils.asyncHistory.isURIVisited(uri, (aUri, aIsVisited) => {
resolve(aIsVisited);

View File

@ -59,7 +59,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=580313
// "https://example.com/1" does not exist, the cancel will throw.
var cancelError = 0;
try {
var uri = ios.newURI("https://example.com/1", null, null);
var uri = ios.newURI("https://example.com/1");
prefetch.cancelPrefetchURI(uri, linkElem);
} catch(e) {
cancelError = 1;
@ -69,7 +69,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=580313
// Now cancel the right uri.
cancelError = 0;
try {
var uri = ios.newURI("https://example.com/2", null, null);
var uri = ios.newURI("https://example.com/2");
prefetch.cancelPrefetchURI(uri, linkElem);
} catch(e) {
cancelError = 1;

View File

@ -21,7 +21,7 @@ SimpleTest.waitForExplicitFinish();
var chromeURI = location.href;
var io = Components.classes['@mozilla.org/network/io-service;1']
.getService(Components.interfaces.nsIIOService);
chromeURI = io.newURI(chromeURI, null, null);
chromeURI = io.newURI(chromeURI);
var chromeReg = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIChromeRegistry);
fileURI = chromeReg.convertChromeURL(chromeURI);

View File

@ -22,12 +22,12 @@ var [gStyleSheetService, gIOService] = (function() {
})();
function set_user_sheet(sheeturi)
{
var uri = gIOService.newURI(sheeturi, null, null);
var uri = gIOService.newURI(sheeturi);
gStyleSheetService.loadAndRegisterSheet(uri, gStyleSheetService.USER_SHEET);
}
function remove_user_sheet(sheeturi)
{
var uri = gIOService.newURI(sheeturi, null, null);
var uri = gIOService.newURI(sheeturi);
gStyleSheetService.unregisterSheet(uri, gStyleSheetService.USER_SHEET);
}

View File

@ -15,7 +15,7 @@ var winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
function addAgentSheet() {
var sheetURI = io.newURI("data:text/css,p{background-color:yellow}", null, null);
var sheetURI = io.newURI("data:text/css,p{background-color:yellow}");
var sheet = sss.preloadSheet(sheetURI, Ci.nsIStyleSheetService.AGENT_SHEET);
winUtils.addSheet(sheet, Ci.nsIDOMWindowUtils.AGENT_SHEET);
}

View File

@ -31,7 +31,7 @@ function test(win, sheet) {
}
function run() {
var uri = gIOService.newURI("data:text/css,body{color:red;}", null, null);
var uri = gIOService.newURI("data:text/css,body{color:red;}");
let sheet = gSSService.preloadSheet(uri, SpecialPowers.Ci.nsIStyleSheetService.USER_SHEET);
test(document.getElementById("iframe1").contentWindow, sheet);

View File

@ -60,7 +60,7 @@ function removeAuthorSheet(win, style)
function loadSheet(win, style, type)
{
var uri = gIOService.newURI(getUri(style), null, null);
var uri = gIOService.newURI(getUri(style));
var windowUtils = SpecialPowers.wrap(win)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
@ -69,7 +69,7 @@ function loadSheet(win, style, type)
function removeSheet(win, style, type)
{
var uri = gIOService.newURI(getUri(style), null, null);
var uri = gIOService.newURI(getUri(style));
var windowUtils = SpecialPowers.wrap(win)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
@ -108,14 +108,14 @@ function unregisterAuthorSheet(win, style)
function loadAndRegisterSheet(win, style, type)
{
uri = gIOService.newURI(getUri(style), null, null);
uri = gIOService.newURI(getUri(style));
gSSService.loadAndRegisterSheet(uri, gSSService[type]);
is(gSSService.sheetRegistered(uri, gSSService[type]), true);
}
function unregisterSheet(win, style, type)
{
var uri = gIOService.newURI(getUri(style), null, null);
var uri = gIOService.newURI(getUri(style));
gSSService.unregisterSheet(uri, gSSService[type]);
is(gSSService.sheetRegistered(uri, gSSService[type]), false);
}

View File

@ -21,7 +21,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
Cu.import("resource://gre/modules/Services.jsm");
// Load a custom sjs script that echos our "User-Agent" header back at us
const TestURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/desktopmode_user_agent.sjs", null, null);
const TestURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/desktopmode_user_agent.sjs");
add_task(function* test_desktopmode() {
let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");

View File

@ -66,8 +66,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1214366
var v = yield get_last_visited("https://random.com/");
is(v, 0, `Last visited timestamp is 0 for unknown prePath: ${v}`);
let prePath = Services.io.newURI(url1, null, null).prePath + "/";
is(prePath, Services.io.newURI(url2, null, null).prePath + "/", "url1 and url2 have the same prePath");
let prePath = Services.io.newURI(url1).prePath + "/";
is(prePath, Services.io.newURI(url2).prePath + "/", "url1 and url2 have the same prePath");
let t0 = Date.now();
yield add_history_visit(url1);

View File

@ -22,26 +22,26 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1099088
let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
let IdentityHandler = chromeWin.IdentityHandler;
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
"'about:' is a verified internal page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:config", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:config")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
"'about:config' is a verified internal page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accounts", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accounts")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
"'about:accounts is a verified internal page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:addonss", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:addonss")) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
"'about:addonss is not a verified internal page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accountss", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accountss")) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
"'about:accountss is not a verified internal page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accounts?action=signup", null, null)) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:accounts?action=signup")) == IdentityHandler.IDENTITY_MODE_CHROMEUI,
"'about:accounts?action=signup is a verified internal page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:evil_extension_page", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("about:evil_extension_page")) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
"'about:evil_extension_page' is not a verified internal page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("http://mozilla.com", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("http://mozilla.com")) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
"http://mozilla.com is an unknown page");
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("https://mozilla.com", null, null)) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
ok(IdentityHandler.getIdentityMode(0, Services.io.newURI("https://mozilla.com")) == IdentityHandler.IDENTITY_MODE_UNKNOWN,
"https://mozilla.com over an insecure connection is an unknown page");
ok(IdentityHandler.getIdentityMode(Ci.nsIWebProgressListener.STATE_IS_SECURE, Services.io.newURI("https://mozilla.com", null, null)) == IdentityHandler.IDENTITY_MODE_IDENTIFIED,
ok(IdentityHandler.getIdentityMode(Ci.nsIWebProgressListener.STATE_IS_SECURE, Services.io.newURI("https://mozilla.com")) == IdentityHandler.IDENTITY_MODE_IDENTIFIED,
"https://mozilla.com over a secure connection is a verified page");
</script>

View File

@ -44,7 +44,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
// The proxy setting
let proxyPrefValue;
const kUniqueURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/video_controls.html", null, null);
const kUniqueURI = Services.io.newURI("http://mochi.test:8888/chrome/mobile/android/tests/browser/chrome/video_controls.html");
add_task(function* test_offline() {
// Tests always connect to localhost, and per bug 87717, localhost is now

View File

@ -39,7 +39,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
run: function* () {
return new Promise(function(resolve, reject) {
let tab;
let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH, null, null));
let channel = new WebChannel("generic", Services.io.newURI(HTTP_PATH));
channel.listen(function (id, message, target) {
is(id, "generic");
is(message.something.nested, "hello");
@ -57,7 +57,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
run: function* () {
return new Promise(function(resolve, reject) {
let tab;
let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH, null, null));
let channel = new WebChannel("twoway", Services.io.newURI(HTTP_PATH));
channel.listen(function (id, message, sender) {
is(id, "twoway");
@ -84,7 +84,7 @@ Migrated from Robocop: https://bugzilla.mozilla.org/show_bug.cgi?id=1184186
run: function* () {
return new Promise(function(resolve, reject) {
let tab;
let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH, null, null));
let channel = new WebChannel("multichannel", Services.io.newURI(HTTP_PATH));
channel.listen(function (id, message, sender) {
is(id, "multichannel");

View File

@ -101,7 +101,7 @@ function run_test() {
// Also have to make up a channel
var uri = NetUtil.newURI("http://" + host, "")
var uri = NetUtil.newURI("http://" + host)
var chan = NetUtil.newChannel({
uri: uri,
loadUsingSystemPrincipal: true
@ -202,7 +202,7 @@ function run_test() {
info.password = "";
// 5: FTP
var uri2 = NetUtil.newURI("ftp://" + host, "");
var uri2 = NetUtil.newURI("ftp://" + host);
var ftpchan = NetUtil.newChannel({
uri: uri2,
loadUsingSystemPrincipal: true

View File

@ -74,7 +74,7 @@ function run_test()
// Set a cookie on one of the URIs. It doesn't matter which one, since
// they're both from the same host, which is enough for the cookie service
// to send the cookie with both requests.
var postRedirectURI = ioService.newURI(postRedirectURL, "");
var postRedirectURI = ioService.newURI(postRedirectURL);
Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService).
setCookieString(postRedirectURI, null, sentCookieVal, chan);

View File

@ -1,7 +1,7 @@
function makeURL(spec) {
return Cc["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService).
newURI(spec, null, null).
newURI(spec).
QueryInterface(Components.interfaces.nsIURL);
}

View File

@ -37,7 +37,7 @@ function run_test() {
}
function setupChannel(path) {
let uri = NetUtil.newURI("http://localhost:4444" + path, "");
let uri = NetUtil.newURI("http://localhost:4444" + path);
let chan = NetUtil.newChannel({
uri: uri,
loadUsingSystemPrincipal: true

View File

@ -2,7 +2,7 @@ Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/Services.jsm");
function getTestReferrer(server_uri, referer_uri) {
var uri = NetUtil.newURI(server_uri, "")
var uri = NetUtil.newURI(server_uri)
let referrer = NetUtil.newURI(referer_uri);
let triggeringPrincipal = Services.scriptSecurityManager.createCodebasePrincipal(referrer, {});
var chan = NetUtil.newChannel({

View File

@ -12,13 +12,13 @@ function test_policy(test) {
prefs.setIntPref("network.http.referer.userControlPolicy", 3);
}
var uri = NetUtil.newURI(test.url, "")
var uri = NetUtil.newURI(test.url)
var chan = NetUtil.newChannel({
uri: uri,
loadUsingSystemPrincipal: true
});
var referrer = NetUtil.newURI(test.referrer, "");
var referrer = NetUtil.newURI(test.referrer);
chan.QueryInterface(Components.interfaces.nsIHttpChannel);
chan.setReferrerWithPolicy(referrer, test.policy);
if (test.expectedReferrerSpec === undefined) {

View File

@ -24,7 +24,7 @@ const XHTML_NS = "http://www.w3.org/1999/xhtml";
*/
function frcTest(uri, expected, message) {
return new Promise(resolve => {
CA.findRepresentativeColor(Services.io.newURI(uri, ""),
CA.findRepresentativeColor(Services.io.newURI(uri),
function(success, color) {
if (expected == null) {
ok(!success, message);

View File

@ -111,7 +111,7 @@ function test()
let ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
let uri = function(aSpec) {
return ios.newURI(aSpec, null, null);
return ios.newURI(aSpec);
};
let pageURI = uri("http://example.com/favicon_annotations");

View File

@ -136,7 +136,7 @@ function testService() {
}
let test = testURLs.shift();
let tables = "test-malware-simple,test-unwanted-simple,test-phish-simple,test-track-simple,test-block-simple";
let uri = ios.newURI(test.url, null, null);
let uri = ios.newURI(test.url);
let prin = ssm.createCodebasePrincipal(uri, {});
is(service.classifyLocal(uri, tables), test.table,
`Successful synchronous classification of ${test.url} with TP=${test.trackingProtection}`);

View File

@ -127,7 +127,7 @@ function testXHRLoad(aEvent) {
var mockChannel = { originalURI: Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).
newURI("http://example.com/", null, null) };
newURI("http://example.com/") };
certs = [ ];
is(getCheckCertResult(mockChannel, false, certs), Cr.NS_ERROR_UNEXPECTED,

View File

@ -30,7 +30,7 @@
let result;
let threw = false;
try {
let uri = ios.newURI(message.data.URI, null, null);
let uri = ios.newURI(message.data.URI);
result = cr.convertChromeURL(uri).spec;
} catch (e) {
threw = true;