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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-strategies.js

Issue 1902673003: Reflect recent spec changes to V8 Extra ReadableStream impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build Created 4 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-underlying-sources.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-strategies.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-strategies.js b/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-strategies.js
index 5cecb8fb2bb32f21b5fa7b0edc7b39f7b777b217..0c053ab62bcfe21e42c55b20bbcbaae226baf8b4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-strategies.js
+++ b/third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-strategies.js
@@ -19,9 +19,10 @@ test(() => {
}, 'Readable stream: throwing strategy.size getter');
-test(() => {
+promise_test(t => {
- const theError = new Error('a unique string');
+ const controllerError = { name: 'controller error' };
+ const thrownError = { name: 'thrown error' };
let controller;
const rs = new ReadableStream(
@@ -32,22 +33,22 @@ test(() => {
},
{
size() {
- controller.error(theError);
- throw theError;
+ controller.error(controllerError);
+ throw thrownError;
},
highWaterMark: 5
}
);
- assert_throws(theError, () => {
- controller.enqueue('a');
- }, 'enqueue should re-throw the error');
+ assert_throws(thrownError, () => controller.enqueue('a'), 'enqueue should re-throw the error');
+
+ return promise_rejects(t, controllerError, rs.getReader().closed);
}, 'Readable stream: strategy.size errors the stream and then throws');
-test(() => {
+promise_test(t => {
- const theError = new Error('a unique string');
+ const theError = { name: 'my error' };
let controller;
const rs = new ReadableStream(
@@ -65,11 +66,9 @@ test(() => {
}
);
- try {
- controller.enqueue('a');
- } catch (error) {
- assert_equals(error.name, 'RangeError', 'enqueue should throw a RangeError');
- }
+ assert_throws(new RangeError(), () => controller.enqueue('a'), 'enqueue should throw a RangeError');
+
+ return promise_rejects(t, theError, rs.getReader().closed, 'closed should reject with the error');
}, 'Readable stream: strategy.size errors the stream and then returns Infinity');
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/streams/readable-streams/bad-underlying-sources.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698