Re: [whatwg/streams] Port close() tests to web-platform-tests (#529)

tyoshino commented on this pull request.



> +  return closePromise.then(value => assert_equals(value, undefined, 'fulfillment value must be undefined'));
+}, 'fulfillment value of ws.close() call must be undefined even if the underlying sink returns a non-undefined ' +
+    'value');
+
+async_test(t => {
+  const thrownError = new Error('throw me');
+  const ws = new WritableStream({
+    close() {
+      throw thrownError;
+    }
+  });
+
+  const writer = ws.getWriter();
+
+  promise_rejects(
+      t, thrownError, writer.close(), 'close promise', 'close promise should be rejected with the thrown error');

I think it's ok. I added promise_rejects in this file as preparation for migration to testharness.js.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/529

Received on Tuesday, 11 October 2016 08:42:50 UTC