Home | History | Annotate | Download | only in resources
      1 <html manifest="fail-on-update.php">
      2 <body>
      3 <div id=result></div>
      4 <script>
      5 function log(message)
      6 {
      7     document.getElementById("result").innerHTML += message + "<br>";
      8 }
      9 
     10 function 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 
     28 applicationCache.onupdateready = function() { log("updateready"); alert("Unexpected onupdateready event in frame") }
     29 applicationCache.onerror = function() { log("error"); alert("Unexpected error event in frame") }
     30 applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected noupdate event in frame") }
     31 applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected obsolete event in frame") }
     32 
     33 applicationCache.oncached = test;
     34 
     35 </script>
     36 </body>
     37 </html>
     38