+2015-07-09 Youenn Fablet <youenn.fablet@crf.canon.fr>
+
+ [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 <dabates@apple.com>
Fetching Content Security Policy report URL should respect same origin policy
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);
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();
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() {
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();
}));
});