Home | History | Annotate | Download | only in resources
      1 <html manifest="/resources/network-simulator.php?path=/appcache/resources/offline-access.manifest">
      2 <div id=result></div>
      3 <script>
      4 function log(message)
      5 {
      6     document.getElementById("result").innerHTML += message + "<br>";
      7 }
      8 applicationCache.onchecking = function() { log("checking"); }
      9 applicationCache.ondownloading = function() { log("downloading") }
     10 applicationCache.onprogress = function() { log("progress") }
     11 applicationCache.onupdateready = function() { log("updateready") }
     12 applicationCache.onobsolete = function() { log("obsolete") }
     13 </script>
     14 <script src="/resources/network-simulator.php?path=/appcache/resources/offline-access.js"></script>
     15 <script>
     16 
     17 applicationCache.oncached = function() { log("cached"); test() }
     18 applicationCache.onnoupdate = function() { log("noupdate"); test() }
     19 applicationCache.onerror = function() { log("error"); test() }
     20 
     21 if (applicationCache.status == applicationCache.IDLE) {
     22     // Update finished while we were waiting for offline-access.js to load.
     23     applicationCache.oncached = function() { log("cached") }
     24     applicationCache.onnoupdate = function() { log("noupdate") }
     25     applicationCache.onerror = function() { log("error") }
     26     test();
     27 }
     28 
     29 </script>
     30 </html>
     31