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

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

Issue 1043213003: Remove redundant serviceworker/cache-* tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-add fetch-status.php, used by fetch tests in sibling dir Created 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 importScripts('worker-testharness.js');
2 importScripts('../../resources/testharness-helpers.js');
3 importScripts('override_assert_object_equals.js');
4
5 var test_cache_list =
6 ['', 'example', 'Another cache name', 'A', 'a', 'ex ample'];
7
8 promise_test(function(test) {
9 return self.caches.keys()
10 .then(function(keys) {
11 assert_true(Array.isArray(keys),
12 'CacheStorage.keys should return an Array.');
13 return Promise.all(keys.map(function(key) {
14 return self.caches.delete(key);
15 }));
16 })
17 .then(function() {
18 return Promise.all(test_cache_list.map(function(key) {
19 return self.caches.open(key);
20 }));
21 })
22
23 .then(function() { return self.caches.keys(); })
24 .then(function(keys) {
25 assert_true(Array.isArray(keys),
26 'CacheStorage.keys should return an Array.');
27 assert_array_equals(keys,
28 test_cache_list,
29 'CacheStorage.keys should only return ' +
30 'existing caches.');
31 });
32 }, 'CacheStorage keys');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698