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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/streams/readable-streams/general.js

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 'use strict'; 1 'use strict';
2 2
3 if (self.importScripts) { 3 if (self.importScripts) {
4 self.importScripts('../resources/test-utils.js'); 4 self.importScripts('../resources/test-utils.js');
5 self.importScripts('../resources/rs-utils.js'); 5 self.importScripts('../resources/rs-utils.js');
6 self.importScripts('/resources/testharness.js'); 6 self.importScripts('/resources/testharness.js');
7 } 7 }
8 8
9 test(() => { 9 test(() => {
10 10
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 rs.cancel(); 726 rs.cancel();
727 assert_equals(startCalled, 1); 727 assert_equals(startCalled, 1);
728 assert_equals(pullCalled, 1); 728 assert_equals(pullCalled, 1);
729 assert_equals(cancelCalled, 1); 729 assert_equals(cancelCalled, 1);
730 return rs.getReader().closed; 730 return rs.getReader().closed;
731 }); 731 });
732 732
733 }, 'ReadableStream: should call underlying source methods as methods'); 733 }, 'ReadableStream: should call underlying source methods as methods');
734 734
735 test(() => { 735 test(() => {
736 const rs = new ReadableStream({
737 start(c) {
738 assert_equals(c.desiredSize, 10, 'desiredSize must start at highWaterMark' );
739 c.close();
740 assert_equals(c.desiredSize, 0, 'after closing, desiredSize must be 0');
741 }
742 }, {
743 highWaterMark: 10
744 });
745 }, 'ReadableStream: desiredSize when closed');
746
747 test(() => {
748 const rs = new ReadableStream({
749 start(c) {
750 assert_equals(c.desiredSize, 10, 'desiredSize must start at highWaterMark' );
751 c.error();
752 assert_equals(c.desiredSize, null, 'after erroring, desiredSize must be nu ll');
753 }
754 }, {
755 highWaterMark: 10
756 });
757 }, 'ReadableStream: desiredSize when errored');
758
759 test(() => {
736 760
737 let startCalled = false; 761 let startCalled = false;
738 new ReadableStream({ 762 new ReadableStream({
739 start(c) { 763 start(c) {
740 assert_equals(c.desiredSize, 1); 764 assert_equals(c.desiredSize, 1);
741 c.enqueue('a'); 765 c.enqueue('a');
742 assert_equals(c.desiredSize, 0); 766 assert_equals(c.desiredSize, 0);
743 c.enqueue('b'); 767 c.enqueue('b');
744 assert_equals(c.desiredSize, -1); 768 assert_equals(c.desiredSize, -1);
745 c.enqueue('c'); 769 c.enqueue('c');
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 const rs = sequentialReadableStream(10, { async: true }); 874 const rs = sequentialReadableStream(10, { async: true });
851 875
852 return readableStreamToArray(rs).then(chunks => { 876 return readableStreamToArray(rs).then(chunks => {
853 assert_true(rs.source.closed, 'source should be closed after all chunks are read'); 877 assert_true(rs.source.closed, 'source should be closed after all chunks are read');
854 assert_array_equals(chunks, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'the expected 1 0 chunks should be read'); 878 assert_array_equals(chunks, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 'the expected 1 0 chunks should be read');
855 }); 879 });
856 880
857 }, 'ReadableStream integration test: adapting an async pull source'); 881 }, 'ReadableStream integration test: adapting an async pull source');
858 882
859 done(); 883 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698