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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/script-tests/cache-put.js

Issue 2790143003: Cache Storage API tests: Fix WPT test bugs, remove redundant local copies (Closed)
Patch Set: Created 3 years, 9 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/external/wpt/service-workers/cache-storage/script-tests/cache-put.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/script-tests/cache-put.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/script-tests/cache-put.js
index 9e9fd67a3fe917f9291f0157eba0ba6c49893283..467e0b38e9c379c55137b1d7749b2e6efb10e9e5 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/script-tests/cache-put.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/script-tests/cache-put.js
@@ -102,18 +102,32 @@ cache_test(function(cache) {
});
}, 'Cache.put with an empty response body');
-cache_test(function(cache) {
+cache_test(function(cache, test) {
var request = new Request(test_url);
var response = new Response('', {
status: 206,
headers: [['Content-Type', 'text/plain']]
});
- return assert_promise_rejects(
- cache.put(request, response),
+ return promise_rejects(
+ test,
new TypeError(),
+ cache.put(request, response),
'Cache.put should reject 206 Responses with a TypeError.');
- }, 'Cache.put with 206 response');
+ }, 'Cache.put with synthetic 206 response');
+
+cache_test(function(cache, test) {
+ var test_url = new URL('../resources/fetch-status.py?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 test_url = new URL('../resources/fetch-status.py?status=500', location.href).href;

Powered by Google App Engine
This is Rietveld 408576698