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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-put.js

Issue 1418813004: [Fetch API] Reflect spec changes of bodyUsed property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-put.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-put.js b/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-put.js
index 6389b60fd6ef15fe49200ebfa66546a35b34d5e1..4d045c45366ae76d943d52c9d241d30a797427b3 100644
--- a/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-put.js
+++ b/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-put.js
@@ -283,11 +283,14 @@ cache_test(function(cache) {
'[https://fetch.spec.whatwg.org/#dom-body-bodyused] ' +
'Response.bodyUsed should be initially false.');
return response.text().then(function() {
- assert_false(
+ assert_true(
response.bodyUsed,
'[https://fetch.spec.whatwg.org/#concept-body-consume-body] ' +
- 'The text() method should not set "body passed" flag.');
- return cache.put(new Request(test_url), response);
+ 'The text() method should make the body disturbed.');
+ var request = new Request(test_url);
+ return cache.put(request, response).then(() => {
+ assert_unreached('cache.put should be rejected');
+ }, () => {});
});
}, 'Cache.put with a used response body');
@@ -295,7 +298,7 @@ cache_test(function(cache) {
var response = new Response(test_body);
return cache.put(new Request(test_url), response)
.then(function() {
- return response.body.getReader().closed;
+ assert_throws(new TypeError(), () => response.body.getReader());
});
}, 'getReader() after Cache.put');

Powered by Google App Engine
This is Rietveld 408576698