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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js

Issue 1920703002: [Fetch API] Fix leaky layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js
index 5ffd8d9d88b1c1cebc462861333f87af9d9a373f..3b0d513e9f905b7fea0ef923fa13673c2716448b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js
+++ b/third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js
@@ -11,6 +11,7 @@ promise_test(function(t) {
reader.releaseLock();
var another = stream.getReader();
assert_not_equals(another, reader);
+ another.releaseLock();
});
}, 'ReadableStreamReader acquisition / releasing');
@@ -40,12 +41,14 @@ promise_test(function(t) {
return fetch('/fetch/resources/progressive.php').then(function(res) {
assert_false(res.bodyUsed);
var reader = res.body.getReader();
- assert_true(res.bodyUsed);
- return res.text();
- }).then(unreached_rejection(t), function() {
- // text() should fail because bodyUsed is set.
+ assert_false(res.bodyUsed);
+ return res.text().then(unreached_fulfillment(t), function() {
+ // text() should fail because the body is locked.
+ // TODO(yhirano): Use finally once it gets available.
+ reader.releaseLock();
+ });
});
- }, 'acquiring a reader should set bodyUsed.');
+ }, 'acquiring a reader should not set bodyUsed.');
promise_test(function(t) {
var reader;
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/response.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698