OLD | NEW |
(Empty) | |
| 1 if (self.importScripts) { |
| 2 importScripts('/fetch/resources/fetch-test-helpers.js'); |
| 3 importScripts('/fetch/resources/thorough-util.js'); |
| 4 } |
| 5 |
| 6 var url = "data:application/json,report({jsonpResult: 'success'});"; |
| 7 |
| 8 var TEST_TARGETS = [ |
| 9 // data: requests. |
| 10 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=GET', |
| 11 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ
eBasic], |
| 12 [checkJsonpSuccess]], |
| 13 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=cors&method=GET', |
| 14 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ
eBasic], |
| 15 [checkJsonpSuccess]], |
| 16 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=no-cors&method=GET', |
| 17 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ
eBasic], |
| 18 [checkJsonpSuccess]], |
| 19 |
| 20 // data: requests with non-GET methods. |
| 21 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=POST'
, |
| 22 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ
eBasic], |
| 23 [checkJsonpSuccess]], |
| 24 [BASE_URL + 'url=' + encodeURIComponent(url) + '&mode=same-origin&method=HEAD'
, |
| 25 [fetchResolved, noContentLength, hasContentType, noServerHeader, hasBody, typ
eBasic], |
| 26 [checkJsonpSuccess]], |
| 27 |
| 28 // data: requests with same-origin redirects. |
| 29 [REDIRECT_URL + encodeURIComponent(url) + '&mode=same-origin&method=GET', |
| 30 [fetchRejected]], |
| 31 [REDIRECT_URL + encodeURIComponent(url) + '&mode=cors&method=GET', |
| 32 [fetchRejected]], |
| 33 |
| 34 // data: requests with cross-origin redirects. |
| 35 [OTHER_REDIRECT_URL + encodeURIComponent(url) + |
| 36 '&mode=same-origin&method=GET&ACAOrigin=*', |
| 37 [fetchRejected]], |
| 38 [OTHER_REDIRECT_URL + encodeURIComponent(url) + |
| 39 '&mode=cors&method=GET&ACAOrigin=*', |
| 40 [fetchRejected]], |
| 41 ]; |
| 42 |
| 43 if (self.importScripts) { |
| 44 executeTests(TEST_TARGETS); |
| 45 done(); |
| 46 } |
OLD | NEW |