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
This commit is contained in:
Mike Conley 2018-10-02 18:38:48 +00:00
parent 49f0fb11c5
commit 9b0b5947ec

View File

@ -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();
});