Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformStream: Verify behaviour of abort() during write() #817

Merged
merged 2 commits into from Oct 3, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -314,12 +314,15 @@ promise_test(t => {
const writer = ts.writable.getWriter();
// write should start synchronously
const writePromise = writer.write(0);
// The underlying sink's abort() is not called until the write() completes.
const abortPromise = writer.abort();
return promise_rejects(t, new TypeError(), ts.readable.getReader().read(), 'read() should reject')
.then(() => Promise.all([
promise_rejects(t, new TypeError(), writePromise, 'write() should reject'),
abortPromise
]));
// Perform a read to relieve backpressure and permit the write() to complete.
const readPromise = ts.readable.getReader().read();
return Promise.all([
promise_rejects(t, new TypeError(), readPromise, 'read() should reject'),
promise_rejects(t, new TypeError(), writePromise, 'write() should reject'),
abortPromise
]);
});
}, 'a write() that was waiting for backpressure should reject if the writable is aborted');

Expand Down