| 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 url = "data:application/json,report({jsonpResult: 'success'});"; | 6 var url = "data:application/json,report({jsonpResult: 'success'});"; |
| 7 | 7 |
| 8 var TEST_TARGETS = [ | 8 var TEST_TARGETS = [ |
| 9 // data: requests. | 9 // data: requests. |
| 10 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=GET', | 10 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=GET', |
| 11 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, | 11 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, |
| 12 typeBasic], | 12 typeBasic], |
| 13 [checkJsonpSuccess]], | 13 [checkJsonpSuccess]], |
| 14 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=cors&method=GET', | 14 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=cors&method=GET', |
| 15 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, | 15 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, |
| 16 typeBasic], | 16 typeBasic], |
| 17 [checkJsonpSuccess]], | 17 [checkJsonpSuccess]], |
| 18 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=no-cors&method=GET', | 18 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=no-cors&method=GET', |
| 19 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, | 19 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, |
| 20 typeBasic], | 20 typeBasic], |
| 21 [checkJsonpSuccess]], | 21 [checkJsonpSuccess]], |
| 22 | 22 |
| 23 // data: requests with non-GET methods. | 23 // data: requests with non-GET methods. |
| 24 [BASE_URL + 'url=' + encodeURIComponent(url) + | 24 [BASE_URL + 'url=' + encodeURIComponent(url) + |
| 25 '&mode=same-origin&method=POST', | 25 '&mode=same-origin&method=POST', |
| 26 [fetchRejected]], | 26 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, |
| 27 typeBasic], |
| 28 [checkJsonpSuccess]], |
| 27 [BASE_URL + 'url=' + encodeURIComponent(url) + | 29 [BASE_URL + 'url=' + encodeURIComponent(url) + |
| 28 '&mode=same-origin&method=HEAD', | 30 '&mode=same-origin&method=HEAD', |
| 29 [fetchRejected]], | 31 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, |
| 32 typeBasic], |
| 33 [checkJsonpSuccess]], |
| 30 | 34 |
| 31 // data: requests with same-origin redirects. | 35 // data: requests with same-origin redirects. |
| 32 [REDIRECT_URL + encodeURIComponent(url) + '&mode=same-origin&method=GET', | 36 [REDIRECT_URL + encodeURIComponent(url) + '&mode=same-origin&method=GET', |
| 33 [fetchRejected]], | 37 [fetchRejected]], |
| 34 [REDIRECT_URL + encodeURIComponent(url) + '&mode=cors&method=GET', | 38 [REDIRECT_URL + encodeURIComponent(url) + '&mode=cors&method=GET', |
| 35 [fetchRejected]], | 39 [fetchRejected]], |
| 36 | 40 |
| 37 // data: requests with cross-origin redirects. | 41 // data: requests with cross-origin redirects. |
| 38 [OTHER_REDIRECT_URL + encodeURIComponent(url) + | 42 [OTHER_REDIRECT_URL + encodeURIComponent(url) + |
| 39 '&mode=same-origin&method=GET&ACAOrigin=*', | 43 '&mode=same-origin&method=GET&ACAOrigin=*', |
| 40 [fetchRejected]], | 44 [fetchRejected]], |
| 41 [OTHER_REDIRECT_URL + encodeURIComponent(url) + | 45 [OTHER_REDIRECT_URL + encodeURIComponent(url) + |
| 42 '&mode=cors&method=GET&ACAOrigin=*', | 46 '&mode=cors&method=GET&ACAOrigin=*', |
| 43 [fetchRejected]], | 47 [fetchRejected]], |
| 44 ]; | 48 ]; |
| 45 | 49 |
| 46 if (self.importScripts) { | 50 if (self.importScripts) { |
| 47 executeTests(TEST_TARGETS); | 51 executeTests(TEST_TARGETS); |
| 48 done(); | 52 done(); |
| 49 } | 53 } |
| OLD | NEW |