Use testRunner instead of layoutTestController in tests still found to be using layou...
[WebKit-https.git] / LayoutTests / http / tests / navigation / ping-cookie.html
1 <html><head>
2 <title>Ping</title>
3 <script>
4
5 var testCalled = false;
6
7 function test() {
8     if (!testCalled) {
9         if (window.testRunner) {
10             testRunner.dumpAsText();
11             testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
12             testRunner.waitUntilDone();
13         }
14         testCalled = true;
15         return;
16     }
17     try {
18         var xhr = new XMLHttpRequest();
19         xhr.open("GET", "../cookies/resources/setCookies.cgi", false);
20         xhr.setRequestHeader("SET_COOKIE", "hello=world;path=/");
21         xhr.send(null);
22         if (xhr.status != 200) {
23             document.getElementsByTagName("body")[0].appendChild(document.createTextNode("FAILED: cookie not set"));
24             if (window.testRunner)
25                 testRunner.notifyDone();
26         }
27     } catch (e) {
28         document.getElementsByTagName("body")[0].appendChild(document.createTextNode("FAILED: cookie not set"));
29         if (window.testRunner)
30             testRunner.notifyDone();
31     }
32
33     if (window.eventSender) {
34         var a = document.getElementById("a");
35         eventSender.mouseMoveTo(a.offsetLeft + 2, a.offsetTop + 2);
36         eventSender.mouseDown();
37         eventSender.mouseUp();
38     }
39 }
40
41 </script>
42 </head>
43 <body onload="test();">
44 <img src="resources/delete-ping.php" onload="test();" onerror="test();"></img>
45 <a id="a" href="resources/check-ping.php" ping="resources/save-Ping.php">Navigate and send ping</a>
46 </body></html>