| OLD | NEW |
| 1 if (self.importScripts) { | 1 if (self.importScripts) { |
| 2 importScripts('../resources/fetch-test-helpers.js'); | 2 importScripts('/fetch/resources/fetch-test-helpers.js'); |
| 3 importScripts('../resources/fetch-access-control-util.js'); | 3 importScripts('/fetch/resources/thorough-util.js'); |
| 4 } | 4 } |
| 5 | 5 |
| 6 // This test assumes TEST_TARGETS are executed in order and sequentially. | 6 // This test assumes TEST_TARGETS are executed in order and sequentially. |
| 7 var TEST_TARGETS = []; | 7 var TEST_TARGETS = []; |
| 8 | 8 |
| 9 // cookieCheckX checks the cookies sent in the request. | 9 // cookieCheckX checks the cookies sent in the request. |
| 10 // SetCookie=cookieX indicates to set cookies in the response. | 10 // SetCookie=cookieX indicates to set cookies in the response. |
| 11 // So a SetCookie=cookieX indication may affect the next cookieCheckX, | 11 // So a SetCookie=cookieX indication may affect the next cookieCheckX, |
| 12 // but not the cookieCheckX in the same request. | 12 // but not the cookieCheckX in the same request. |
| 13 | 13 |
| 14 // Test same-origin requests. | 14 // Test same-origin requests. |
| 15 // The same set of requests are also in fetch-access-control-cookie-no-cors.js, | 15 // The same set of requests are also in cookie-no-cors.js, |
| 16 // with different mode (no-cors). | 16 // with different mode (no-cors). |
| 17 ['same-origin', 'cors'].forEach(function(mode) { | 17 ['same-origin', 'cors'].forEach(function(mode) { |
| 18 // At first, cookie is cookie=cookie1. | 18 // At first, cookie is cookie=cookie1. |
| 19 TEST_TARGETS.push( | 19 TEST_TARGETS.push( |
| 20 // Set cookie=cookieA by credentials=same-origin. | 20 // Set cookie=cookieA by credentials=same-origin. |
| 21 [BASE_URL + 'mode=' + mode + '&credentials=same-origin&SetCookie=cookieA', | 21 [BASE_URL + 'mode=' + mode + '&credentials=same-origin&SetCookie=cookieA', |
| 22 [fetchResolved, hasBody], [cookieCheck1]], | 22 [fetchResolved, hasBody], [cookieCheck1]], |
| 23 | 23 |
| 24 // Set cookie=cookieB by credentials=include. | 24 // Set cookie=cookieB by credentials=include. |
| 25 [BASE_URL + 'mode=' + mode + '&credentials=include&SetCookie=cookieB', | 25 [BASE_URL + 'mode=' + mode + '&credentials=include&SetCookie=cookieB', |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 [OTHER_BASE_URL + | 147 [OTHER_BASE_URL + |
| 148 'mode=same-origin&credentials=same-origin&SetCookie=cookieC', | 148 'mode=same-origin&credentials=same-origin&SetCookie=cookieC', |
| 149 [fetchRejected]], | 149 [fetchRejected]], |
| 150 [OTHER_CHECK_URL + 'otherCheck13', [fetchResolved], [cookieCheckB]] | 150 [OTHER_CHECK_URL + 'otherCheck13', [fetchResolved], [cookieCheckB]] |
| 151 ); | 151 ); |
| 152 | 152 |
| 153 if (self.importScripts) { | 153 if (self.importScripts) { |
| 154 executeTests(TEST_TARGETS); | 154 executeTests(TEST_TARGETS); |
| 155 done(); | 155 done(); |
| 156 } | 156 } |
| OLD | NEW |