Title: [190317] trunk/LayoutTests
Revision
190317
Author
calva...@igalia.com
Date
2015-09-29 11:24:06 -0700 (Tue, 29 Sep 2015)

Log Message

[Streams API] Add abstract ops tests
https://bugs.webkit.org/show_bug.cgi?id=149629

Reviewed by Darin Adler.

* streams/reference-implementation/abstract-ops-expected.txt: Added.
* streams/reference-implementation/abstract-ops.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (190316 => 190317)


--- trunk/LayoutTests/ChangeLog	2015-09-29 18:08:05 UTC (rev 190316)
+++ trunk/LayoutTests/ChangeLog	2015-09-29 18:24:06 UTC (rev 190317)
@@ -1,5 +1,15 @@
 2015-09-29  Xabier Rodriguez Calvar  <calva...@igalia.com>
 
+        [Streams API] Add abstract ops tests
+        https://bugs.webkit.org/show_bug.cgi?id=149629
+
+        Reviewed by Darin Adler.
+
+        * streams/reference-implementation/abstract-ops-expected.txt: Added.
+        * streams/reference-implementation/abstract-ops.html: Added.
+
+2015-09-29  Xabier Rodriguez Calvar  <calva...@igalia.com>
+
         [Streams API] Update tests according to latest spec
         https://bugs.webkit.org/show_bug.cgi?id=149628
 

Added: trunk/LayoutTests/streams/reference-implementation/abstract-ops-expected.txt (0 => 190317)


--- trunk/LayoutTests/streams/reference-implementation/abstract-ops-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/streams/reference-implementation/abstract-ops-expected.txt	2015-09-29 18:24:06 UTC (rev 190317)
@@ -0,0 +1,8 @@
+
+FAIL IsReadableStreamDisturbed returns true for an empty non-closed stream on which read() has been called Can't find variable: IsReadableStreamDisturbed
+FAIL IsReadableStreamDisturbed returns true for an empty non-closed stream on which cancel() has been called Can't find variable: IsReadableStreamDisturbed
+FAIL IsReadableStreamDisturbed returns true for a closed stream on which read() has been called Can't find variable: IsReadableStreamDisturbed
+FAIL IsReadableStreamDisturbed returns true for a closed stream on which cancel() has been called Can't find variable: IsReadableStreamDisturbed
+FAIL IsReadableStreamDisturbed returns true for an errored stream on which read() has been called Can't find variable: IsReadableStreamDisturbed
+FAIL IsReadableStreamDisturbed returns true for an errored stream on which cancel() has been called Can't find variable: IsReadableStreamDisturbed
+

Added: trunk/LayoutTests/streams/reference-implementation/abstract-ops.html (0 => 190317)


--- trunk/LayoutTests/streams/reference-implementation/abstract-ops.html	                        (rev 0)
+++ trunk/LayoutTests/streams/reference-implementation/abstract-ops.html	2015-09-29 18:24:06 UTC (rev 190317)
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<script src=''></script>
+<script src=''></script>
+<script src=''></script>
+<!-- FIXME: enable IsReadableStreamDisturbed -->
+<script>
+// This is updated till ec5ffa0 of the spec.
+
+test(function() {
+    var rs = new ReadableStream();
+
+    assert_false(IsReadableStreamDisturbed(rs), 'rs should not be disturbed on construction');
+
+    var reader = rs.getReader();
+    assert_false(IsReadableStreamDisturbed(rs), 'getReader() call has no effect on whether a stream is disturbed or not');
+
+    reader.read();
+    assert_true(IsReadableStreamDisturbed(rs), 'rs should be disturbed after read() call');
+}, 'IsReadableStreamDisturbed returns true for an empty non-closed stream on which read() has been called');
+
+test(function() {
+    var rs = new ReadableStream();
+
+    assert_false(IsReadableStreamDisturbed(rs), 'rs should not be disturbed on construction');
+
+    var reader = rs.getReader();
+    assert_false(IsReadableStreamDisturbed(rs), 'getReader() call has no effect on whether a stream is disturbed or not');
+
+    reader.cancel();
+    assert_true(IsReadableStreamDisturbed(rs), 'rs should be disturbed after cancel() call');
+}, 'IsReadableStreamDisturbed returns true for an empty non-closed stream on which cancel() has been called');
+
+test(function() {
+    var rs = new ReadableStream({
+        start: function(c) {
+            c.close();
+        }
+    });
+
+    assert_false(IsReadableStreamDisturbed(rs), 'rs should not be disturbed on construction');
+
+    var reader = rs.getReader();
+    assert_false(IsReadableStreamDisturbed(rs), 'getReader() call has no effect on whether a stream is disturbed or not');
+
+    reader.read();
+    assert_true(IsReadableStreamDisturbed(rs), 'rs should be disturbed after read() call');
+}, 'IsReadableStreamDisturbed returns true for a closed stream on which read() has been called');
+
+test(function() {
+    var rs = new ReadableStream({
+        start: function(c) {
+            c.close();
+        }
+    });
+
+    assert_false(IsReadableStreamDisturbed(rs), 'rs should not be disturbed on construction');
+
+    var reader = rs.getReader();
+    assert_false(IsReadableStreamDisturbed(rs), 'getReader() call has no effect on whether a stream is disturbed or not');
+
+    reader.cancel();
+    assert_true(IsReadableStreamDisturbed(rs), 'rs should be disturbed after cancel() call');
+}, 'IsReadableStreamDisturbed returns true for a closed stream on which cancel() has been called');
+
+test(function() {
+    var rs = new ReadableStream({
+        start: function(c) {
+            c.error(new Error('waffles'));
+        }
+    });
+
+    assert_false(IsReadableStreamDisturbed(rs), 'rs should not be disturbed on construction');
+
+    var reader = rs.getReader();
+    assert_false(IsReadableStreamDisturbed(rs), 'getReader() call has no effect on whether a stream is disturbed or not');
+
+    reader.read();
+    assert_true(IsReadableStreamDisturbed(rs), 'rs should be disturbed after read() call');
+}, 'IsReadableStreamDisturbed returns true for an errored stream on which read() has been called');
+
+test(function() {
+    var rs = new ReadableStream({
+        start: function(c) {
+            c.error(new Error('waffles'));
+        }
+    });
+
+    assert_false(IsReadableStreamDisturbed(rs), 'rs should not be disturbed on construction');
+
+    var reader = rs.getReader();
+    assert_false(IsReadableStreamDisturbed(rs), 'getReader() call has no effect on whether a stream is disturbed or not');
+
+    reader.cancel();
+    assert_true(IsReadableStreamDisturbed(rs), 'rs should be disturbed after cancel() call');
+}, 'IsReadableStreamDisturbed returns true for an errored stream on which cancel() has been called');
+</script>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to