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

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

Issue 1926813004: Replace assert_promise_rejects with upstream promise_rejects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove all testharness-helpers.js references Created 4 years, 7 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 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return cache.matchAll(entries.a_with_query.request, 106 return cache.matchAll(entries.a_with_query.request,
107 { ignoreSearch: true }); 107 { ignoreSearch: true });
108 }) 108 })
109 .then(function(result) { 109 .then(function(result) {
110 assert_response_array_equivalent(result, [ entries.a.response ]); 110 assert_response_array_equivalent(result, [ entries.a.response ]);
111 }); 111 });
112 }, 112 },
113 'Cache.delete with ignoreSearch option (when it is specified as false)'); 113 'Cache.delete with ignoreSearch option (when it is specified as false)');
114 114
115 done(); 115 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698