OLD | NEW |
1 // OPTIONS: ,-base-https-other-https | 1 // OPTIONS: ,-base-https-other-https |
2 if (self.importScripts) { | 2 if (self.importScripts) { |
3 importScripts('../resources/fetch-test-helpers.js'); | 3 importScripts('/fetch/resources/fetch-test-helpers.js'); |
4 importScripts('../resources/fetch-access-control-util.js'); | 4 importScripts('/fetch/resources/thorough-util.js'); |
5 } | 5 } |
6 | 6 |
7 var referer; | 7 var referer; |
8 | 8 |
9 if (self.importScripts) { | 9 if (self.importScripts) { |
10 // fetch/workers or fetch/serviceworker | 10 // fetch/workers or fetch/serviceworker |
11 referer = BASE_ORIGIN + | 11 referer = BASE_ORIGIN + |
12 '/fetch/script-tests/fetch-access-control.js?' + TEST_OPTIONS; | 12 '/fetch/script-tests/thorough/access-control.js?' + TEST_OPTIONS; |
13 } else if(location.pathname.startsWith( | 13 } else if(location.pathname.startsWith('/fetch/serviceworker-proxied/')) { |
14 '/fetch/serviceworker-proxied/fetch-access-control')) { | |
15 // fetch/serviceworker-proxied | 14 // fetch/serviceworker-proxied |
16 referer = WORKER_URL; | 15 referer = WORKER_URL; |
17 } else { | 16 } else { |
18 // fetch/window | 17 // fetch/window |
19 referer = BASE_ORIGIN + | 18 referer = BASE_ORIGIN + |
20 '/fetch/window/fetch-access-control' + TEST_OPTIONS + '.html'; | 19 '/fetch/window/thorough/access-control' + TEST_OPTIONS + '.html'; |
21 } | 20 } |
22 | 21 |
23 var TEST_TARGETS = [ | 22 var TEST_TARGETS = [ |
24 // Test mode=same-origin. | 23 // Test mode=same-origin. |
25 [BASE_URL + 'mode=same-origin&method=GET', | 24 [BASE_URL + 'mode=same-origin&method=GET', |
26 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeBasic], | 25 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeBasic], |
27 [methodIsGET, authCheck1]], | 26 [methodIsGET, authCheck1]], |
28 [BASE_URL + 'mode=same-origin&method=GET&headers={}', | 27 [BASE_URL + 'mode=same-origin&method=GET&headers={}', |
29 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeBasic], | 28 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeBasic], |
30 [methodIsGET]], | 29 [methodIsGET]], |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Referer check | 63 // Referer check |
65 [BASE_URL + 'mode=same-origin', | 64 [BASE_URL + 'mode=same-origin', |
66 [fetchResolved], | 65 [fetchResolved], |
67 [checkJsonpHeader.bind(this, 'Referer', referer)]], | 66 [checkJsonpHeader.bind(this, 'Referer', referer)]], |
68 ]; | 67 ]; |
69 | 68 |
70 if (self.importScripts) { | 69 if (self.importScripts) { |
71 executeTests(TEST_TARGETS); | 70 executeTests(TEST_TARGETS); |
72 done(); | 71 done(); |
73 } | 72 } |
OLD | NEW |