OLD | NEW |
1 if ('ServiceWorkerGlobalScope' in self && | 1 if ('ServiceWorkerGlobalScope' in self && |
2 self instanceof ServiceWorkerGlobalScope) { | 2 self instanceof ServiceWorkerGlobalScope) { |
3 // ServiceWorker case | 3 // ServiceWorker case |
4 importScripts('/serviceworker/resources/worker-testharness.js'); | 4 importScripts('/serviceworker/resources/worker-testharness.js'); |
5 importScripts('/serviceworker/resources/test-helpers.js'); | 5 importScripts('/serviceworker/resources/test-helpers.js'); |
6 importScripts('/serviceworker/resources/fetch-test-options.js'); | 6 importScripts('/serviceworker/resources/fetch-test-options.js'); |
7 } else if (self.importScripts) { | 7 } else if (self.importScripts) { |
8 // Other workers cases | 8 // Other workers cases |
9 importScripts('/resources/testharness.js'); | 9 importScripts('/resources/testharness.js'); |
10 importScripts('/serviceworker/resources/test-helpers.js'); | 10 importScripts('/serviceworker/resources/test-helpers.js'); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 var VALID_REASON_PHRASE = [ | 175 var VALID_REASON_PHRASE = [ |
176 '\t', ' ', '"', '(', ')', ',', '/', ':', ';', '<', '=', '>', '?', '@', '[', | 176 '\t', ' ', '"', '(', ')', ',', '/', ':', ';', '<', '=', '>', '?', '@', '[', |
177 '\\', ']', '{', '}', | 177 '\\', ']', '{', '}', |
178 '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~', | 178 '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~', |
179 // non-CHAR | 179 // non-CHAR |
180 '\x80', '\xff', | 180 '\x80', '\xff', |
181 // Valid strings. | 181 // Valid strings. |
182 '', '0123456789', '404 Not Found', 'HTTP/1.1 404 Not Found', 'AZ\u00ffaz', | 182 '', '0123456789', '404 Not Found', 'HTTP/1.1 404 Not Found', 'AZ\u00ffaz', |
183 'x'.repeat(100000)]; | 183 'x'.repeat(100000)]; |
184 | 184 |
| 185 var INVALID_URLS = |
| 186 ['http://', |
| 187 'https://', |
| 188 'http://ex%00ample.com', |
| 189 'http://ex%0dample.com', |
| 190 'http://ex%0aample.com', |
| 191 'http://ex%08ample.com', |
| 192 'http://ex\x00ample.com']; |
| 193 |
185 function size(headers) { | 194 function size(headers) { |
186 var count = 0; | 195 var count = 0; |
187 for (var header of headers) { | 196 for (var header of headers) { |
188 ++count; | 197 ++count; |
189 } | 198 } |
190 return count; | 199 return count; |
191 } | 200 } |
192 | 201 |
193 function testBlockMixedContent(mode) { | 202 function testBlockMixedContent(mode) { |
194 promise_test(function(t) { | 203 promise_test(function(t) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 function() { | 256 function() { |
248 if (mode !== 'same-origin') { | 257 if (mode !== 'same-origin') { |
249 assert_unreached( | 258 assert_unreached( |
250 'Test 5: Cross-origin HTTPS request must success: ' + | 259 'Test 5: Cross-origin HTTPS request must success: ' + |
251 'mode = ' + mode); | 260 'mode = ' + mode); |
252 } | 261 } |
253 }); | 262 }); |
254 }); | 263 }); |
255 }, 'Block fetch() as mixed content (' + mode + ')'); | 264 }, 'Block fetch() as mixed content (' + mode + ')'); |
256 } | 265 } |
OLD | NEW |