Bug 1334261 - script-generated patch to remove more newURI null parameters, r=jaws.
authorFlorian Quèze <florian@queze.net>
Fri, 27 Jan 2017 10:51:02 +0100
changeset 331427 a58d0d69502bbe43f2d468d08b2adeda458f630f
parent 331426 c0be583a19b635e94b3e7801497d09d03daa68b7
child 331428 b10f411c1481d136b7f07f928793c67b01950869
push id31269
push userkwierso@gmail.com
push dateSat, 28 Jan 2017 00:37:25 +0000
treeherdermozilla-central@dfb191cf6039 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1334261
milestone54.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 1334261 - script-generated patch to remove more newURI null parameters, r=jaws.
browser/base/content/aboutSocialError.xhtml
browser/base/content/test/chrome/test_aboutCrashed.xul
browser/components/places/tests/chrome/test_bug485100-change-case-loses-tag.xul
browser/components/places/tests/chrome/test_bug549192.xul
browser/components/places/tests/chrome/test_bug549491.xul
browser/components/places/tests/chrome/test_bug631374_tags_selector_scroll.xul
browser/components/places/tests/chrome/test_editBookmarkOverlay_tags_liveUpdate.xul
browser/components/places/tests/chrome/test_treeview_date.xul
caps/tests/mochitest/test_addonMayLoad.html
caps/tests/mochitest/test_disableScript.xul
caps/tests/mochitest/test_disallowInheritPrincipal.html
caps/tests/mochitest/test_extensionURL.html
devtools/shared/webconsole/test/test_network_security-hpkp.html
devtools/shared/webconsole/test/test_network_security-hsts.html
dom/base/test/test_bug1008126.html
dom/base/test/test_bug1268962.html
dom/base/test/test_bug945152.html
dom/indexedDB/test/unit/test_idle_maintenance.js
dom/security/test/mixedcontentblocker/file_main_bug803225.html
dom/tests/browser/browser_prerendering.js
dom/tests/mochitest/webcomponents/test_link_prefetch.html
image/test/mochitest/test_bug415761.html
layout/style/test/chrome/test_moz_document_rules.html
layout/style/test/newtab_share_rule_processors.html
layout/style/test/test_addSheet.html
layout/style/test/test_additional_sheets.html
mobile/android/tests/browser/chrome/test_desktop_useragent.html
mobile/android/tests/browser/chrome/test_get_last_visited.html
mobile/android/tests/browser/chrome/test_identity_mode.html
mobile/android/tests/browser/chrome/test_offline_page.html
mobile/android/tests/browser/chrome/test_web_channel.html
netwerk/test/unit/test_authpromptwrapper.js
netwerk/test/unit/test_bug528292.js
netwerk/test/unit/test_bug553970.js
netwerk/test/unit/test_header_Accept-Language_case.js
netwerk/test/unit/test_referrer.js
netwerk/test/unit/test_referrer_policy.js
toolkit/components/places/tests/browser/browser_colorAnalyzer.js
toolkit/components/places/tests/chrome/test_favicon_annotations.xul
toolkit/components/url-classifier/tests/mochitest/test_classifier.html
toolkit/modules/tests/chrome/test_bug544442_checkCert.xul
toolkit/mozapps/extensions/test/mochitest/test_bug687194.html
--- a/browser/base/content/aboutSocialError.xhtml
+++ b/browser/base/content/aboutSocialError.xhtml
@@ -49,17 +49,17 @@
       let searchParams = new URLSearchParams(document.documentURI.split("?")[1]);
       let mode = searchParams.get("mode");
       config.origin = searchParams.get("origin");
       let encodedURL = searchParams.get("url");
       let url = decodeURIComponent(encodedURL);
       // 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;
       }
 
       switch (mode) {
         case "compactInfo":
           document.getElementById("btnTryAgain").style.display = 'none';
           break;
--- a/browser/base/content/test/chrome/test_aboutCrashed.xul
+++ b/browser/base/content/test/chrome/test_aboutCrashed.xul
@@ -45,18 +45,18 @@
                                            Ci.nsIWebProgress.NOTIFY_LOCATION);
       });
     }
 
   function doTest() {
     (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");
       frame1.docShell.displayLoadError(Components.results.NS_ERROR_CONTENT_CRASHED, uri1, null);
 
       await errorPageReady;
       frame1.docShell.chromeEventHandler.removeAttribute("crashedPageTitle");
 
--- a/browser/components/places/tests/chrome/test_bug485100-change-case-loses-tag.xul
+++ b/browser/components/places/tests/chrome/test_bug485100-change-case-loses-tag.xul
@@ -37,17 +37,17 @@
   <![CDATA[
 
     function runTest() {
       SimpleTest.waitForExplicitFinish();
 
       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({
           parentGuid: PlacesUtils.bookmarks.toolbarGuid,
           index: PlacesUtils.bookmarks.DEFAULT_INDEX,
           type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
           title: "mozilla",
           url: testURI
--- a/browser/components/places/tests/chrome/test_bug549192.xul
+++ b/browser/components/places/tests/chrome/test_bug549192.xul
@@ -53,21 +53,21 @@
         function newTimeInMicroseconds() {
           timeInMicroseconds = timeInMicroseconds + 1000;
           return timeInMicroseconds;
         }
 
         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);
 
         // Make a history query.
         let query = PlacesUtils.history.getNewQuery();
         let opts = PlacesUtils.history.getNewQueryOptions();
         opts.sortingMode = opts.SORT_BY_DATE_DESCENDING;
--- a/browser/components/places/tests/chrome/test_bug549491.xul
+++ b/browser/components/places/tests/chrome/test_bug549491.xul
@@ -46,17 +46,17 @@
 
     function runTest() {
       SimpleTest.waitForExplicitFinish();
 
       Task.spawn(function* () {
         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
         });
 
         // Make a history query.
         let query = PlacesUtils.history.getNewQuery();
         let opts = PlacesUtils.history.getNewQueryOptions();
         let queryURI = PlacesUtils.history.queriesToQueryString([query], 1, opts);
 
--- a/browser/components/places/tests/chrome/test_bug631374_tags_selector_scroll.xul
+++ b/browser/components/places/tests/chrome/test_bug631374_tags_selector_scroll.xul
@@ -45,28 +45,28 @@
 
       Task.spawn(function* () {
         let bs = PlacesUtils.bookmarks;
 
         let tags = ["a", "b", "c", "d", "e", "f", "g",
                     "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,
           type: bs.TYPE_BOOKMARK,
           title: "mozilla",
           url: uri1.spec
         });
         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,
           type: bs.TYPE_BOOKMARK,
           title: "mozilla",
           url: uri2.spec
         });
         PlacesUtils.tagging.tagURI(uri2, tags);
--- a/browser/components/places/tests/chrome/test_editBookmarkOverlay_tags_liveUpdate.xul
+++ b/browser/components/places/tests/chrome/test_editBookmarkOverlay_tags_liveUpdate.xul
@@ -51,18 +51,18 @@
            "Tag is correctly marked");
       });
     }
 
     function runTest() {
       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");
 
         // Open the tags selector.
         document.getElementById("editBMPanel_tagsSelectorRow").collapsed = false;
 
         // Add a bookmark.
--- a/browser/components/places/tests/chrome/test_treeview_date.xul
+++ b/browser/components/places/tests/chrome/test_treeview_date.xul
@@ -49,17 +49,17 @@
      *
      * Ensures that date in places treeviews is correctly formatted.
      */
 
     function runTest() {
       SimpleTest.waitForExplicitFinish();
 
       function uri(spec) {
-        return Services.io.newURI(spec, null, null);
+        return Services.io.newURI(spec);
       }
 
       Task.spawn(function* () {
         yield PlacesTestUtils.clearHistory();
 
         let midnight = new Date();
         midnight.setHours(0);
         midnight.setMinutes(0);
--- a/caps/tests/mochitest/test_addonMayLoad.html
+++ b/caps/tests/mochitest/test_addonMayLoad.html
@@ -34,21 +34,21 @@ https://bugzilla.mozilla.org/show_bug.cg
               "  xhr.onreadystatechange = function() { if (xhr.readyState == XMLHttpRequest.DONE) { finish(xhr.status == 200); } };" +
               "  xhr.open('GET', '" + uri + "', true);" +
               "  xhr.send();" +
               "})() } catch (e) { error(e); }");
     });
     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' }
 
   tryLoad(exampleCom_addonA, uriForDomain('http://example.com'))
   .then(function(success) {
     ok(success, "same-origin load should succeed for addon A");
     return tryLoad(nullPrin_addonA, uriForDomain('http://example.com'));
--- a/caps/tests/mochitest/test_disableScript.xul
+++ b/caps/tests/mochitest/test_disableScript.xul
@@ -24,17 +24,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   /** Test for all the different ways that script can be disabled for a given global. **/
 
   SimpleTest.waitForExplicitFinish();
   const Cu = Components.utils;
   const Ci = Components.interfaces;
   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');
   var chromeFrame = document.getElementById('chromeFrame');
   navigateFrame(rootFrame, uri + "?name=rootframe").then(function() {
     navigateFrame(chromeFrame, "file_disableScript.html").then(go);
   });
 
--- a/caps/tests/mochitest/test_disallowInheritPrincipal.html
+++ b/caps/tests/mochitest/test_disallowInheritPrincipal.html
@@ -29,17 +29,17 @@ var sysPrincipal = secMan.getSystemPrinc
 isnot(sysPrincipal, undefined, "Should have a principal");
 isnot(sysPrincipal, null, "Should have a non-null principal");
 is(secMan.isSystemPrincipal(sysPrincipal), true,
    "Should have system principal here");
 
 
 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 {
   secMan.checkLoadURIWithPrincipal(sysPrincipal, inheritingURI,
                                    nsIScriptSecurityManager.STANDARD);
   ok(true, "checkLoadURI allowed the load");
 } catch (e) {
   ok(false, "checkLoadURI failed unexpectedly: " + e);
--- a/caps/tests/mochitest/test_extensionURL.html
+++ b/caps/tests/mochitest/test_extensionURL.html
@@ -28,42 +28,42 @@ https://bugzilla.mozilla.org/show_bug.cg
       aps.setExtensionURILoadCallback(oldLoadCallback);
       aps.setExtensionURIToAddonIdCallback(oldMapCallback);
   });
 
   addLoadEvent(function() {
 
     // 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.
     //
 
     // resource://
     try {
       extensionHandler.setSubstitution('interdit', resURI);
       ok(false, "Should have thrown for mapping moz-extension to resource");
     } catch (e) {
       ok(true, "Threw correctly: " + e);
     }
 
     // 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) {
       ok(true, "Threw correctly: " + e);
     }
 
     function navigateWithLocation(ifr, url) { ifr.contentWindow.location = url; }
     function navigateWithSrc(ifr, url) { ifr.setAttribute('src', url); }
--- a/devtools/shared/webconsole/test/test_network_security-hpkp.html
+++ b/devtools/shared/webconsole/test/test_network_security-hpkp.html
@@ -49,17 +49,17 @@ function startTest()
 
     // Reset pinning state.
     let gSSService = Cc["@mozilla.org/ssservice;1"]
                        .getService(Ci.nsISiteSecurityService);
 
     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);
     }
   });
 
   info("Test detection of Public Key Pinning.");
   removeEventListener("load", startTest);
   attachConsoleToTab(["NetworkActivity"], onAttach);
 }
--- a/devtools/shared/webconsole/test/test_network_security-hsts.html
+++ b/devtools/shared/webconsole/test/test_network_security-hsts.html
@@ -42,17 +42,17 @@ function startTest()
   SimpleTest.registerCleanupFunction(() => {
     // Reset HSTS state.
     let gSSService = Cc["@mozilla.org/ssservice;1"]
                        .getService(Ci.nsISiteSecurityService);
 
     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);
   });
 
   info("Test detection of HTTP Strict Transport Security.");
   removeEventListener("load", startTest);
   attachConsoleToTab(["NetworkActivity"], onAttach);
 }
 
--- a/dom/base/test/test_bug1008126.html
+++ b/dom/base/test/test_bug1008126.html
@@ -20,17 +20,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.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;
 }
 
 function runTest() {
   var worker = new Worker("file_bug1008126_worker.js");
 
   worker.onmessage = function(event) {
     if (event.data.type == 'finish') {
--- a/dom/base/test/test_bug1268962.html
+++ b/dom/base/test/test_bug1268962.html
@@ -47,17 +47,17 @@ function testCancelPrefetchNotCrash(url)
 
   var link = document.createElement("LINK");
   link.setAttribute("rel", "prefetch");
   link.setAttribute("href", url);
   document.head.appendChild(link);
 
   // 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");
 const SAME_ORIGIN = "http://mochi.test:8888" + SJS_PATH;
 const CROSS_ORIGIN = "http://example.com" + SJS_PATH;
 
 SimpleTest.waitForExplicitFinish();
 
--- a/dom/base/test/test_bug945152.html
+++ b/dom/base/test/test_bug945152.html
@@ -16,17 +16,17 @@ https://bugzilla.mozilla.org/show_bug.cg
 
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.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;
 }
 
 function runTest() {
   var worker = new Worker("file_bug945152_worker.js");
 
   worker.onmessage = function(event) {
     if (event.data.type == 'finish') {
--- a/dom/indexedDB/test/unit/test_idle_maintenance.js
+++ b/dom/indexedDB/test/unit/test_idle_maintenance.js
@@ -4,17 +4,17 @@
  */
 
 var testGenerator = testSteps();
 
 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, {});
 
   info("Setting permissions");
 
   let permMgr =
     Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager);
--- a/dom/security/test/mixedcontentblocker/file_main_bug803225.html
+++ b/dom/security/test/mixedcontentblocker/file_main_bug803225.html
@@ -134,17 +134,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           }
         }
       };
       os.addObserver(observer, "content-document-global-created", false);
     }
 
     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);
   });
 
   var mailto = false;
 
   mm.addMessageListener("Test:content-ready-forward", function contentReadyListener() {
     mm.removeMessageListener("Test:content-ready-forward", contentReadyListener);
     mailto = true;
--- a/dom/tests/browser/browser_prerendering.js
+++ b/dom/tests/browser/browser_prerendering.js
@@ -1,17 +1,17 @@
 const URL = "https://example.com/browser/dom/tests/browser/prerender.html";
 const PRERENDERED_URL = "https://example.com/browser/dom/tests/browser/prerender_target.html";
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");
 
 // 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);
     });
   });
 }
 
 // Wait for a process change and then fulfil the promise.
--- a/dom/tests/mochitest/webcomponents/test_link_prefetch.html
+++ b/dom/tests/mochitest/webcomponents/test_link_prefetch.html
@@ -54,27 +54,27 @@ https://bugzilla.mozilla.org/show_bug.cg
   linkElem.href = "https://example.com/2";
   is(prefetch.hasMoreElements(), true,
      "Changing href, a new prefetch has been started.");
   // To check if "https://example.com/1" prefetch has been canceled, we try to
   // cancel it using PrefetService. Since the prefetch for
   // "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;
   }
   is(cancelError, 1, "This prefetch has aleady been canceled");
 
   // 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;
   }
   is(cancelError, 0, "This prefetch has been canceled successfully");
 
   is(prefetch.hasMoreElements(), false, "The prefetch has already been canceled.");
 
--- a/image/test/mochitest/test_bug415761.html
+++ b/image/test/mochitest/test_bug415761.html
@@ -16,17 +16,17 @@ SimpleTest.waitForExplicitFinish();
 // We want to make sure that moz-icon URIs with non-ascii characters work. To that
 // end, we compare the rendering of an icon without non-ascii characters to that
 // of one that does include such characters.
 
 // First, obtain the file URI to the ourselves:
 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);
 fileURI.QueryInterface(Components.interfaces.nsIFileURL);
 var self = fileURI.file;
 
 // Check if the non-ascii-named icon is still hanging around from a previous test
 var dest = self.parent;
--- a/layout/style/test/chrome/test_moz_document_rules.html
+++ b/layout/style/test/chrome/test_moz_document_rules.html
@@ -17,22 +17,22 @@ var [gStyleSheetService, gIOService] = (
             Components.classes["@mozilla.org/content/style-sheet-service;1"]
                 .getService(Components.interfaces.nsIStyleSheetService),
             Components.classes["@mozilla.org/network/io-service;1"]
                 .getService(Components.interfaces.nsIIOService)
            ];
 })();
 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);
 }
 
 function run()
 {
     var iframe = document.getElementById("iframe");
     var subdoc = iframe.contentDocument;
     var subwin = iframe.contentWindow;
--- a/layout/style/test/newtab_share_rule_processors.html
+++ b/layout/style/test/newtab_share_rule_processors.html
@@ -10,13 +10,13 @@ var Ci = Components.interfaces;
 var sss = Cc["@mozilla.org/content/style-sheet-service;1"]
   .getService(Ci.nsIStyleSheetService);
 var io = Cc["@mozilla.org/network/io-service;1"]
   .getService(Ci.nsIIOService);
 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);
 }
 </script>
--- a/layout/style/test/test_addSheet.html
+++ b/layout/style/test/test_addSheet.html
@@ -26,17 +26,17 @@ function test(win, sheet) {
     var windowUtils = SpecialPowers.wrap(win)
       .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
       .getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
     windowUtils.addSheet(sheet, SpecialPowers.Ci.nsIDOMWindowUtils.USER_SHEET);
     is(cs.getPropertyValue('color'), "rgb(255, 0, 0)", "should have changed color to red");
 }
 
 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);
     test(document.getElementById("iframe2").contentWindow, sheet);
 
     SimpleTest.finish();
 }
 
--- a/layout/style/test/test_additional_sheets.html
+++ b/layout/style/test/test_additional_sheets.html
@@ -55,26 +55,26 @@ function removeAgentSheet(win, style)
 
 function removeAuthorSheet(win, style)
 {
   removeSheet(win, style, "AUTHOR_SHEET");
 }
 
 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);
   windowUtils.loadSheet(uri, windowUtils[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);
   windowUtils.removeSheet(uri, windowUtils[type]);
 }
 
 function loadAndRegisterUserSheet(win, style)
 {
@@ -103,24 +103,24 @@ function unregisterAgentSheet(win, style
 
 function unregisterAuthorSheet(win, style)
 {
   unregisterSheet(win, style, "AUTHOR_SHEET");
 }
 
 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);
 }
 
 function setDocSheet(win, style)
 {
   var subdoc = win.document;
   var headID = subdoc.getElementsByTagName("head")[0];
--- a/mobile/android/tests/browser/chrome/test_desktop_useragent.html
+++ b/mobile/android/tests/browser/chrome/test_desktop_useragent.html
@@ -16,17 +16,17 @@ Migrated from Robocop: https://bugzilla.
 
   "use strict";
 
   const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
   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");
     let BrowserApp = chromeWin.BrowserApp;
 
     // Add a new 'desktop mode' tab with our test page
     let desktopTab = BrowserApp.addTab(TestURI.spec, { selected: true, parentId: BrowserApp.selectedTab.id, desktopMode: true });
     let desktopBrowser = desktopTab.browser;
--- a/mobile/android/tests/browser/chrome/test_get_last_visited.html
+++ b/mobile/android/tests/browser/chrome/test_get_last_visited.html
@@ -61,18 +61,18 @@ https://bugzilla.mozilla.org/show_bug.cg
   const url1 = "http://example.org/tests/robocop/robocop_blank_01.html";
   const url2 = "http://example.org/tests/robocop/robocop_blank_03.html";
   const url3 = "http://example.org/tests/robocop/robocop_blank_02.html";
 
   add_task(function* test_get_last_visited() {
     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);
     v = yield get_last_visited(prePath);
     let t1 = Date.now();
     ok(t0 <= v, `Last visited timestamp is after visit: ${t0} <= ${v}.`);
     ok(v <= t1, `Last visited timestamp is before present ${v} <= ${t1}.`);
 
--- a/mobile/android/tests/browser/chrome/test_identity_mode.html
+++ b/mobile/android/tests/browser/chrome/test_identity_mode.html
@@ -17,36 +17,36 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
   Cu.import("resource://gre/modules/Services.jsm");
 
   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>
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1099088">Mozilla Bug 1099088</a>
 <p id="display"></p>
 <div id="content" style="display: none">
--- a/mobile/android/tests/browser/chrome/test_offline_page.html
+++ b/mobile/android/tests/browser/chrome/test_offline_page.html
@@ -39,17 +39,17 @@ Migrated from Robocop: https://bugzilla.
   let chromeWin;
 
   // Track the <browser> where the tests are happening
   let browser;
 
   // 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
     // reachable in offline mode.  To avoid this, disable any proxy.
     proxyPrefValue = Services.prefs.getIntPref("network.proxy.type");
     Services.prefs.setIntPref("network.proxy.type", 0);
 
     // Clear network cache.
--- a/mobile/android/tests/browser/chrome/test_web_channel.html
+++ b/mobile/android/tests/browser/chrome/test_web_channel.html
@@ -34,17 +34,17 @@ Migrated from Robocop: https://bugzilla.
   // as much as possible.  (We only have this since we can't run browser chrome
   // tests on Android.  Yet?)
   let gTests = [
     {
       desc: "WebChannel generic message",
       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");
             channel.stopListening();
             BrowserApp.closeTab(tab);
             resolve();
           });
 
@@ -52,17 +52,17 @@ Migrated from Robocop: https://bugzilla.
         });
       }
     },
     {
       desc: "WebChannel two way communication",
       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");
             ok(message.command);
 
             if (message.command === "one") {
               channel.send({ data: { nested: true } }, sender);
             }
@@ -79,17 +79,17 @@ Migrated from Robocop: https://bugzilla.
         });
       }
     },
     {
       desc: "WebChannel multichannel",
       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");
             BrowserApp.closeTab(tab);
             resolve();
           });
 
           tab = BrowserApp.addTab(HTTP_PATH + HTTP_ENDPOINT + "?multichannel");
--- a/netwerk/test/unit/test_authpromptwrapper.js
+++ b/netwerk/test/unit/test_authpromptwrapper.js
@@ -96,17 +96,17 @@ function run_test() {
         // for those cases
         do_check_eq(text.indexOf("-1"), -1);
       }
     }
   };
 
 
   // 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
   });
 
   function do_tests(expectedRV) {
     var prompt1;
     var wrapper;
@@ -197,17 +197,17 @@ function run_test() {
 
     info.flags &= ~nsIAuthInformation.NEED_DOMAIN;
 
     info.domain = "";
     info.username = "";
     info.password = "";
 
     // 5: FTP
-    var uri2 = NetUtil.newURI("ftp://" + host, "");
+    var uri2 = NetUtil.newURI("ftp://" + host);
     var ftpchan = NetUtil.newChannel({
       uri: uri2,
       loadUsingSystemPrincipal: true 
     });
 
     prompt1 = new Prompt1();
     prompt1.rv = expectedRV;
     prompt1.scheme = "ftp";
--- a/netwerk/test/unit/test_bug528292.js
+++ b/netwerk/test/unit/test_bug528292.js
@@ -69,17 +69,17 @@ function run_test()
     loadUsingSystemPrincipal: true
   }).QueryInterface(Ci.nsIHttpChannel)
     .QueryInterface(Ci.nsIHttpChannelInternal);
   chan.forceAllowThirdPartyCookie = true;
 
   // 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);
 
   // Load the pre-redirect URI.
   chan.asyncOpen2(new ChannelListener(finish_test, null));
   do_test_pending();
 }
 
--- a/netwerk/test/unit/test_bug553970.js
+++ b/netwerk/test/unit/test_bug553970.js
@@ -1,12 +1,12 @@
 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);
 }
 
 // Checks that nsIURL::GetRelativeSpec does what it claims to do.
 function run_test() {
 
   // Elements of tests have the form [this.spec, aURIToCompare.spec, expectedResult].
   let tests = [
--- a/netwerk/test/unit/test_header_Accept-Language_case.js
+++ b/netwerk/test/unit/test_header_Accept-Language_case.js
@@ -32,16 +32,16 @@ function run_test() {
     let acceptLangHeader = setupChannel(testpath).getRequestHeader("Accept-Language");
     equal(acceptLangHeader, expectedHeader);
   }
 
   intlPrefs.setCharPref("accept_languages", oldAcceptLangPref);
 }
 
 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
   });
   chan.QueryInterface(Ci.nsIHttpChannel);
   return chan;
 }
--- a/netwerk/test/unit/test_referrer.js
+++ b/netwerk/test/unit/test_referrer.js
@@ -1,13 +1,13 @@
 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({
     uri: uri,
     loadingPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
     triggeringPrincipal: triggeringPrincipal,
     contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER
   });
--- a/netwerk/test/unit/test_referrer_policy.js
+++ b/netwerk/test/unit/test_referrer_policy.js
@@ -7,23 +7,23 @@ function test_policy(test) {
     .getService(Components.interfaces.nsIPrefBranch);
   if (test.defaultReferrerPolicyPref !== undefined) {
     prefs.setIntPref("network.http.referer.userControlPolicy",
                      test.defaultReferrerPolicyPref);
   } else {
     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) {
     try {
       chan.getRequestHeader("Referer");
       do_throw("Should not find a Referer header!");
     } catch(e) {
     }
--- a/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
+++ b/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
@@ -19,17 +19,17 @@ const XHTML_NS = "http://www.w3.org/1999
  * Passes the given uri to findRepresentativeColor.
  * If expected is null, you expect it to fail.
  * If expected is a function, it will call that function.
  * If expected is a color, you expect that color to be returned.
  * Message is used in the calls to is().
  */
 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);
         } else if (typeof expected == "function") {
           expected(color, message);
         } else {
           ok(success, "success: " + message);
           is(color, expected, message);
--- a/toolkit/components/places/tests/chrome/test_favicon_annotations.xul
+++ b/toolkit/components/places/tests/chrome/test_favicon_annotations.xul
@@ -106,17 +106,17 @@ function test()
            DBConnection;
 
   // Empty any old favicons
   db.executeSimpleSQL("DELETE FROM moz_favicons");
 
   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");
   let history = Cc["@mozilla.org/browser/history;1"]
                   .getService(Ci.mozIAsyncHistory);
   history.updatePlaces(
     {
       uri: pageURI,
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classifier.html
@@ -131,17 +131,17 @@ function testService() {
                 getService(Ci.nsIIOService);
     function runNextTest() {
       if (!testURLs.length) {
         resolve();
         return;
       }
       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}`);
       let result = service.classify(prin, test.trackingProtection, function(errorCode) {
         is(errorCode, test.result,
            `Successful asynchronous classification of ${test.url} with TP=${test.trackingProtection}`);
         runNextTest();
       });
--- a/toolkit/modules/tests/chrome/test_bug544442_checkCert.xul
+++ b/toolkit/modules/tests/chrome/test_bug544442_checkCert.xul
@@ -122,17 +122,17 @@ function testXHRLoad(aEvent) {
 
   is(getCheckCertResult(channel, true, certs), Cr.NS_OK,
      "checkCert should not throw when the certificate attributes array " +
      "passed to checkCert has an element that has the same issuerName and " +
      "commonName as the certificate's and builtin certificates aren't enforced");
 
   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,
      "checkCert should throw NS_ERROR_UNEXPECTED when the certificate " +
      "attributes array passed to checkCert is not null and the channel's " +
      "originalURI is not https");
 
   certs = null;
--- a/toolkit/mozapps/extensions/test/mochitest/test_bug687194.html
+++ b/toolkit/mozapps/extensions/test/mochitest/test_bug687194.html
@@ -25,17 +25,17 @@
                     .getService(Components.interfaces.nsIIOService);
       let cr =
           Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                     .getService(Ci.nsIXULChromeRegistry);
       addMessageListener("test687194:resolveChromeURI", function(message) {
         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;
             result = "EXCEPTION: " + e;
         }
 
         message.target.sendAsyncMessage("test687194:resolveChromeURI:Answer",
                                         { threw: threw, result: result });