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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/resources/response-stream-orphaned-promise.js

Issue 1181973005: [XHR] Fix a XHR-stream test script. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/resources/slow-failure.cgi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/xmlhttprequest/resources/response-stream-orphaned-promise.js
diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/response-stream-orphaned-promise.js b/LayoutTests/http/tests/xmlhttprequest/resources/response-stream-orphaned-promise.js
index ddb9f8c89b0bf87d1f066f9fa4f214b82e27e886..9bbdb7fc5e1c8a6648c02113d74e17931740b4e4 100644
--- a/LayoutTests/http/tests/xmlhttprequest/resources/response-stream-orphaned-promise.js
+++ b/LayoutTests/http/tests/xmlhttprequest/resources/response-stream-orphaned-promise.js
@@ -13,8 +13,6 @@ function fetchBody(url) {
if (xhr.readyState !== xhr.LOADING || visited)
return;
visited = true;
- // Note that all provided urls have empty bodies, so
- // we don't have to read the data.
xhr.response.getReader().closed.then(resolve, reject);
};
xhr.open('GET', url);
@@ -23,11 +21,15 @@ function fetchBody(url) {
}
promise_test(function() {
+ // slow-empty-response.cgi has an empty body, so we can assume that the
+ // closed promise will be resolved without reading data.
var url = '/xmlhttprequest/resources/slow-empty-response.cgi';
return fetchBody(url);
}, 'check if |closed| gets resolved without stream reference');
promise_test(function() {
+ // alow-failure.cgi will output an error after outputting a few valid
+ // chunks, so we will see a rejection.
var url = '/xmlhttprequest/resources/slow-failure.cgi';
return fetchBody(url).then(function() {
assert_unreached('resolved unexpectedly');
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/resources/slow-failure.cgi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698