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

Unified Diff: LayoutTests/streams/basic.html

Issue 1167343002: Add methods for creating V8 extras-based ReadableStreams from C++ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove C++ queuing strategies Created 5 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 | Source/bindings/core/v8/ScriptState.h » ('j') | Source/core/streams/UnderlyingSourceBase.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptState.h » ('j') | Source/core/streams/UnderlyingSourceBase.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698