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

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

Issue 2204573002: Cache API should reject 206 Partial Responses (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Give addAll a working resource, to show the whole shebang fails Created 4 years, 4 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 1dd3f4fba405d1b52ae3f290da4d6807c50fdbdf..1517f945a088da7ef2f045bb97e8a8171d8f4a75 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
@@ -128,6 +128,19 @@ cache_test(function(cache) {
});
}, 'Cache.put with HTTP 500 response');
+cache_test(function(cache, test) {
+ var test_url = new URL('../resources/fetch-status.php?status=206', location.href).href;
+ var request = new Request(test_url);
+ var response;
+ return fetch(test_url)
+ .then(function(fetch_result) {
+ assert_equals(fetch_result.status, 206,
+ 'Test framework error: The status code should be 206.');
+ response = fetch_result.clone();
+ return promise_rejects(test, new TypeError, cache.put(request, fetch_result));
+ });
+ }, 'Cache.put with HTTP 206 response');
+
cache_test(function(cache) {
var alternate_response_body = 'New body';
var alternate_response = new Response(alternate_response_body,

Powered by Google App Engine
This is Rietveld 408576698