• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html manifest="fail-on-update.php">
2<body>
3<div id=result></div>
4<script>
5function log(message)
6{
7    document.getElementById("result").innerHTML += message + "<br>";
8}
9
10function test()
11{
12    log("cached")
13    log("status=" + applicationCache.status);
14    applicationCache.onnoupdate = null;
15
16    // Associated to a cache, so loading should fail
17    try {
18        var req = new XMLHttpRequest;
19        req.open("GET", "empty.txt", false);
20        req.send(null);
21        alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exception");
22    } catch (ex) {
23    }
24    log("There should be no messages below.");
25    parent.postMessage("frameDone", "*");
26}
27
28applicationCache.onupdateready = function() { log("updateready"); alert("Unexpected onupdateready event in frame") }
29applicationCache.onerror = function() { log("error"); alert("Unexpected error event in frame") }
30applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected noupdate event in frame") }
31applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected obsolete event in frame") }
32
33applicationCache.oncached = test;
34
35</script>
36</body>
37</html>
38