Re: [streams] Port a bunch of tests to web-platform-tests format (#397)

> +});
> +
> +var test11 = async_test('Underlying source: calling close twice on an empty stream should throw the second time');
> +test11.step(function() {
> +    new ReadableStream({
> +        start: function(c) {
> +            c.close();
> +            assert_throws(new TypeError(), c.close, 'second call to close should throw a TypeError');
> +        }
> +    }).getReader().closed.then(test11.step_func(function() { test11.done('closed should fulfill'); }));
> +});
> +
> +var test12 = async_test('Underlying source: calling close twice on a non-empty stream should throw the second time');
> +test12.step(function() {
> +    var startCalled = false;
> +    var readCalled = false;

I think we're sure that start() is invoked and c.close() is executed but we wanted to use the t.plan() to detect completion and it just had to count this in.

We can skip readCalled checking, I think. No strong opinion, but we can.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/397/files#r42100597

Received on Thursday, 15 October 2015 09:25:38 UTC