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

Side by Side Diff: LayoutTests/http/tests/serviceworker/resources/cache-storage-keys-worker.js

Issue 638023003: [ServiceWorkerCacheStorage] Blink changes to remove create/get and add open function (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 2 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 | LayoutTests/http/tests/serviceworker/resources/cache-storage-worker.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 importScripts('worker-testharness.js'); 1 importScripts('worker-testharness.js');
2 importScripts('../../resources/testharness-helpers.js'); 2 importScripts('../../resources/testharness-helpers.js');
3 3
4 var test_cache_list = 4 var test_cache_list =
5 ['', 'example', 'Another cache name', 'A', 'a', 'ex ample']; 5 ['', 'example', 'Another cache name', 'A', 'a', 'ex ample'];
6 6
7 promise_test(function(test) { 7 promise_test(function(test) {
8 return self.caches.keys() 8 return self.caches.keys()
9 .then(function(keys) { 9 .then(function(keys) {
10 assert_true(Array.isArray(keys), 10 assert_true(Array.isArray(keys),
11 'CacheStorage.keys should return an Array.'); 11 'CacheStorage.keys should return an Array.');
12 return Promise.all(keys.map(function(key) { 12 return Promise.all(keys.map(function(key) {
13 return self.caches.delete(key); 13 return self.caches.delete(key);
14 })); 14 }));
15 }) 15 })
16 .then(function() { 16 .then(function() {
17 return Promise.all(test_cache_list.map(function(key) { 17 return Promise.all(test_cache_list.map(function(key) {
18 return self.caches.create(key); 18 return self.caches.open(key);
19 })); 19 }));
20 }) 20 })
21 21
22 .then(function() { return self.caches.keys(); }) 22 .then(function() { return self.caches.keys(); })
23 .then(function(keys) { 23 .then(function(keys) {
24 assert_true(Array.isArray(keys), 24 assert_true(Array.isArray(keys),
25 'CacheStorage.keys should return an Array.'); 25 'CacheStorage.keys should return an Array.');
26 assert_array_equals(keys, 26 assert_array_equals(keys,
27 test_cache_list, 27 test_cache_list,
28 'CacheStorage.keys should only return ' + 28 'CacheStorage.keys should only return ' +
29 'existing caches.'); 29 'existing caches.');
30 }); 30 });
31 }, 'CacheStorage keys'); 31 }, 'CacheStorage keys');
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/resources/cache-storage-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698