Index: LayoutTests/streams/basic.html |
diff --git a/LayoutTests/streams/basic.html b/LayoutTests/streams/basic.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f27e8e7b160d01e25a0c390f1e0a1efb37d88259 |
--- /dev/null |
+++ b/LayoutTests/streams/basic.html |
@@ -0,0 +1,37 @@ |
+<!DOCTYPE html> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+ |
+<div id="container"> |
+ <div id="element"></div> |
+</div> |
+ |
+<script> |
+"use strict"; |
+ |
+test(function () { |
+ assert_equals(internals.readableStream.constructor.name, "ReadableStream"); |
+}, "internals.readableStream should be a ReadableStream"); |
+ |
+promise_test(function () { |
+ const reader = internals.readableStream.getReader(); |
+ |
+ return reader.read().then(function (result1) { |
+ assert_equals(result1.value, "a"); |
+ assert_equals(result1.done, false); |
+ |
+ return reader.read(); |
+ }) |
+ .then(function (result2) { |
+ assert_equals(result2.value, "b"); |
+ assert_equals(result2.done, false); |
+ |
+ return reader.read(); |
+ }) |
+ .then(function (result3) { |
+ assert_equals(result3.value, undefined); |
+ assert_equals(result3.done, true); |
+ }); |
+}, "reading from internals.readableStream should give the expected sequence"); |
+ |
+</script> |