OLD | NEW |
1 if (self.importScripts) { | 1 if (self.importScripts) { |
2 importScripts('/fetch/resources/fetch-test-helpers.js'); | 2 importScripts('/fetch/resources/fetch-test-helpers.js'); |
3 importScripts('/fetch/resources/thorough-util.js'); | 3 importScripts('/fetch/resources/thorough-util.js'); |
4 } | 4 } |
5 | 5 |
6 var TEST_TARGETS = [ | 6 var TEST_TARGETS = [ |
7 // Redirect: same origin -> same origin | 7 // Redirect: same origin -> same origin |
8 [REDIRECT_URL + encodeURIComponent(BASE_URL) + | 8 [REDIRECT_URL + encodeURIComponent(BASE_URL) + |
9 '&mode=same-origin&method=GET', | 9 '&mode=same-origin&method=GET', |
10 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeBasic], | 10 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeBasic], |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 '&mode=cors&credentials=same-origin&method=POST&Status=307', | 126 '&mode=cors&credentials=same-origin&method=POST&Status=307', |
127 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], | 127 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], |
128 [methodIsPOST]], | 128 [methodIsPOST]], |
129 // The 308 redirect response MUST NOT change the method. | 129 // The 308 redirect response MUST NOT change the method. |
130 // FIXME: disabled due to https://crbug.com/451938 | 130 // FIXME: disabled due to https://crbug.com/451938 |
131 // [REDIRECT_URL + encodeURIComponent(OTHER_BASE_URL + '&ACAOrigin=*') + | 131 // [REDIRECT_URL + encodeURIComponent(OTHER_BASE_URL + '&ACAOrigin=*') + |
132 // '&mode=cors&credentials=same-origin&method=POST&Status=308', | 132 // '&mode=cors&credentials=same-origin&method=POST&Status=308', |
133 // [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], | 133 // [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], |
134 // [methodIsPOST]], | 134 // [methodIsPOST]], |
135 | 135 |
| 136 // Custom header |
| 137 [REDIRECT_URL + |
| 138 encodeURIComponent( |
| 139 OTHER_BASE_URL + |
| 140 'ACAOrigin=*&ACAHeaders=x-serviceworker-test') + |
| 141 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM', |
| 142 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], |
| 143 [methodIsGET, hasCustomHeader, authCheckNone]], |
| 144 [REDIRECT_URL + |
| 145 encodeURIComponent( |
| 146 OTHER_BASE_URL + |
| 147 'ACAOrigin=*') + |
| 148 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM', |
| 149 [fetchRejected]], |
| 150 [REDIRECT_URL + |
| 151 encodeURIComponent( |
| 152 OTHER_BASE_URL + |
| 153 'ACAHeaders=x-serviceworker-test') + |
| 154 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM', |
| 155 [fetchRejected]], |
| 156 |
136 // Server header | 157 // Server header |
137 [REDIRECT_URL + | 158 [REDIRECT_URL + |
138 encodeURIComponent( | 159 encodeURIComponent( |
139 OTHER_BASE_URL + | 160 OTHER_BASE_URL + |
140 '&ACAOrigin=' + BASE_ORIGIN + | 161 '&ACAOrigin=' + BASE_ORIGIN + |
141 '&ACEHeaders=Content-Length, X-ServiceWorker-ServerHeader') + | 162 '&ACEHeaders=Content-Length, X-ServiceWorker-ServerHeader') + |
142 '&mode=cors&credentials=same-origin&method=GET', | 163 '&mode=cors&credentials=same-origin&method=GET', |
143 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeCors], | 164 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeCors], |
144 [methodIsGET, authCheckNone]], | 165 [methodIsGET, authCheckNone]], |
145 | 166 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 'ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test') + | 307 'ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test') + |
287 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM' + | 308 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM' + |
288 '&ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test', | 309 '&ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test', |
289 [fetchRejected]], | 310 [fetchRejected]], |
290 ]; | 311 ]; |
291 | 312 |
292 if (self.importScripts) { | 313 if (self.importScripts) { |
293 executeTests(TEST_TARGETS); | 314 executeTests(TEST_TARGETS); |
294 done(); | 315 done(); |
295 } | 316 } |
OLD | NEW |