| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 // These are a regression tests for |
| 7 // https://bugs.chromium.org/p/chromium/issues/detail?id=719763. Checking the |
| 8 // message text of exceptions is not normally good practice but here it is the |
| 9 // only way to verify that the bug is fixed. |
| 10 |
| 11 test(() => { |
| 12 try { |
| 13 new ReadableStream({}, {highWaterMark: NaN}); |
| 14 assert_unreached('constructing with invalid highWaterMark should throw'); |
| 15 } catch (e) { |
| 16 assert_equals( |
| 17 e.message, |
| 18 'A queueing strategy\'s highWaterMark property must be a nonnegative,' + |
| 19 ' non-NaN number', |
| 20 'message should be relevant'); |
| 21 } |
| 22 }, 'ReadableStream RangeError on invalid highWaterMark should have an ' + |
| 23 'appropriate message'); |
| 24 |
| 25 test(() => { |
| 26 try { |
| 27 new WritableStream({}, {highWaterMark: NaN}); |
| 28 assert_unreached('constructing with invalid highWaterMark should throw'); |
| 29 } catch (e) { |
| 30 assert_equals( |
| 31 e.message, |
| 32 'A queueing strategy\'s highWaterMark property must be a nonnegative,' + |
| 33 ' non-NaN number', |
| 34 'message should be relevant'); |
| 35 } |
| 36 }, 'WritableStream RangeError on invalid highWaterMark should have an ' + |
| 37 'appropriate message'); |
| 38 </script> |
| OLD | NEW |