| OLD | NEW |
| 1 if (self.importScripts) { | 1 if (self.importScripts) { |
| 2 importScripts('/resources/testharness.js'); | 2 importScripts('/resources/testharness.js'); |
| 3 importScripts('/resources/testharness-helpers.js'); | 3 importScripts('/resources/testharness-helpers.js'); |
| 4 importScripts('../resources/test-helpers.js'); | 4 importScripts('../resources/test-helpers.js'); |
| 5 } | 5 } |
| 6 | 6 |
| 7 promise_test(function(t) { | 7 promise_test(function(t) { |
| 8 var cache_name = 'cache-storage/foo'; | 8 var cache_name = 'cache-storage/foo'; |
| 9 return self.caches.delete(cache_name) | 9 return self.caches.delete(cache_name) |
| 10 .then(function() { | 10 .then(function() { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 .then(function() { | 24 .then(function() { |
| 25 return self.caches.open(cache_name); | 25 return self.caches.open(cache_name); |
| 26 }) | 26 }) |
| 27 .then(function(cache) { | 27 .then(function(cache) { |
| 28 assert_true(cache instanceof Cache, | 28 assert_true(cache instanceof Cache, |
| 29 'CacheStorage.open should accept an empty name.'); | 29 'CacheStorage.open should accept an empty name.'); |
| 30 }); | 30 }); |
| 31 }, 'CacheStorage.open with an empty name'); | 31 }, 'CacheStorage.open with an empty name'); |
| 32 | 32 |
| 33 promise_test(function(t) { | 33 promise_test(function(t) { |
| 34 return assert_promise_rejects( | 34 return promise_rejects( |
| 35 t, |
| 36 new TypeError(), |
| 35 self.caches.open(), | 37 self.caches.open(), |
| 36 new TypeError(), | |
| 37 'CacheStorage.open should throw TypeError if called with no arguments.'); | 38 'CacheStorage.open should throw TypeError if called with no arguments.'); |
| 38 }, 'CacheStorage.open with no arguments'); | 39 }, 'CacheStorage.open with no arguments'); |
| 39 | 40 |
| 40 promise_test(function(t) { | 41 promise_test(function(t) { |
| 41 var test_cases = [ | 42 var test_cases = [ |
| 42 { | 43 { |
| 43 name: 'cache-storage/lowercase', | 44 name: 'cache-storage/lowercase', |
| 44 should_not_match: | 45 should_not_match: |
| 45 [ | 46 [ |
| 46 'cache-storage/Lowercase', | 47 'cache-storage/Lowercase', |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 'CacheStorage names should be not be converted.'); | 189 'CacheStorage names should be not be converted.'); |
| 189 }) | 190 }) |
| 190 .then(function() { return self.caches.has(converted_name); }) | 191 .then(function() { return self.caches.has(converted_name); }) |
| 191 .then(function(cache_exists) { | 192 .then(function(cache_exists) { |
| 192 assert_false(cache_exists, | 193 assert_false(cache_exists, |
| 193 'CacheStorage names should be not be converted.'); | 194 'CacheStorage names should be not be converted.'); |
| 194 }); | 195 }); |
| 195 }, 'CacheStorage names are DOMStrings not USVStrings'); | 196 }, 'CacheStorage names are DOMStrings not USVStrings'); |
| 196 | 197 |
| 197 done(); | 198 done(); |
| OLD | NEW |