OLD | NEW |
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 Loading... |
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(); |
OLD | NEW |