OLD | NEW |
1 importScripts('worker-testharness.js'); | 1 if (self.importScripts) { |
2 importScripts('/resources/testharness-helpers.js'); | 2 importScripts('/resources/testharness.js'); |
| 3 importScripts('/resources/testharness-helpers.js'); |
| 4 importScripts('../resources/test-helpers.js'); |
| 5 } |
3 | 6 |
4 var test_url = 'https://example.com/foo'; | 7 var test_url = 'https://example.com/foo'; |
5 | 8 |
6 // Construct a generic Request object. The URL is |test_url|. All other fields | 9 // Construct a generic Request object. The URL is |test_url|. All other fields |
7 // are defaults. | 10 // are defaults. |
8 function new_test_request() { | 11 function new_test_request() { |
9 return new Request(test_url); | 12 return new Request(test_url); |
10 } | 13 } |
11 | 14 |
12 // Construct a generic Response object. | 15 // Construct a generic Response object. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 cache_test(function(cache) { | 110 cache_test(function(cache) { |
108 return Promise.all(Object.keys(cache_entries).map(function(k) { | 111 return Promise.all(Object.keys(cache_entries).map(function(k) { |
109 return cache.put(cache_entries[k].request.clone(), | 112 return cache.put(cache_entries[k].request.clone(), |
110 cache_entries[k].response.clone()); | 113 cache_entries[k].response.clone()); |
111 })) | 114 })) |
112 .then(function() { | 115 .then(function() { |
113 return test_function(cache); | 116 return test_function(cache); |
114 }); | 117 }); |
115 }, description); | 118 }, description); |
116 } | 119 } |
| 120 |
| 121 done(); |
OLD | NEW |