From 4ab9e210d35e23486a0ac42cc097dba5c80f8935 Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Sun, 15 Nov 2015 14:48:38 -0800 Subject: [PATCH] Bug 1223437 - Use channel.asyncOpen2 in toolkit/components/jsdownloads/test/unit (r=sicking) --- toolkit/components/jsdownloads/test/unit/head.js | 5 +++-- .../components/jsdownloads/test/unit/test_DownloadImport.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/toolkit/components/jsdownloads/test/unit/head.js b/toolkit/components/jsdownloads/test/unit/head.js index d1eddfbff52..73d2fbf6b44 100644 --- a/toolkit/components/jsdownloads/test/unit/head.js +++ b/toolkit/components/jsdownloads/test/unit/head.js @@ -410,10 +410,11 @@ function promiseStartExternalHelperAppServiceDownload(aSourceUrl) { let channel = NetUtil.newChannel({ uri: sourceURI, loadUsingSystemPrincipal: true, + securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL }); // Start the actual download process. - channel.asyncOpen({ + channel.asyncOpen2({ contentListener: null, onStartRequest: function (aRequest, aContext) @@ -435,7 +436,7 @@ function promiseStartExternalHelperAppServiceDownload(aSourceUrl) { this.contentListener.onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); }, - }, null); + }); }.bind(this)).then(null, do_report_unexpected_exception); return deferred.promise; diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadImport.js b/toolkit/components/jsdownloads/test/unit/test_DownloadImport.js index 2940dbf83eb..e20a5122b80 100644 --- a/toolkit/components/jsdownloads/test/unit/test_DownloadImport.js +++ b/toolkit/components/jsdownloads/test/unit/test_DownloadImport.js @@ -167,9 +167,10 @@ function promiseEntityID(aUrl) { let channel = NetUtil.newChannel({ uri: NetUtil.newURI(aUrl), loadUsingSystemPrincipal: true, + securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL }); - channel.asyncOpen({ + channel.asyncOpen2({ onStartRequest: function (aRequest) { if (aRequest instanceof Ci.nsIResumableChannel) { entityID = aRequest.entityID; @@ -186,7 +187,7 @@ function promiseEntityID(aUrl) { }, onDataAvailable: function () {} - }, null); + }); return deferred.promise; }