From 04f5e678419b5a539d255da3f4bc0d6739037d4d Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Tue, 10 Feb 2015 20:49:36 -0800 Subject: [PATCH] Bug 1087744: Make JS callers of ios.newChannel call ios.newChannel2 in toolkit/components/osfile (r=yoric) --- .../osfile/tests/mochi/main_test_osfile_async.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js index 0959883f1e45..56c70d7081cc 100644 --- a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js +++ b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js @@ -89,7 +89,8 @@ let reference_fetch_file = function reference_fetch_file(path, test) { test.info("Fetching file " + path); let promise = Promise.defer(); let file = new FileUtils.File(path); - NetUtil.asyncFetch(file, + NetUtil.asyncFetch2( + file, function(stream, status) { if (!Components.isSuccessCode(status)) { promise.reject(status); @@ -107,7 +108,13 @@ let reference_fetch_file = function reference_fetch_file(path, test) { } else { promise.resolve(result); } - }); + }, + null, // aLoadingNode + Services.scriptSecurityManager.getSystemPrincipal(), + null, // aTriggeringPrincipal + Ci.nsILoadInfo.SEC_NORMAL, + Ci.nsIContentPolicy.TYPE_OTHER); + return promise.promise; };