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

Side by Side Diff: LayoutTests/http/tests/fetch/script-tests/stream-reader.js

Issue 1211623005: Unify multiple sequential_promise_test definitions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update fetch templates and remove new duplicate of this method Created 5 years, 6 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 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('/fetch/resources/fetch-test-helpers.js'); 2 importScripts('/fetch/resources/fetch-test-helpers.js');
3 } 3 }
4 4
5 function read_until_end(reader) { 5 function read_until_end(reader) {
6 var chunks = []; 6 var chunks = [];
7 function consume() { 7 function consume() {
8 return reader.read().then(function(r) { 8 return reader.read().then(function(r) {
9 if (r.done) { 9 if (r.done) {
10 return chunks; 10 return chunks;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 return p; 160 return p;
161 }).then(function(text) { 161 }).then(function(text) {
162 assert_equals(text.length, 190); 162 assert_equals(text.length, 190);
163 return stream.getReader().read(); 163 return stream.getReader().read();
164 }).then(function(r) { 164 }).then(function(r) {
165 assert_true(r.done); 165 assert_true(r.done);
166 assert_equals(r.value, undefined); 166 assert_equals(r.value, undefined);
167 }); 167 });
168 }, 'Accessing body when processing text().'); 168 }, 'Accessing body when processing text().');
169 169
170 sequential_promise_test_done();
171 done(); 170 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698