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(OTHER_BASE_URL + | |
139 'ACAOrigin=*&ACAHeaders=x-serviceworker-test') + | |
140 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM', | |
141 [fetchResolved, noContentLength, noServerHeader, hasBody, typeCors], | |
142 [methodIsGET, hasCustomHeader, authCheckNone]], | |
143 | |
yhirano
2016/11/07 07:48:30
Please add a test to verify that ACAOrigin and ACA
Jack Bates
2016/11/12 21:13:30
Done.
| |
136 // Server header | 144 // Server header |
137 [REDIRECT_URL + | 145 [REDIRECT_URL + |
138 encodeURIComponent( | 146 encodeURIComponent( |
139 OTHER_BASE_URL + | 147 OTHER_BASE_URL + |
140 '&ACAOrigin=' + BASE_ORIGIN + | 148 '&ACAOrigin=' + BASE_ORIGIN + |
141 '&ACEHeaders=Content-Length, X-ServiceWorker-ServerHeader') + | 149 '&ACEHeaders=Content-Length, X-ServiceWorker-ServerHeader') + |
142 '&mode=cors&credentials=same-origin&method=GET', | 150 '&mode=cors&credentials=same-origin&method=GET', |
143 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeCors], | 151 [fetchResolved, hasContentLength, hasServerHeader, hasBody, typeCors], |
144 [methodIsGET, authCheckNone]], | 152 [methodIsGET, authCheckNone]], |
145 | 153 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 'ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test') + | 294 'ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test') + |
287 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM' + | 295 '&mode=cors&credentials=same-origin&method=GET&headers=CUSTOM' + |
288 '&ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test', | 296 '&ACAOrigin=' + BASE_ORIGIN + '&ACAHeaders=x-serviceworker-test', |
289 [fetchRejected]], | 297 [fetchRejected]], |
290 ]; | 298 ]; |
291 | 299 |
292 if (self.importScripts) { | 300 if (self.importScripts) { |
293 executeTests(TEST_TARGETS); | 301 executeTests(TEST_TARGETS); |
294 done(); | 302 done(); |
295 } | 303 } |
OLD | NEW |