Back out 35e75bce4db4 (bug 1087744) for xpcshell bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 10 Feb 2015 23:05:42 -0800
changeset 228591 8ed8507adfcf2c72c30c5715243efdaa28497cb4
parent 228590 d9437013657a452e61138f28a92534fed4392c03
child 228592 5e39cbc525ad091f8ee8cd2a9fbfcf49f3e89c36
push id28264
push usercbook@mozilla.com
push dateWed, 11 Feb 2015 13:58:35 +0000
treeherdermozilla-central@38058cb42a0e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1087744
milestone38.0a1
backs out35e75bce4db42b46aa307e41737dd983cf9fceea
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
Back out 35e75bce4db4 (bug 1087744) for xpcshell bustage CLOSED TREE
toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
toolkit/components/osfile/tests/xpcshell/head.js
toolkit/components/osfile/tests/xpcshell/test_osfile_async_copy.js
toolkit/components/passwordmgr/test/test_prompt.html
toolkit/components/prompts/test/test_modal_prompts.html
toolkit/components/search/tests/xpcshell/test_serialize_file.js
toolkit/components/telemetry/tests/unit/test_ThirdPartyCookieProbe.js
toolkit/mozapps/extensions/test/browser/browser_openDialog.js
--- a/toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
+++ b/toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
@@ -1,17 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/Services.jsm");
 
 const PATH = "/file.meh";
 var httpserver = new HttpServer();
 
 // Each time, the data consist in a string that should be sniffed as Ogg.
 const data = "OggS\0meeeh.";
 var testRan = 0;
 
@@ -66,26 +65,18 @@ var listener = {
     runNext();
   }
 };
 
 function setupChannel(url, flags)
 {
   var ios = Components.classes["@mozilla.org/network/io-service;1"].
                        getService(Ci.nsIIOService);
-  let uri = "http://localhost:" +
-             httpserver.identity.primaryPort + url;
-  var chan = ios.newChannel2(uri,
-                             "",
-                             null,
-                             null,      // aLoadingNode
-                             Services.scriptSecurityManager.getSystemPrincipal(),
-                             null,      // aTriggeringPrincipal
-                             Ci.nsILoadInfo.SEC_NORMAL,
-                             Ci.nsIContentPolicy.TYPE_MEDIA);
+  var chan = ios.newChannel("http://localhost:" +
+                           httpserver.identity.primaryPort + url, "", null);
   chan.loadFlags |= flags;
   var httpChan = chan.QueryInterface(Components.interfaces.nsIHttpChannel);
   return httpChan;
 }
 
 function runNext() {
   if (testRan == tests.length) {
     do_test_finished();
--- a/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
+++ b/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
@@ -65,25 +65,18 @@ var listener = {
     testRan++;
     runNext();
   }
 };
 
 function setupChannel(url) {
   var ios = Components.classes["@mozilla.org/network/io-service;1"].
                        getService(Ci.nsIIOService);
-  var chan = ios.newChannel2("http://localhost:" +
-                             httpserver.identity.primaryPort + url,
-                             "",
-                             null,
-                             null,      // aLoadingNode
-                             Services.scriptSecurityManager.getSystemPrincipal(),
-                             null,      // aTriggeringPrincipal
-                             Ci.nsILoadInfo.SEC_NORMAL,
-                             Ci.nsIContentPolicy.TYPE_MEDIA);
+  var chan = ios.newChannel("http://localhost:" +
+                           httpserver.identity.primaryPort + url, "", null);
   var httpChan = chan.QueryInterface(Components.interfaces.nsIHttpChannel);
   return httpChan;
 }
 
 function runNext() {
   if (testRan == tests.length) {
     do_test_finished();
     return;
--- a/toolkit/components/osfile/tests/xpcshell/head.js
+++ b/toolkit/components/osfile/tests/xpcshell/head.js
@@ -49,18 +49,17 @@ function add_test_pair(generator) {
  * @param {string} path The _absolute_ path to the file.
  * @return {promise}
  * @resolves {string} The contents of the file.
  */
 function reference_fetch_file(path, test) {
   do_print("Fetching file " + path);
   let deferred = Promise.defer();
   let file = new FileUtils.File(path);
-  NetUtil.asyncFetch2(
-    file,
+  NetUtil.asyncFetch(file,
     function(stream, status) {
       if (!Components.isSuccessCode(status)) {
         deferred.reject(status);
         return;
       }
       let result, reject;
       try {
         result = NetUtil.readInputStreamToString(stream, stream.available());
@@ -68,23 +67,17 @@ function reference_fetch_file(path, test
         reject = x;
       }
       stream.close();
       if (reject) {
         deferred.reject(reject);
       } else {
         deferred.resolve(result);
       }
-    },
-    null,      // aLoadingNode
-    Services.scriptSecurityManager.getSystemPrincipal(),
-    null,      // aTriggeringPrincipal
-    Ci.nsILoadInfo.SEC_NORMAL,
-    Ci.nsIContentPolicy.TYPE_OTHER);
-
+  });
   return deferred.promise;
 };
 
 /**
  * Compare asynchronously the contents two files using xpcom.
  *
  * Used for comparing xpcom-based results to os.file-based results.
  *
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_copy.js
+++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_copy.js
@@ -1,14 +1,13 @@
 "use strict";
 
 Components.utils.import("resource://gre/modules/osfile.jsm");
 Components.utils.import("resource://gre/modules/FileUtils.jsm");
 Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
 Components.utils.import("resource://gre/modules/Promise.jsm");
 Components.utils.import("resource://gre/modules/Task.jsm");
 
 function run_test() {
   do_test_pending();
   run_next_test();
 }
 
@@ -24,18 +23,17 @@ let EXISTING_FILE = "test_osfile_async_c
  *
  * @param {string} path The _absolute_ path to the file.
  * @return {promise}
  * @resolves {string} The contents of the file.
  */
 let reference_fetch_file = function reference_fetch_file(path) {
   let promise = Promise.defer();
   let file = new FileUtils.File(path);
-  NetUtil.asyncFetch2(
-    file,
+  NetUtil.asyncFetch(file,
     function(stream, status) {
       if (!Components.isSuccessCode(status)) {
         promise.reject(status);
         return;
       }
       let result, reject;
       try {
         result = NetUtil.readInputStreamToString(stream, stream.available());
@@ -43,23 +41,17 @@ let reference_fetch_file = function refe
         reject = x;
       }
       stream.close();
       if (reject) {
         promise.reject(reject);
       } else {
         promise.resolve(result);
       }
-    },
-    null,      // aLoadingNode
-    Services.scriptSecurityManager.getSystemPrincipal(),
-    null,      // aTriggeringPrincipal
-    Ci.nsILoadInfo.SEC_NORMAL,
-    Ci.nsIContentPolicy.TYPE_OTHER);
-
+  });
   return promise.promise;
 };
 
 /**
  * Compare asynchronously the contents two files using xpcom.
  *
  * Used for comparing xpcom-based results to os.file-based results.
  *
--- a/toolkit/components/passwordmgr/test/test_prompt.html
+++ b/toolkit/components/passwordmgr/test/test_prompt.html
@@ -154,25 +154,17 @@ var resolveCallback = SpecialPowers.wrap
     // I'm cheating a bit here... We should probably do some magic foo to get
     // something implementing nsIProxiedProtocolHandler and then call
     // NewProxiedChannel(), so we have something that's definately a proxied
     // channel. But Mochitests use a proxy for a number of hosts, so just
     // requesting a normal channel will give us a channel that's proxied.
     // The proxyChannel needs to move to at least on-modify-request to
     // have valid ProxyInfo, but we use OnStartRequest during startup()
     // for simplicity.
-    proxyChannel = ioService.newChannel2(proxiedHost,
-                                         null,
-                                         null,
-                                         null,      // aLoadingNode
-                                         SpecialPowers.Services.
-                                         scriptSecurityManager.getSystemPrincipal(),
-                                         null,      // aTriggeringPrincipal
-                                         Ci.nsILoadInfo.SEC_NORMAL,
-                                         Ci.nsIContentPolicy.TYPE_OTHER);
+    proxyChannel = ioService.newChannel(proxiedHost, null, null);
     proxyChannel.asyncOpen(SpecialPowers.wrapCallbackObject(new proxyChannelListener()), null);
   }
 });
 
 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);
@@ -894,34 +886,18 @@ function doTests() {
   startCallbackTimer();
   isOk = prompter1.promptUsernameAndPassword(dialogTitle(), dialogText, "example2.com:80 (somerealm)",
                                   Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
   ok(isOk, "Checking dialog return value (accept)");
   ok(didDialog, "handleDialog was invoked");
   is(uname.value, "fill2user", "Checking returned username");
   is(pword.value, "fill2pass", "Checking returned password");
 
-  var channel1 = ioService.newChannel2("http://example.com",
-                                       null,
-                                       null,
-                                       null,      // aLoadingNode
-                                       SpecialPowers.Services.
-                                       scriptSecurityManager.getSystemPrincipal(),
-                                       null,      // aTriggeringPrincipal
-                                       Ci.nsILoadInfo.SEC_NORMAL,
-                                       Ci.nsIContentPolicy.TYPE_OTHER);
-  var channel2 = ioService.newChannel2("http://example2.com",
-                                       null,
-                                       null,
-                                       null,      // aLoadingNode
-                                       SpecialPowers.Services.
-                                       scriptSecurityManager.getSystemPrincipal(),
-                                       null,      // aTriggeringPrincipal
-                                       Ci.nsILoadInfo.SEC_NORMAL,
-                                       Ci.nsIContentPolicy.TYPE_OTHER);
+  var channel1 = ioService.newChannel("http://example.com", null, null);
+  var channel2 = ioService.newChannel("http://example2.com", null, null);
 
   var level = Ci.nsIAuthPrompt2.LEVEL_NONE;
 
   // ===== test 500 =====
   testNum = 500;
   authinfo.username = "inuser";
   authinfo.password = "inpass";
   authinfo.realm    = "some realm";
--- a/toolkit/components/prompts/test/test_modal_prompts.html
+++ b/toolkit/components/prompts/test/test_modal_prompts.html
@@ -1160,24 +1160,17 @@ function runTests() {
         clickedButton = prompter.confirmEx.apply(null, promptArgs);
         is(clickedButton, 0, "checked expected button num click");
         ok(didDialog, "handleDialog was invoked");
     }
 
     // promptAuth already tested via password manager but do a few specific things here.
 
 
-    var channel = ioService.newChannel2("http://example.com",
-                                        null,
-                                        null,
-                                        null,      // aLoadingNode
-                                        SpecialPowers.Services.scriptSecurityManager.getSystemPrincipal(),
-                                        null,      // aTriggeringPrincipal
-                                        Ci.nsILoadInfo.SEC_NORMAL,
-                                        Ci.nsIContentPolicy.TYPE_OTHER);
+    var channel = ioService.newChannel("http://example.com", null, null);
     var level = Ci.nsIAuthPrompt2.LEVEL_NONE;
     var authinfo = {
         username : "",
         password : "",
         domain   : "",
         flags : Ci.nsIAuthInformation.AUTH_HOST,
         authenticationScheme : "basic",
         realm : ""
--- a/toolkit/components/search/tests/xpcshell/test_serialize_file.js
+++ b/toolkit/components/search/tests/xpcshell/test_serialize_file.js
@@ -33,29 +33,22 @@ add_task(function test_batchTask() {
   do_check_neq(engineFile2.fileSize, 0);
 });
 
 add_test(function test_addParam() {
   let engine = Services.search.getEngineByName("Test search engine");
   engine.addParam("param-name", "param-value", null);
 
   function readAsyncFile(aFile, aCallback) {
-    NetUtil.asyncFetch2(
-      aFile,
-      function(inputStream, status) {
-        do_check_true(Components.isSuccessCode(status));
+    NetUtil.asyncFetch(aFile, function(inputStream, status) {
+      do_check_true(Components.isSuccessCode(status));
 
-        let data = NetUtil.readInputStreamToString(inputStream, inputStream.available());
-        aCallback(data);
-      },
-      null,      // aLoadingNode
-      Services.scriptSecurityManager.getSystemPrincipal(),
-      null,      // aTriggeringPrincipal
-      Ci.nsILoadInfo.SEC_NORMAL,
-      Ci.nsIContentPolicy.TYPE_DATAREQUEST);
+      let data = NetUtil.readInputStreamToString(inputStream, inputStream.available());
+      aCallback(data);
+    });
   }
 
   let observer = function(aSubject, aTopic, aData) {
     // The sherlock engine file may still be updated because the icon takes
     // time be loaded, therefore, the engine name is checked here.
     aSubject.QueryInterface(Ci.nsIFile);
     if (aTopic == "browser-search-service" &&
         aData == "write-engine-to-disk-complete" &&
--- a/toolkit/components/telemetry/tests/unit/test_ThirdPartyCookieProbe.js
+++ b/toolkit/components/telemetry/tests/unit/test_ThirdPartyCookieProbe.js
@@ -61,22 +61,17 @@ function run_test() {
  *
  * @param obj An object with the following fields
  * - {string} request The uri of the request setting the cookie.
  * - {string} referrer The uri of the referrer for this request.
  */
 function tryToSetCookie(obj) {
   let requestURI = Services.io.newURI(obj.request, null, null);
   let referrerURI = Services.io.newURI(obj.referrer, null, null);
-  let requestChannel = Services.io.newChannelFromURI2(requestURI,
-                                                      null,      // aLoadingNode
-                                                      Services.scriptSecurityManager.getSystemPrincipal(),
-                                                      null,      // aTriggeringPrincipal
-                                                      Ci.nsILoadInfo.SEC_NORMAL,
-                                                      Ci.nsIContentPolicy.TYPE_OTHER);
+  let requestChannel = Services.io.newChannelFromURI(requestURI);
   gCookieService.setCookieString(referrerURI, null, "Is there a cookie in my jar?", requestChannel);
 }
 
 function wait(ms) {
   let deferred = Promise.defer();
   do_timeout(ms, () => deferred.resolve());
   return deferred.promise;
 }
--- a/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_openDialog.js
@@ -17,24 +17,17 @@ let CustomChromeProtocol = {
     let uri = Cc["@mozilla.org/network/simple-uri;1"].
               createInstance(Ci.nsIURI);
     uri.spec = aSpec;
     return uri;
   },
 
   newChannel: function CCP_newChannel(aURI) {
     let url = "chrome:" + aURI.path;
-    let ch = NetUtil.newChannel2(url,
-                                 null,
-                                 null,
-                                 null,      // aLoadingNode
-                                 Services.scriptSecurityManager.getSystemPrincipal(),
-                                 null,      // aTriggeringPrincipal
-                                 Ci.nsILoadInfo.SEC_NORMAL,
-                                 Ci.nsIContentPolicy.TYPE_OTHER);
+    let ch = NetUtil.newChannel(url);
     ch.originalURI = aURI;
     return ch;
   },
 
   allowPort: function CCP_allowPort(aPort, aScheme) {
     return false;
   },