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

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

Issue 430993002: [ServiceWorker] CacheStorage tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo and formatting Created 6 years, 4 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-test-harness.js');
2
3 var test_cache_list = ['enum-1', 'enum-2', 'enum-3'];
dominicc (has gone to gerrit) 2014/08/11 01:57:36 Is it worth including interesting names like empty
asanka 2014/08/13 01:22:51 Added some variants. It shouldn't hurt, but the re
4
5 promise_test(function(test) {
6 return caches.keys()
7 .then(test.step_func(function(keys) {
8 assert_equals(keys.length,
9 0,
10 'CacheStorage.keys should return an empty list for ' +
11 'a new ServiceWorker.');
12 }))
13
14 .then(function() {
15 return Promise.all(test_cache_list.map(function(key) {
16 return caches.create(key);
17 }));
18 })
19
20 .then(function() { return caches.keys(); })
21 .then(test.step_func(function(keys) {
22 assert_true(Array.isArray(keys),
23 'CacheStorage.keys should return an Array.');
24 assert_array_equals(keys,
25 test_cache_list,
26 'CacheStorage.keys should only return ' +
27 'existing caches');
dominicc (has gone to gerrit) 2014/08/11 01:57:36 There's inconsistency about ending with a period.
asanka 2014/08/13 01:22:51 I added a '.'. The string put together by the test
28 }));
29 }, 'CacheStorage keys');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698