OLD | NEW |
---|---|
1 if (self.importScripts) { | 1 if (self.importScripts) { |
2 importScripts('/resources/testharness.js'); | 2 importScripts('/resources/testharness.js'); |
3 importScripts('../resources/test-helpers.js'); | 3 importScripts('../resources/test-helpers.js'); |
4 } | 4 } |
5 | 5 |
6 cache_test(function(cache, test) { | 6 cache_test(function(cache, test) { |
7 return promise_rejects( | 7 return promise_rejects( |
8 test, | 8 test, |
9 new TypeError(), | 9 new TypeError(), |
10 cache.add(), | 10 cache.add(), |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 test, | 96 test, |
97 new TypeError(), | 97 new TypeError(), |
98 cache.add('../resources/fetch-status.php?status=500'), | 98 cache.add('../resources/fetch-status.php?status=500'), |
99 'Cache.add should reject if response is !ok'); | 99 'Cache.add should reject if response is !ok'); |
100 }, 'Cache.add with request that results in a status of 500'); | 100 }, 'Cache.add with request that results in a status of 500'); |
101 | 101 |
102 cache_test(function(cache, test) { | 102 cache_test(function(cache, test) { |
103 return promise_rejects( | 103 return promise_rejects( |
104 test, | 104 test, |
105 new TypeError(), | 105 new TypeError(), |
106 cache.add('../resources/fetch-status.php?status=206'), | |
107 'Cache.add should reject on partial response'); | |
108 }, 'Cache.add with request that results in a status of 206'); | |
109 | |
110 cache_test(function(cache, test) { | |
111 return promise_rejects( | |
112 test, | |
113 new TypeError(), | |
114 cache.addAll(['../resources/fetch-status.php?status=206']), | |
jkarlin
2016/08/02 13:47:51
Can you put two requests in the addAll, where the
jsbell
2016/08/02 19:54:10
Good idea - done!
(I didn't verify that the cache
| |
115 'Cache.addAll should reject on partial response'); | |
116 }, 'Cache.addAll with request that results in a status of 206'); | |
117 | |
118 cache_test(function(cache, test) { | |
119 return promise_rejects( | |
120 test, | |
121 new TypeError(), | |
106 cache.addAll(), | 122 cache.addAll(), |
107 'Cache.addAll with no arguments should throw TypeError.'); | 123 'Cache.addAll with no arguments should throw TypeError.'); |
108 }, 'Cache.addAll with no arguments'); | 124 }, 'Cache.addAll with no arguments'); |
109 | 125 |
110 cache_test(function(cache, test) { | 126 cache_test(function(cache, test) { |
111 // Assumes the existence of ../resources/simple.txt and ../resources/blank.h tml | 127 // Assumes the existence of ../resources/simple.txt and ../resources/blank.h tml |
112 var urls = ['../resources/simple.txt', undefined, '../resources/blank.html'] ; | 128 var urls = ['../resources/simple.txt', undefined, '../resources/blank.html'] ; |
113 return promise_rejects( | 129 return promise_rejects( |
114 test, | 130 test, |
115 new TypeError(), | 131 new TypeError(), |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 var request = new Request('../resources/simple.txt'); | 255 var request = new Request('../resources/simple.txt'); |
240 return promise_rejects( | 256 return promise_rejects( |
241 test, | 257 test, |
242 'InvalidStateError', | 258 'InvalidStateError', |
243 cache.addAll([request, request]), | 259 cache.addAll([request, request]), |
244 'Cache.addAll should throw InvalidStateError if the same request is added ' + | 260 'Cache.addAll should throw InvalidStateError if the same request is added ' + |
245 'twice.'); | 261 'twice.'); |
246 }, 'Cache.addAll called with the same Request object specified twice'); | 262 }, 'Cache.addAll called with the same Request object specified twice'); |
247 | 263 |
248 done(); | 264 done(); |
OLD | NEW |