Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js

Issue 2668783003: Import wpt@767dc2a4f049c761bd146d61de2ea860a895a624 (Closed)
Patch Set: Update test expectations and baselines. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js
index b95b54bc7fc9a6f1446b06b85a47efe9c2dc9611..0d5b817c88e2fb4cc30fd6af2818b1d7d672575b 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/bad-underlying-sources.js
@@ -380,4 +380,28 @@ promise_test(() => {
}, 'Underlying source: calling error and returning a rejected promise from pull should cause the stream to error ' +
'with the first error');
+const error1 = { name: 'error1' };
+
+promise_test(t => {
+
+ let pullShouldThrow = false;
+ const rs = new ReadableStream({
+ pull(controller) {
+ if (pullShouldThrow) {
+ throw error1;
+ }
+ controller.enqueue(0);
+ }
+ }, new CountQueuingStrategy({highWaterMark: 1}));
+ const reader = rs.getReader();
+ return Promise.resolve().then(() => {
+ pullShouldThrow = true;
+ return Promise.all([
+ reader.read(),
+ promise_rejects(t, error1, reader.closed, '.closed promise should reject')
+ ]);
+ });
+
+}, 'read should not error if it dequeues and pull() throws');
+
done();

Powered by Google App Engine
This is Rietveld 408576698