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>