summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/auth.html
blob: 27b0ba6fffac0edec9cbd0d31e83a4a6bd83c502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<body>
<p>Test that appcache works with authentication. Should say SUCCESS:</p>
<script>
if (window.layoutTestController) {
    layoutTestController.dumpAsText();
    layoutTestController.waitUntilDone();
}

// Store authentication credentials.
var req = new XMLHttpRequest;
req.open("GET", "resources/auth/setup.php", false, "login", "pasword");
req.send();

var ifr = document.createElement("iframe");
ifr.setAttribute("src", "resources/auth/iframe.php");
document.body.appendChild(ifr);

function success()
{
    var text = document.createElement("p");
    text.appendChild(document.createTextNode("SUCCESS"));
    document.body.replaceChild(text, document.getElementsByTagName("iframe")[0]);

    if (window.layoutTestController)
        layoutTestController.notifyDone();
}
</script>
</body>