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

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

Issue 2790143003: Cache Storage API tests: Fix WPT test bugs, remove redundant local copies (Closed)
Patch Set: Created 3 years, 8 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
(Empty)
1 if (self.importScripts) {
2 importScripts('/resources/testharness.js');
3 importScripts('../resources/test-helpers.js');
4 }
5
6 var test_cache_list =
7 ['', 'example', 'Another cache name', 'A', 'a', 'ex ample'];
8
9 promise_test(function(test) {
10 return self.caches.keys()
11 .then(function(keys) {
12 assert_true(Array.isArray(keys),
13 'CacheStorage.keys should return an Array.');
14 return Promise.all(keys.map(function(key) {
15 return self.caches.delete(key);
16 }));
17 })
18 .then(function() {
19 return Promise.all(test_cache_list.map(function(key) {
20 return self.caches.open(key);
21 }));
22 })
23
24 .then(function() { return self.caches.keys(); })
25 .then(function(keys) {
26 assert_true(Array.isArray(keys),
27 'CacheStorage.keys should return an Array.');
28 assert_array_equals(keys,
29 test_cache_list,
30 'CacheStorage.keys should only return ' +
31 'existing caches.');
32 });
33 }, 'CacheStorage keys');
34
35 done();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698