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