1 <html manifest="resources/404-resource.manifest"> 2 <body> 3 <p>Test that a missing explicit resource makes caching fail.</p> 4 <p>Should say SUCCESS:</p> 5 <div id=result></div> 6 <script> 7 if (window.layoutTestController) { 8 layoutTestController.dumpAsText() 9 layoutTestController.waitUntilDone(); 10 } 11 12 function log(message) 13 { 14 document.getElementById("result").innerHTML += message + "<br>"; 15 } 16 17 function unexpectedCallback(eventName) 18 { 19 log("FAIL: An unexpected " + eventName + " event was dispatched on window.applicationCache."); 20 } 21 22 function test() 23 { 24 if (applicationCache.status == applicationCache.UNCACHED) 25 log("SUCCESS"); 26 else 27 log("FAILURE: cache status is not uncached: " + applicationCache.status); 28 29 if (window.layoutTestController) 30 layoutTestController.notifyDone(); 31 } 32 33 applicationCache.addEventListener('cached', function() { unexpectedCallback("cached"); cacheCallback() }, false); 34 applicationCache.addEventListener('noupdate', function() { unexpectedCallback("noupdate"); cacheCallback() }, false); 35 applicationCache.addEventListener('error', test, false); 36 37 </script> 38 </body> 39 </html> 40