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

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

Issue 1485283002: Sync Cache API tests w/ web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('/resources/testharness.js'); 2 importScripts('/resources/testharness.js');
3 importScripts('/resources/testharness-helpers.js'); 3 importScripts('/resources/testharness-helpers.js');
4 importScripts('../resources/test-helpers.js'); 4 importScripts('../resources/test-helpers.js');
5 } 5 }
6 6
7 var test_url = 'https://example.com/foo'; 7 var test_url = 'https://example.com/foo';
8 var test_body = 'Hello world!'; 8 var test_body = 'Hello world!';
9 9
10 cache_test(function(cache) { 10 cache_test(function(cache) {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 }, 'Cache.put with a used response body'); 295 }, 'Cache.put with a used response body');
296 296
297 cache_test(function(cache) { 297 cache_test(function(cache) {
298 var response = new Response(test_body); 298 var response = new Response(test_body);
299 return cache.put(new Request(test_url), response) 299 return cache.put(new Request(test_url), response)
300 .then(function() { 300 .then(function() {
301 assert_throws(new TypeError(), () => response.body.getReader()); 301 assert_throws(new TypeError(), () => response.body.getReader());
302 }); 302 });
303 }, 'getReader() after Cache.put'); 303 }, 'getReader() after Cache.put');
304 304
305 cache_test(function(cache) {
306 return assert_promise_rejects(
307 cache.put(new Request(test_url),
308 new Response(test_body, { headers: { VARY: '*' }})),
309 new TypeError(),
310 'Cache.put should reject VARY:* Responses with a TypeError.');
311 }, 'Cache.put with a VARY:* Response');
312
313 cache_test(function(cache) {
314 return assert_promise_rejects(
315 cache.put(new Request(test_url),
316 new Response(test_body,
317 { headers: { VARY: 'Accept-Language,*' }})),
318 new TypeError(),
319 'Cache.put should reject Responses with an embedded VARY:* with a ' +
320 'TypeError.');
321 }, 'Cache.put with an embedded VARY:* Response');
322
305 done(); 323 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698