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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/cache-storage/script-tests/cache-delete.js

Issue 2547023002: Import wpt@3c8896ae408c8fd594979da7c99970029e7856a7 (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 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');
4 importScripts('../resources/test-helpers.js'); 3 importScripts('../resources/test-helpers.js');
5 } 4 }
6 5
7 var test_url = 'https://example.com/foo'; 6 var test_url = 'https://example.com/foo';
8 7
9 // Construct a generic Request object. The URL is |test_url|. All other fields 8 // Construct a generic Request object. The URL is |test_url|. All other fields
10 // are defaults. 9 // are defaults.
11 function new_test_request() { 10 function new_test_request() {
12 return new Request(test_url); 11 return new Request(test_url);
13 } 12 }
14 13
15 // Construct a generic Response object. 14 // Construct a generic Response object.
16 function new_test_response() { 15 function new_test_response() {
17 return new Response('Hello world!', { status: 200 }); 16 return new Response('Hello world!', { status: 200 });
18 } 17 }
19 18
20 cache_test(function(cache) { 19 cache_test(function(cache, test) {
21 return assert_promise_rejects( 20 return promise_rejects(
21 test,
22 new TypeError(),
22 cache.delete(), 23 cache.delete(),
23 new TypeError(),
24 'Cache.delete should reject with a TypeError when called with no ' + 24 'Cache.delete should reject with a TypeError when called with no ' +
25 'arguments.'); 25 'arguments.');
26 }, 'Cache.delete with no arguments'); 26 }, 'Cache.delete with no arguments');
27 27
28 cache_test(function(cache) { 28 cache_test(function(cache) {
29 return cache.put(new_test_request(), new_test_response()) 29 return cache.put(new_test_request(), new_test_response())
30 .then(function() { 30 .then(function() {
31 return cache.delete(test_url); 31 return cache.delete(test_url);
32 }) 32 })
33 .then(function(result) { 33 .then(function(result) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return cache.put(cache_entries[k].request.clone(), 87 return cache.put(cache_entries[k].request.clone(),
88 cache_entries[k].response.clone()); 88 cache_entries[k].response.clone());
89 })) 89 }))
90 .then(function() { 90 .then(function() {
91 return test_function(cache); 91 return test_function(cache);
92 }); 92 });
93 }, description); 93 }, description);
94 } 94 }
95 95
96 done(); 96 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698