зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1125991 - Make JS callers of ios.newChannel call ios.newChannel2 in toolkit/components/jsdownloads - tests (r=paolo)
This commit is contained in:
Родитель
5aac2fe0fc
Коммит
b1de2face2
|
@ -400,7 +400,14 @@ function promiseStartExternalHelperAppServiceDownload(aSourceUrl) {
|
|||
},
|
||||
}).then(null, do_report_unexpected_exception);
|
||||
|
||||
let channel = NetUtil.newChannel(sourceURI);
|
||||
let channel = NetUtil.newChannel2(sourceURI,
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
|
||||
// Start the actual download process.
|
||||
channel.asyncOpen({
|
||||
|
@ -534,7 +541,9 @@ function promiseVerifyContents(aPath, aExpectedContents)
|
|||
}
|
||||
|
||||
let deferred = Promise.defer();
|
||||
NetUtil.asyncFetch(file, function(aInputStream, aStatus) {
|
||||
NetUtil.asyncFetch2(
|
||||
file,
|
||||
function(aInputStream, aStatus) {
|
||||
do_check_true(Components.isSuccessCode(aStatus));
|
||||
let contents = NetUtil.readInputStreamToString(aInputStream,
|
||||
aInputStream.available());
|
||||
|
@ -548,7 +557,13 @@ function promiseVerifyContents(aPath, aExpectedContents)
|
|||
do_check_eq(contents, aExpectedContents);
|
||||
}
|
||||
deferred.resolve();
|
||||
});
|
||||
},
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
|
||||
yield deferred.promise;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -164,7 +164,14 @@ function promiseTableCount(aConnection) {
|
|||
function promiseEntityID(aUrl) {
|
||||
let deferred = Promise.defer();
|
||||
let entityID = "";
|
||||
let channel = NetUtil.newChannel(NetUtil.newURI(aUrl));
|
||||
let channel = NetUtil.newChannel2(NetUtil.newURI(aUrl),
|
||||
null,
|
||||
null,
|
||||
null, // aLoadingNode
|
||||
Services.scriptSecurityManager.getSystemPrincipal(),
|
||||
null, // aTriggeringPrincipal
|
||||
Ci.nsILoadInfo.SEC_NORMAL,
|
||||
Ci.nsIContentPolicy.TYPE_OTHER);
|
||||
|
||||
channel.asyncOpen({
|
||||
onStartRequest: function (aRequest) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче