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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/streams/chromium/err-invalid-hwm.html

Issue 2933853003: Streams: Fix exception message for NaN HWM (Closed)
Patch Set: Created 3 years, 6 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/Source/core/streams/ReadableStream.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/chromium/err-invalid-hwm.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/streams/chromium/err-invalid-hwm.html b/third_party/WebKit/LayoutTests/http/tests/streams/chromium/err-invalid-hwm.html
new file mode 100644
index 0000000000000000000000000000000000000000..07dd7652381d7ad515f24f3a24ae426c00a72c3b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/streams/chromium/err-invalid-hwm.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+// These are a regression tests for
+// https://bugs.chromium.org/p/chromium/issues/detail?id=719763. Checking the
+// message text of exceptions is not normally good practice but here it is the
+// only way to verify that the bug is fixed.
+
+test(() => {
+ try {
+ new ReadableStream({}, {highWaterMark: NaN});
+ assert_unreached('constructing with invalid highWaterMark should throw');
+ } catch (e) {
+ assert_equals(
+ e.message,
+ 'A queueing strategy\'s highWaterMark property must be a nonnegative,' +
+ ' non-NaN number',
+ 'message should be relevant');
+ }
+}, 'ReadableStream RangeError on invalid highWaterMark should have an ' +
+ 'appropriate message');
+
+test(() => {
+ try {
+ new WritableStream({}, {highWaterMark: NaN});
+ assert_unreached('constructing with invalid highWaterMark should throw');
+ } catch (e) {
+ assert_equals(
+ e.message,
+ 'A queueing strategy\'s highWaterMark property must be a nonnegative,' +
+ ' non-NaN number',
+ 'message should be relevant');
+ }
+}, 'WritableStream RangeError on invalid highWaterMark should have an ' +
+ 'appropriate message');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/streams/ReadableStream.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698