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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/resources/response-stream-abort.js

Issue 795463006: Rename ReadableStream.wait() to ReadableStream.ready. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 var global = this; 1 var global = this;
2 if (global.importScripts) { 2 if (global.importScripts) {
3 // Worker case 3 // Worker case
4 importScripts('/resources/testharness.js'); 4 importScripts('/resources/testharness.js');
5 } 5 }
6 6
7 var testInLoadingState = async_test('Test aborting XMLHttpRequest with responseT ype set to "stream" in LOADING state.'); 7 var testInLoadingState = async_test('Test aborting XMLHttpRequest with responseT ype set to "stream" in LOADING state.');
8 8
9 testInLoadingState.step(function() 9 testInLoadingState.step(function()
10 { 10 {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 }); 53 });
54 54
55 xhr.open('GET', '/resources/test.ogv', true); 55 xhr.open('GET', '/resources/test.ogv', true);
56 xhr.send(); 56 xhr.send();
57 }); 57 });
58 58
59 var testInDoneState = async_test('Test aborting XMLHttpRequest with responseType set to "stream" in DONE state.'); 59 var testInDoneState = async_test('Test aborting XMLHttpRequest with responseType set to "stream" in DONE state.');
60 60
61 function readUntilDone(stream) { 61 function readUntilDone(stream) {
62 return stream.wait().then(function() { 62 return stream.ready.then(function() {
63 while (stream.state == 'readable') { 63 while (stream.state == 'readable') {
64 stream.read(); 64 stream.read();
65 } 65 }
66 if (stream.state == 'closed' || stream.state == 'errored') { 66 if (stream.state == 'closed' || stream.state == 'errored') {
67 return stream.closed; 67 return stream.closed;
68 } else { 68 } else {
69 return readUntilDone(stream); 69 return readUntilDone(stream);
70 } 70 }
71 }); 71 });
72 } 72 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 }); 124 });
125 125
126 xhr.open('GET', '/resources/test.ogv', true); 126 xhr.open('GET', '/resources/test.ogv', true);
127 xhr.send(); 127 xhr.send();
128 }); 128 });
129 129
130 if (global.importScripts) { 130 if (global.importScripts) {
131 // Worker case 131 // Worker case
132 done(); 132 done();
133 } 133 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/xmlhttprequest/resources/response-stream.js ('k') | Source/core/streams/ReadableStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698