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

Unified Diff: LayoutTests/http/tests/serviceworker/resources/cache-match-worker.js

Issue 708703002: Service Worker: Cache.put() consumes request/response bodies (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use Response bodies too, but only Request bodies if non-empty Created 6 years, 1 month 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: LayoutTests/http/tests/serviceworker/resources/cache-match-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/resources/cache-match-worker.js b/LayoutTests/http/tests/serviceworker/resources/cache-match-worker.js
index e47827a63d6e5a116ddcb5f0f9cfcf76ef0b9bbf..f0f3aa9d1c3876380e1ae798a01e9d8b6bf08746 100644
--- a/LayoutTests/http/tests/serviceworker/resources/cache-match-worker.js
+++ b/LayoutTests/http/tests/serviceworker/resources/cache-match-worker.js
@@ -338,7 +338,7 @@ cache_test(function(cache) {
response.url, request_url,
'[https://fetch.spec.whatwg.org/#dom-response-url] ' +
'Reponse.url should return the URL of the response.');
- return cache.put(request, response);
+ return cache.put(request, response.clone());
})
.then(function() {
return cache.match(request.url);
@@ -398,7 +398,8 @@ cache_test(function(cache) {
function prepopulated_cache_test(entries, test_function, description) {
cache_test(function(cache) {
return Promise.all(Object.keys(entries).map(function(k) {
- return cache.put(entries[k].request, entries[k].response);
+ return cache.put(entries[k].request.clone(),
+ entries[k].response.clone());
}))
.catch(function(reason) {
assert_unreached('Test setup failed: ' + reason.message);

Powered by Google App Engine
This is Rietveld 408576698