Home | History | Annotate | Download | only in appcache
      1 <html>
      2 <body>
      3 <p>Test that the manifest is picked correctly when reloading.</p>
      4 <p>Should say SUCCESS:</p>
      5 <div id=result></div>
      6 
      7 <script>
      8 if (window.layoutTestController) {
      9     layoutTestController.dumpAsText();
     10     layoutTestController.waitUntilDone();
     11 }
     12 
     13 function log(message)
     14 {
     15     document.getElementById("result").innerHTML += message + "<br>";
     16 }
     17 
     18 var state = 0;
     19 function receivedMessage(message)
     20 {
     21     log(message);
     22 
     23     if (state == 0) {
     24         state = 1;
     25         setTimeout("frames[0].location.reload()", 0);
     26     } else if (state == 1) {
     27         state = 2;
     28         setTimeout("frames[0].test()", 0);
     29     } else if (state == 2) {
     30         if (window.layoutTestController)
     31             layoutTestController.notifyDone();
     32     }
     33 }
     34 
     35 window.addEventListener("message", function(e) { receivedMessage(e.data) }, false);
     36 
     37 </script>
     38 <iframe src="resources/reload-iframe.html"></iframe>
     39 </body>
     40 </html>
     41