summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/remove-cache-frame-2.html
blob: 009a8b60eae4e6409f05929effedbb1f2e5de06b (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
29
30
31
32
33
34
35
36
37
<html manifest="fail-on-update.php">
<body>
<div id=result></div>
<script>
function log(message)
{
    document.getElementById("result").innerHTML += message + "<br>";
}

function test()
{
    log("cached")
    log("status=" + applicationCache.status);
    applicationCache.onnoupdate = null;

    // Associated to a cache, so loading should fail
    try {
        var req = new XMLHttpRequest;
        req.open("GET", "empty.txt", false);
        req.send(null);
        alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exception");
    } catch (ex) {
    }
    log("There should be no messages below.");
    parent.postMessage("frameDone", "*");
}

applicationCache.onupdateready = function() { log("updateready"); alert("Unexpected onupdateready event in frame") }
applicationCache.onerror = function() { log("error"); alert("Unexpected error event in frame") }
applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected noupdate event in frame") }
applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected obsolete event in frame") }

applicationCache.oncached = test;

</script>
</body>
</html>