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

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

Issue 2161423003: CacheStorage: caches.match with bad cacheName should resolve with undefined. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('/resources/testharness.js'); 2 importScripts('/resources/testharness.js');
3 importScripts('../resources/test-helpers.js'); 3 importScripts('../resources/test-helpers.js');
4 } 4 }
5 5
6 (function() { 6 (function() {
7 var next_index = 1; 7 var next_index = 1;
8 8
9 // Returns a transaction (request, response, and url) for a unique URL. 9 // Returns a transaction (request, response, and url) for a unique URL.
10 function create_unique_transaction(test) { 10 function create_unique_transaction(test) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 }, 'CacheStorageMatch with no cached entry'); 103 }, 'CacheStorageMatch with no cached entry');
104 104
105 promise_test(function(test) { 105 promise_test(function(test) {
106 var transaction = create_unique_transaction(); 106 var transaction = create_unique_transaction();
107 return self.caches.has('foo') 107 return self.caches.has('foo')
108 .then(function(has_foo) { 108 .then(function(has_foo) {
109 assert_false(has_foo, "The cache should not exist."); 109 assert_false(has_foo, "The cache should not exist.");
110 return self.caches.match(transaction.request, {cacheName: 'foo'}); 110 return self.caches.match(transaction.request, {cacheName: 'foo'});
111 }) 111 })
112 .then(function(response) { 112 .then(function(response) {
113 assert_unreached('The match with bad cache name should reject.'); 113 assert_equals(response, undefined,
114 }) 114 'The match with bad cache name should resolve to ' +
115 .catch(function(err) { 115 'undefined.');
116 assert_equals(err.name, 'NotFoundError',
117 'The match should reject with NotFoundError.');
118 return self.caches.has('foo'); 116 return self.caches.has('foo');
119 }) 117 })
120 .then(function(has_foo) { 118 .then(function(has_foo) {
121 assert_false(has_foo, "The cache should still not exist."); 119 assert_false(has_foo, "The cache should still not exist.");
122 }) 120 })
123 }, 'CacheStorageMatch with no caches available but name provided'); 121 }, 'CacheStorageMatch with no caches available but name provided');
124 122
125 done(); 123 done();
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698