OLD | NEW |
1 <body> | 1 <body> |
2 <p><a href="rdar://problem/6447115">rdar://problem/6447115</a> Test that a metho
d for logging out of a site that is used by SAP works.</p> | 2 <p><a href="rdar://problem/6447115">rdar://problem/6447115</a> Test that a metho
d for logging out of a site that is used by SAP works.</p> |
3 <p>If an authentication dialog appears, please cancel it.</p> | 3 <p>If an authentication dialog appears, please cancel it.</p> |
4 <span>Login: </span><span id="login">FAIL - Test not run</span><br> | 4 <span>Login: </span><span id="login">FAIL - Test not run</span><br> |
5 <span>Async request sent before logout: </span><span id="async">FAIL - Test not
run</span><br> | 5 <span>Async request sent before logout: </span><span id="async">FAIL - Test not
run</span><br> |
6 <span>Logout: </span><span id="logout">FAIL - Test not run</span> | 6 <span>Logout: </span><span id="logout">FAIL - Test not run</span> |
7 <script> | 7 <script> |
8 if (window.testRunner) { | 8 if (window.testRunner) { |
9 testRunner.dumpAsText(); | 9 testRunner.dumpAsText(); |
10 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
(...skipping 23 matching lines...) Expand all Loading... |
34 xhr.open("GET", "resources/logout/resource.php?isAuthenticated", false); | 34 xhr.open("GET", "resources/logout/resource.php?isAuthenticated", false); |
35 xhr.send(""); | 35 xhr.send(""); |
36 return xhr.status == 200; | 36 return xhr.status == 200; |
37 } | 37 } |
38 | 38 |
39 login(); | 39 login(); |
40 document.getElementById("login").innerHTML = isAuthenticated() ? "PASS" : "FAIL"
; | 40 document.getElementById("login").innerHTML = isAuthenticated() ? "PASS" : "FAIL"
; |
41 | 41 |
42 // Test that a request sent before logout actually has credentials. | 42 // Test that a request sent before logout actually has credentials. |
43 var r = new XMLHttpRequest; | 43 var r = new XMLHttpRequest; |
44 r.open("GET", "resources/logout/resource.php?isAuthenticated", true); | 44 r.open("GET", "resources/logout/resource.php?isAuthenticated2", true); |
45 r.onload = function() { | 45 r.onload = function() { |
46 document.getElementById("async").innerHTML = r.status == 200 ? "PASS" : "FAI
L"; | 46 document.getElementById("async").innerHTML = r.status == 200 ? "PASS" : "FAI
L"; |
47 | 47 |
48 if (window.testRunner) | 48 if (window.testRunner) |
49 testRunner.notifyDone(); | 49 testRunner.notifyDone(); |
50 } | 50 } |
51 r.send(""); | 51 r.send(""); |
52 | 52 |
53 logout(); | 53 logout(); |
54 document.getElementById("logout").innerHTML = isAuthenticated() ? "FAIL" : "PASS
"; | 54 document.getElementById("logout").innerHTML = isAuthenticated() ? "FAIL" : "PASS
"; |
55 </script> | 55 </script> |
56 </body> | 56 </body> |
OLD | NEW |