1 <html manifest="resources/foreign-iframe.manifest"> <!-- Any manifest would do the trick. --> 2 <body> 3 <p>Test for <a href="rdar://problem/6284708"><rdar://problem/6284708></a> AppCache crashes in ApplicationCacheResource::addType().</p> 4 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 function test() 19 { 20 var ifr = document.createElement("iframe"); 21 ifr.setAttribute("src", "http://localhost:8000/appcache/resources/foreign-iframe.html"); 22 document.body.appendChild(ifr); 23 } 24 25 applicationCache.addEventListener('checking', function() { log("checking") }, false); 26 applicationCache.addEventListener('error', function() { log("error") }, false); 27 applicationCache.addEventListener('downloading', function() { log("downloading") }, false); 28 applicationCache.addEventListener('progress', function() { log("progress") }, false); 29 applicationCache.addEventListener('updateready', function() { log("updateready") }, false); 30 applicationCache.addEventListener('obsolete', function() { log("obsolete") }, false); 31 32 applicationCache.addEventListener('noupdate', function() { log("noupdate"); test() }, false); 33 applicationCache.addEventListener('cached', function() { log("cached"); test() }, false); 34 35 window.addEventListener("message", function() { log("SUCCESS"); if (window.layoutTestController) layoutTestController.notifyDone() }, false); 36 37 </script> 38 </body> 39 </html> 40