summaryrefslogtreecommitdiffstats
path: root/LayoutTests/http/tests/appcache/resources/offline-access-frame.html
blob: 68ef274d81fd2bf15716e6b0f7e7cd6a267d7461 (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
<html manifest="/resources/network-simulator.php?path=/appcache/resources/offline-access.manifest">
<div id=result></div>
<script>
function log(message)
{
    document.getElementById("result").innerHTML += message + "<br>";
}
applicationCache.onchecking = function() { log("checking"); }
applicationCache.ondownloading = function() { log("downloading") }
applicationCache.onprogress = function() { log("progress") }
applicationCache.onupdateready = function() { log("updateready") }
applicationCache.onobsolete = function() { log("obsolete") }
</script>
<script src="/resources/network-simulator.php?path=/appcache/resources/offline-access.js"></script>
<script>

applicationCache.oncached = function() { log("cached"); test() }
applicationCache.onnoupdate = function() { log("noupdate"); test() }
applicationCache.onerror = function() { log("error"); test() }

if (applicationCache.status == applicationCache.IDLE) {
    // Update finished while we were waiting for offline-access.js to load.
    applicationCache.oncached = function() { log("cached") }
    applicationCache.onnoupdate = function() { log("noupdate") }
    applicationCache.onerror = function() { log("error") }
    test();
}

</script>
</html>