| OLD | NEW |
| (Empty) |
| 1 <body> | |
| 2 <p>Test that default credentials aren't used when ones are provided to XHR expli
citly.</p> | |
| 3 <span>Login: </span><span id="login">FAIL - Test not run</span><br> | |
| 4 <span>Default: </span><span id="default">FAIL - Test not run</span><br> | |
| 5 <span>Re-login: </span><span id="relogin">FAIL - Test not run</span><br> | |
| 6 <span>New default: </span><span id="newdefault">FAIL - Test not run</span> | |
| 7 <script> | |
| 8 if (window.testRunner) { | |
| 9 testRunner.dumpAsText(); | |
| 10 testRunner.waitUntilDone(); | |
| 11 } | |
| 12 | |
| 13 var xhr = new XMLHttpRequest; | |
| 14 | |
| 15 function f1() | |
| 16 { | |
| 17 // "?login1" is only here for ease of debugging; it doesn't affect behavior. | |
| 18 xhr.open("GET", "resources/re-login/resource.php?login1", true, "user1", "pa
ss"); | |
| 19 xhr.send(""); | |
| 20 xhr.onload = function() { | |
| 21 document.getElementById("login").innerHTML = xhr.responseText == "User:
user1, password: pass." ? "PASS" : "FAIL"; | |
| 22 f2(); | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 function f2() | |
| 27 { | |
| 28 // "?default" is only here for ease of debugging; it doesn't affect behavior
. | |
| 29 xhr.open("GET", "resources/re-login/resource.php?default", true); | |
| 30 xhr.send(""); | |
| 31 xhr.onload = function() { | |
| 32 document.getElementById("default").innerHTML = xhr.responseText == "User
: user1, password: pass." ? "PASS" : "FAIL"; | |
| 33 f3(); | |
| 34 } | |
| 35 } | |
| 36 | |
| 37 function f3() | |
| 38 { | |
| 39 // "?login2" is only here for ease of debugging; it doesn't affect behavior. | |
| 40 xhr.open("GET", "resources/re-login/resource.php?login2", true, "user2", "pa
ss"); | |
| 41 xhr.send(""); | |
| 42 xhr.onload = function() { | |
| 43 document.getElementById("relogin").innerHTML = xhr.responseText == "User
: user2, password: pass." ? "PASS" : "FAIL"; | |
| 44 f4(); | |
| 45 } | |
| 46 } | |
| 47 | |
| 48 function f4() | |
| 49 { | |
| 50 // "?newdefault" is only here for ease of debugging; it doesn't affect behav
ior. | |
| 51 xhr.open("GET", "resources/re-login/resource.php?newdefault", true); | |
| 52 xhr.send(""); | |
| 53 xhr.onload = function() { | |
| 54 document.getElementById("newdefault").innerHTML = xhr.responseText == "U
ser: user2, password: pass." ? "PASS" : "FAIL"; | |
| 55 if (window.testRunner) | |
| 56 testRunner.notifyDone(); | |
| 57 } | |
| 58 } | |
| 59 | |
| 60 f1(); | |
| 61 | |
| 62 </script> | |
| 63 </body> | |
| OLD | NEW |