2 <p><a href=
"rdar://problem/6447115">rdar://problem/
6447115</a> Test that a method for logging out of a site that is used by SAP works.
</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>
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>
8 if (window
.testRunner
) {
9 testRunner
.dumpAsText();
10 testRunner
.waitUntilDone();
15 var xhr
= new XMLHttpRequest
;
16 // "?login" is only here for ease of debugging; it doesn't affect behavior.
17 xhr
.open("GET", "resources/logout/resource.php?login", false, "user", "pass");
23 var xhr
= new XMLHttpRequest
;
24 // logout.html doesn't even exist - we don't need to send this request to server.
25 xhr
.open("GET", "resources/logout/subdirectory/logout.html", true, "logout", "logout");
30 function isAuthenticated()
32 var xhr
= new XMLHttpRequest
;
33 // "?isAuthenticated" is only here for ease of debugging; it doesn't affect behavior.
34 xhr
.open("GET", "resources/logout/resource.php?isAuthenticated", false);
36 return xhr
.status
== 200;
40 document
.getElementById("login").innerHTML
= isAuthenticated() ? "PASS" : "FAIL";
42 // Test that a request sent before logout actually has credentials.
43 var r
= new XMLHttpRequest
;
44 r
.open("GET", "resources/logout/resource.php?isAuthenticated2", true);
45 r
.onload = function() {
46 document
.getElementById("async").innerHTML
= r
.status
== 200 ? "PASS" : "FAIL";
48 if (window
.testRunner
)
49 testRunner
.notifyDone();
54 document
.getElementById("logout").innerHTML
= isAuthenticated() ? "FAIL" : "PASS";