http/tests/loading/basic-auth-resend-wrong-credentials.html is still a flaky failure...
[WebKit-https.git] / LayoutTests / http / tests / loading / basic-auth-resend-wrong-credentials.html
1 <html>
2 <head>
3 <script>
4
5 if (window.testRunner) {
6     testRunner.dumpAsText();
7     testRunner.dumpChildFramesAsText();
8     testRunner.setHandlesAuthenticationChallenges(true);
9     testRunner.setAuthenticationUsername("wrongusername");
10     testRunner.setAuthenticationPassword("wrongpassword");
11     testRunner.waitUntilDone();
12 }
13
14 function firstFrameLoaded() {
15     if (window.testRunner) {
16         testRunner.setAuthenticationUsername("correctusername");
17         testRunner.setAuthenticationPassword("correctpassword");
18     }
19     var frame = document.createElement("iframe");
20     frame.setAttribute("src", "http://127.0.0.1:8000/loading/resources/test2/basic-auth-testing.php?username=correctusername&password=correctpassword");
21     frame.setAttribute("onload", "secondFrameLoaded()");
22     document.body.appendChild(frame);
23 }
24
25 function secondFrameLoaded() {
26     if (window.testRunner)
27         testRunner.notifyDone();
28 }
29
30 function makeIFrame() {
31     var iframe = document.createElement("iframe");
32     iframe.onload=firstFrameLoaded;
33     iframe.src="resources/test2/protected-resource.php";
34     document.body.appendChild(iframe);
35 }
36
37 </script>
38 </head>
39 <body onload="setTimeout(makeIFrame, 0)">
40 This test makes sure that once WebCore preemptively sends out Basic credentials it thinks apply to a new resource, and that resource response with a 401 challenge, that it doesn't try to send the same wrong credentials a second time.<br>
41 </body>
42 </html>