mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1246220 - Remove SEC_NORMAL from netwerk/test (r=ckerschb,mcmanus)
This commit is contained in:
parent
7b8a481330
commit
8562186c68
@ -358,7 +358,7 @@ function test_asyncFetch_with_nsIURI()
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
}
|
||||
|
||||
@ -396,7 +396,7 @@ function test_asyncFetch_with_string()
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
}
|
||||
|
||||
@ -442,7 +442,7 @@ function test_asyncFetch_with_nsIFile()
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
}
|
||||
|
||||
@ -468,7 +468,7 @@ function test_asyncFetch_with_nsIInputString()
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
}
|
||||
|
||||
@ -528,7 +528,7 @@ function test_newChannel_with_string()
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
let NetUtilChannel = NetUtil.newChannel({
|
||||
uri: TEST_SPEC,
|
||||
@ -550,7 +550,7 @@ function test_newChannel_with_nsIURI()
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
let NetUtilChannel = NetUtil.newChannel({
|
||||
uri: uri,
|
||||
@ -569,7 +569,7 @@ function test_newChannel_with_options()
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
|
||||
function checkEqualToIOSChannel(channel) {
|
||||
|
@ -7,6 +7,7 @@ var Cc = Components.classes;
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var unsafeAboutModule = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
|
||||
@ -38,13 +39,11 @@ function run_test() {
|
||||
let classID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
|
||||
registrar.registerFactory(classID, "", "@mozilla.org/network/protocol/about;1?what=unsafe", factory);
|
||||
|
||||
let aboutUnsafeURI = Services.io.newURI("about:unsafe", null, null);
|
||||
let aboutUnsafeChan = Services.io.newChannelFromURI2(aboutUnsafeURI,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
let aboutUnsafeChan = NetUtil.newChannel({
|
||||
uri: "about:unsafe",
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
|
||||
do_check_null(aboutUnsafeChan.owner, "URI_SAFE_FOR_UNTRUSTED_CONTENT channel has no owner");
|
||||
|
||||
registrar.unregisterFactory(classID, factory);
|
||||
|
@ -1,28 +1,19 @@
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
function run_test() {
|
||||
var ioServ = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var base = NetUtil.newURI("http://www.example.com", null, null);
|
||||
var about1 = NetUtil.newURI("about:blank", null, null);
|
||||
var about2 = NetUtil.newURI("about:blank", null, base);
|
||||
|
||||
var base = ioServ.newURI("http://www.example.com", null, null);
|
||||
var chan1 = NetUtil.newChannel({
|
||||
uri: about1,
|
||||
loadUsingSystemPrincipal: true
|
||||
}).QueryInterface(Components.interfaces.nsIPropertyBag2);
|
||||
|
||||
var about1 = ioServ.newURI("about:blank", null, null);
|
||||
var about2 = ioServ.newURI("about:blank", null, base);
|
||||
|
||||
var chan1 = ioServ.newChannelFromURI2(about1,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER)
|
||||
.QueryInterface(Components.interfaces.nsIPropertyBag2);
|
||||
var chan2 = ioServ.newChannelFromURI2(about2,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER)
|
||||
.QueryInterface(Components.interfaces.nsIPropertyBag2);
|
||||
var chan2 = NetUtil.newChannel({
|
||||
uri: about2,
|
||||
loadUsingSystemPrincipal: true
|
||||
}).QueryInterface(Components.interfaces.nsIPropertyBag2);
|
||||
|
||||
var haveProp = false;
|
||||
var propVal = null;
|
||||
|
@ -5,8 +5,7 @@
|
||||
// - HTTPS
|
||||
// - Proxies
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
const nsIAuthInformation = Components.interfaces.nsIAuthInformation;
|
||||
const nsIAuthPromptAdapterFactory = Components.interfaces.nsIAuthPromptAdapterFactory;
|
||||
|
||||
@ -102,16 +101,11 @@ function run_test() {
|
||||
|
||||
|
||||
// Also have to make up a channel
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var chan = ios.newChannel2("http://" + host,
|
||||
"",
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
var uri = NetUtil.newURI("http://" + host, "", null)
|
||||
var chan = NetUtil.newChannel({
|
||||
uri: uri,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
|
||||
function do_tests(expectedRV) {
|
||||
var prompt1;
|
||||
@ -208,14 +202,11 @@ function run_test() {
|
||||
info.password = "";
|
||||
|
||||
// 5: FTP
|
||||
var ftpchan = ios.newChannel2("ftp://" + host,
|
||||
"",
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
var uri2 = NetUtil.newURI("ftp://" + host, "", null);
|
||||
var ftpchan = NetUtil.newChannel({
|
||||
uri: uri2,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
|
||||
prompt1 = new Prompt1();
|
||||
prompt1.rv = expectedRV;
|
||||
|
@ -1,6 +1,5 @@
|
||||
// test that methods are not normalized
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
const testMethods = [
|
||||
["GET"],
|
||||
@ -39,19 +38,10 @@ const testMethods = [
|
||||
]
|
||||
|
||||
function run_test() {
|
||||
var ios =
|
||||
Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
|
||||
var chan = ios.newChannel2("http://localhost/",
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER)
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
var chan = NetUtil.newChannel({
|
||||
uri: "http://localhost/",
|
||||
loadUsingSystemPrincipal: true
|
||||
}).QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
|
||||
for (var i = 0; i < testMethods.length; i++) {
|
||||
chan.requestMethod = testMethods[i];
|
||||
|
@ -7,7 +7,8 @@
|
||||
*/
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
|
||||
var URIs = [
|
||||
"http://example.org",
|
||||
@ -26,14 +27,10 @@ LoadContext.prototype = {
|
||||
|
||||
function getChannels() {
|
||||
for (let u of URIs) {
|
||||
yield Services.io.newChannel2(u,
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
yield NetUtil.newChannel({
|
||||
uri: u,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ function run_test() {
|
||||
chan.initLoadInfo(null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_WEBSOCKET);
|
||||
|
||||
var uri = ioService.newURI(url, null, null);
|
||||
|
@ -2,7 +2,7 @@
|
||||
// HTTP Accept-Language header test
|
||||
//
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var testpath = "/bug672448";
|
||||
|
||||
@ -80,15 +80,12 @@ function test_accepted_languages() {
|
||||
}
|
||||
|
||||
function setupChannel(path) {
|
||||
let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
let chan = ios.newChannel2("http://localhost:4444" + path,
|
||||
"",
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
|
||||
let chan = NetUtil.newChannel ({
|
||||
uri: "http://localhost:4444" + path,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
|
||||
chan.QueryInterface(Ci.nsIHttpChannel);
|
||||
return chan;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var testpath = "/bug1054739";
|
||||
|
||||
@ -37,15 +37,11 @@ function run_test() {
|
||||
}
|
||||
|
||||
function setupChannel(path) {
|
||||
let ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
let chan = ios.newChannel2("http://localhost:4444" + path,
|
||||
"",
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
let uri = NetUtil.newURI("http://localhost:4444" + path, "", null);
|
||||
let chan = NetUtil.newChannel({
|
||||
uri: uri,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
chan.QueryInterface(Ci.nsIHttpChannel);
|
||||
return chan;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
function check_request_header(chan, name, value) {
|
||||
var chanValue;
|
||||
@ -11,17 +11,11 @@ function check_request_header(chan, name, value) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
var ios = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var chan = ios.newChannel2("http://www.mozilla.org/",
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER)
|
||||
.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
|
||||
var chan = NetUtil.newChannel ({
|
||||
uri: "http://www.mozilla.org/",
|
||||
loadUsingSystemPrincipal: true
|
||||
}).QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
|
||||
check_request_header(chan, "host", "www.mozilla.org");
|
||||
check_request_header(chan, "Host", "www.mozilla.org");
|
||||
|
@ -11,22 +11,18 @@
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
Cu.import('resource://gre/modules/Services.jsm');
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
|
||||
var httpServer = null;
|
||||
var cacheUpdateObserver = null;
|
||||
var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
|
||||
|
||||
function make_channel(url, callback, ctx) {
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
return ios.newChannel2(url,
|
||||
"",
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
systemPrincipal,
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
return NetUtil.newChannel({
|
||||
uri: url,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
}
|
||||
|
||||
function make_uri(url) {
|
||||
|
@ -4,6 +4,7 @@
|
||||
"use strict";
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
@ -138,14 +139,10 @@ function test_resolve_type(type, host, callback) {
|
||||
return app;
|
||||
};
|
||||
|
||||
let channel = ios.newChannel2(type + "://" + host + "/",
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
let channel = NetUtil.newChannel({
|
||||
uri: type + "://" + host + "/",
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
channel.notificationCallbacks =
|
||||
AppsUtils.createLoadContext(MY_APP_ID, true);
|
||||
|
||||
|
@ -5,16 +5,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
function makeChan(uri, isPrivate) {
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
|
||||
var chan = ios.newChannel2(uri.spec,
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER)
|
||||
.QueryInterface(Ci.nsIHttpChannel);
|
||||
var chan = NetUtil.newChannel ({
|
||||
uri: uri.spec,
|
||||
loadUsingSystemPrincipal: true
|
||||
}).QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
|
||||
chan.QueryInterface(Ci.nsIPrivateBrowsingChannel).setPrivate(isPrivate);
|
||||
return chan;
|
||||
}
|
||||
|
@ -1,19 +1,14 @@
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"].
|
||||
getService(Ci.nsIIOService);
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
function getTestReferrer(server_uri, referer_uri) {
|
||||
var chan = ios.newChannel2(server_uri,
|
||||
"",
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
var uri = NetUtil.newURI(server_uri, "", null)
|
||||
var chan = NetUtil.newChannel({
|
||||
uri: uri,
|
||||
loadUsingSystemPrincipal: true
|
||||
});
|
||||
|
||||
chan.QueryInterface(Components.interfaces.nsIHttpChannel);
|
||||
chan.referrer = ios.newURI(referer_uri, null, null);
|
||||
chan.referrer = NetUtil.newURI(referer_uri, null, null);
|
||||
var header = null;
|
||||
try {
|
||||
header = chan.getRequestHeader("Referer");
|
||||
|
@ -38,7 +38,7 @@ function run_test() {
|
||||
chan.initLoadInfo(null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
|
||||
Ci.nsIContentPolicy.TYPE_WEBSOCKET);
|
||||
|
||||
var uri = Services.io.newURI(url, null, null);
|
||||
|
Loading…
Reference in New Issue
Block a user