1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 add_task(async function run_test() {
6 let sb = new Cu.Sandbox('http://www.example.com');
10 [Symbol.asyncIterator]() {
15 let promise = Cu.evalInSandbox(`Promise.resolve({done: ${done}, value: {hello: "world"}})`, sb);
21 let stream = ReadableStream.from(iterator);
22 let reader = stream.getReader();
23 let result = await reader.read();
24 Assert.equal(result.done, false);
25 Assert.equal(result.value?.hello, "world");
26 result = await reader.read();
27 Assert.equal(result.done, true);