From c22efdd566c99d34e9476f52aa3dfbad456af86b Mon Sep 17 00:00:00 2001 From: "youenn.fablet@crf.canon.fr" Date: Fri, 10 Jul 2015 06:05:45 +0000 Subject: [PATCH] [Streams API] Fix readable-stream-tee.html https://bugs.webkit.org/show_bug.cgi?id=146803 Reviewed by Darin Adler. * streams/reference-implementation/readable-stream-tee.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@186667 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 9 +++++++++ .../readable-stream-tee.html | 13 +++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 0588b518ba41..7849e38b4017 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,12 @@ +2015-07-09 Youenn Fablet + + [Streams API] Fix readable-stream-tee.html + https://bugs.webkit.org/show_bug.cgi?id=146803 + + Reviewed by Darin Adler. + + * streams/reference-implementation/readable-stream-tee.html: + 2015-07-09 Daniel Bates Fetching Content Security Policy report URL should respect same origin policy diff --git a/LayoutTests/streams/reference-implementation/readable-stream-tee.html b/LayoutTests/streams/reference-implementation/readable-stream-tee.html index dda69d29309d..14cb0ad02c87 100644 --- a/LayoutTests/streams/reference-implementation/readable-stream-tee.html +++ b/LayoutTests/streams/reference-implementation/readable-stream-tee.html @@ -162,7 +162,7 @@ test4.step(function() { assert_array_equals(chunks, [], 'branch1 should have no chunks'); branch1Read = true; })); - + readableStreamToArray(branch2).then(test4.step_func(function(chunks) { assert_array_equals(chunks, ['a', 'b'], 'branch2 should have two chunks'); assert_true(branch1Read); @@ -203,10 +203,10 @@ test6.step(function() { var reason2 = new Error('I have the death sentence on twelve systems.'); var rs = new ReadableStream({ - cancel: function(reason) { + cancel: test6.step_func(function(reason) { assert_array_equals(reason, [reason1, reason2], 'the cancel reason should be an array containing those from the branches'); test6.done(); - } + }) }); var branch = rs.tee(); @@ -218,7 +218,7 @@ test6.step(function() { var test7 = async_test('ReadableStream teeing: failing to cancel the original stream should cause cancel() to reject on branches'); test7.step(function() { - var cancel1Rejected = false; + var cancelRejected = false; var theError = new Error('I\'ll be careful.'); var rs = new ReadableStream({ cancel: function() { @@ -231,11 +231,12 @@ test7.step(function() { var branch2 = branch[1]; branch1.cancel().catch(test7.step_func(function(e) { assert_equals(e, theError, 'branch1.cancel() should reject with the error'); - cancel1Rejected = true; + cancelRejected = true; + test7.done(); })); branch2.cancel().catch(test7.step_func(function(e) { assert_equals(e, theError, 'branch2.cancel() should reject with the error'); - assert_true(cancel1Rejected); + assert_true(cancelRejected); test7.done(); })); }); -- 2.36.0