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