OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <script src="/js-test-resources/js-test.js"></script> |
| 5 <script> |
| 6 description("Verifying navigator.sendBeacon(Blob) non-CORS cross-origin redirect
handling."); |
| 7 |
| 8 window.jsTestIsAsync = true; |
| 9 |
| 10 var blob; |
| 11 function test() { |
| 12 if (window.testRunner) { |
| 13 testRunner.dumpAsText(); |
| 14 testRunner.dumpPingLoaderCallbacks(); |
| 15 } |
| 16 |
| 17 blob = new Blob(["Cross", "Origin"], {type: "text/plain;from-beacon=true"}); |
| 18 shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/resourc
es/redirection-response.php?status=302&simple=true&target=non-existent.php", blo
b);'); |
| 19 // Wait a while for the redirect response handling to happen before finishin
g up. |
| 20 setTimeout(function () { |
| 21 blob = new Blob([new Uint8Array(20)], {type: "application/octet-stream"}
); |
| 22 shouldBeTrue('navigator.sendBeacon("http://127.0.0.1:8080/navigation/res
ources/redirection-response.php?status=302&simple=false&target=non-existent.php"
, blob);'); |
| 23 setTimeout(finishJSTest, 200); |
| 24 }, 200); |
| 25 } |
| 26 </script> |
| 27 </head> |
| 28 <body onload="test();"> |
| 29 </body> |
| 30 </html> |
OLD | NEW |