4 <script src="/js-test-resources/js-test.js"></script>
6 description("Checking transmission of Beacons involving cookies.");
8 window.jsTestIsAsync = true;
11 if (window.testRunner) {
12 testRunner.dumpAsText();
13 testRunner.waitUntilDone();
14 //testRunner.dumpPingLoaderCallbacks();
17 var xhr = new XMLHttpRequest();
18 xhr.open("GET", "../../cookies/resources/setCookies.cgi", false);
19 xhr.setRequestHeader("SET-COOKIE", "hello=world;path=/");
21 if (xhr.status != 200) {
22 testFailed("cookie not set");
26 testFailed("cookie not set");
30 shouldBeTrue('navigator.sendBeacon("resources/save-beacon.py?name=cookie", "Blip");');
31 var xhr = new XMLHttpRequest();
32 xhr.open("GET", "resources/check-beacon.py?name=cookie");
33 xhr.onload = function () {
34 var lines = xhr.responseText.split("\n");
39 xhr.onerror = function () {
40 testFailed("Unable to fetch beacon status");
48 <body onload="test();">