1 if (self
.importScripts
) {
2 importScripts('/resources/testharness.js');
3 importScripts('/resources/testharness-helpers.js');
4 importScripts('../resources/test-helpers.js');
8 ['', 'example', 'Another cache name', 'A', 'a', 'ex ample'];
10 promise_test(function(test
) {
11 return self
.caches
.keys()
12 .then(function(keys
) {
13 assert_true(Array
.isArray(keys
),
14 'CacheStorage.keys should return an Array.');
15 return Promise
.all(keys
.map(function(key
) {
16 return self
.caches
.delete(key
);
20 return Promise
.all(test_cache_list
.map(function(key
) {
21 return self
.caches
.open(key
);
25 .then(function() { return self
.caches
.keys(); })
26 .then(function(keys
) {
27 assert_true(Array
.isArray(keys
),
28 'CacheStorage.keys should return an Array.');
29 assert_array_equals(keys
,
31 'CacheStorage.keys should only return ' +
34 }, 'CacheStorage keys');