Home | History | Annotate | Download | only in appcache
      1 <html manifest="resources/subframes-1.manifest">
      2 <body>
      3 <p>Test that a subframe without manifest doesn't pick an application cache from parent frame
      4 (as long as no relevant cache contains its resource).</p>
      5 <p>Techically, the check is that iframe subresources that are not in top frame cache are loaded
      6 anyway, so it can also pass if the UA fails to reject loads for cache misses.</p>
      7 <p>Should say SUCCESS:</p>
      8 <div id=result></div>
      9 
     10 <script>
     11 if (window.layoutTestController) {
     12     layoutTestController.dumpAsText();
     13     layoutTestController.waitUntilDone();
     14 }
     15 
     16 function log(message)
     17 {
     18     document.getElementById("result").innerHTML += message + "<br>";
     19 }
     20 
     21 function test()
     22 {
     23     var ifr = document.createElement("iframe");
     24     ifr.setAttribute("src", "resources/subframe-1.html");
     25     document.body.appendChild(ifr);
     26 }
     27 
     28 applicationCache.addEventListener('noupdate', function() { test() }, false);
     29 applicationCache.addEventListener('cached', function() { test() }, false);
     30 
     31 applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") }
     32 applicationCache.onerror = function() { log("FAIL: received unexpected error event") }
     33 
     34 window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false);
     35 
     36 </script>
     37 </body>
     38 </html>
     39