1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 add_task(async function channelname() {
6 [new Blob(["test"], { type: "text/plain" })],
9 var url = URL.createObjectURL(file);
10 var channel = NetUtil.newChannel({
12 loadUsingSystemPrincipal: true,
15 let inputStream = channel.open();
16 ok(inputStream, "Should be able to open channel");
18 inputStream.QueryInterface(Ci.nsIAsyncInputStream),
19 "Stream should support async operations"
22 await new Promise(resolve => {
23 inputStream.asyncWait(
25 let available = inputStream.available();
26 ok(available, "There should be data to read");
28 channel.contentDispositionFilename,
36 Services.tm.mainThread
41 channel.cancel(Cr.NS_ERROR_FAILURE);