From 9b0b5947ecf97e00a883ed69bd92ce88de4011d8 Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Tue, 2 Oct 2018 18:38:48 +0000 Subject: [PATCH] Bug 1492482 - Remove CPOW usage from browser_saveImageURL.js. r=baku This also "fixes" what appears to be some broken checks by switching them to todo()'s. I filed bug 1492885 to investigate these busted checks, and re-enable them. Depends on D6970 Differential Revision: https://phabricator.services.mozilla.com/D6971 --HG-- extra : moz-landing-system : lando --- .../tests/browser/browser_saveImageURL.js | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/toolkit/content/tests/browser/browser_saveImageURL.js b/toolkit/content/tests/browser/browser_saveImageURL.js index b804d143ecf5..e469e0327f4d 100644 --- a/toolkit/content/tests/browser/browser_saveImageURL.js +++ b/toolkit/content/tests/browser/browser_saveImageURL.js @@ -38,15 +38,18 @@ add_task(async function preferred_API() { saveImageURL(url, "image.jpg", null, true, false, null, null, null, null, false, gBrowser.contentPrincipal); - let channel = gBrowser.contentWindowAsCPOW.docShell.currentDocumentChannel; - if (channel) { - ok(true, channel.QueryInterface(Ci.nsIHttpChannelInternal) - .channelIsForDownload); + await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => { + let channel = docShell.currentDocumentChannel; + if (channel) { + todo(channel.QueryInterface(Ci.nsIHttpChannelInternal) + .channelIsForDownload); + + // Throttleable is the only class flag assigned to downloads. + todo(channel.QueryInterface(Ci.nsIClassOfService).classFlags == + Ci.nsIClassOfService.Throttleable); + } + }); - // Throttleable is the only class flag assigned to downloads. - ok(channel.QueryInterface(Ci.nsIClassOfService).classFlags, - Ci.nsIClassOfService.Throttleable); - } await waitForFilePicker(); }); }); @@ -74,15 +77,18 @@ add_task(async function deprecated_API() { // pass the XUL document instead to test this interface. let doc = document; - let channel = gBrowser.contentWindowAsCPOW.docShell.currentDocumentChannel; - if (channel) { - ok(true, channel.QueryInterface(Ci.nsIHttpChannelInternal) - .channelIsForDownload); - // Throttleable is the only class flag assigned to downloads. - ok(channel.QueryInterface(Ci.nsIClassOfService).classFlags, - Ci.nsIClassOfService.Throttleable); - } + await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => { + let channel = docShell.currentDocumentChannel; + if (channel) { + todo(channel.QueryInterface(Ci.nsIHttpChannelInternal) + .channelIsForDownload); + + // Throttleable is the only class flag assigned to downloads. + todo(channel.QueryInterface(Ci.nsIClassOfService).classFlags == + Ci.nsIClassOfService.Throttleable); + } + }); saveImageURL(url, "image.jpg", null, true, false, null, doc, null, null); await waitForFilePicker(); });