| <script src="/js-test-resources/js-test.js"></script> |
| description("Checking transmission of Beacons involving cookies."); |
| window.jsTestIsAsync = true; |
| testRunner.waitUntilDone(); |
| //testRunner.dumpPingLoaderCallbacks(); |
| var xhr = new XMLHttpRequest(); |
| xhr.open("GET", "../../cookies/resources/setCookies.cgi", false); |
| xhr.setRequestHeader("SET-COOKIE", "hello=world;path=/"); |
| testFailed("cookie not set"); |
| testFailed("cookie not set"); |
| shouldBeTrue('navigator.sendBeacon("resources/save-beacon.php?name=cookie", "Blip");'); |
| var xhr = new XMLHttpRequest(); |
| xhr.open("GET", "resources/check-beacon.php?name=cookie"); |
| xhr.onload = function () { |
| var lines = xhr.responseText.split("\n"); |
| xhr.onerror = function () { |
| testFailed("Unable to fetch beacon status"); |