Chromium Code Reviews| OLD | NEW |
|---|---|
| (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'); | |
| OLD | NEW |