+2009-01-23 Alexey Proskuryakov <ap@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23478
+ Add a test for application test resource loading failure
+
+ * http/tests/appcache/404-resource-expected.txt: Added.
+ * http/tests/appcache/404-resource.html: Added.
+ * http/tests/appcache/resources/404-resource.manifest: Added.
+
2009-01-22 Eric Seidel <eric@webkit.org>
Reviewed by Justin Garcia.
--- /dev/null
+<html manifest="resources/404-resource.manifest">
+<body>
+<p>Test that a missing explicit resource makes caching fail.</p>
+<p>Should say SUCCESS:</p>
+<div id=result></div>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText()
+ layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function cacheCallback()
+{
+ log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated with any cache yet.");
+}
+
+function timeout()
+{
+ if (applicationCache.status != applicationCache.UNCACHED) {
+ setTimeout(timeout, 100);
+ return;
+ }
+
+ log("SUCCESS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
+applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
+applicationCache.addEventListener('error', function() { log("error"); cacheCallback() }, false);
+
+setTimeout(timeout, 100);
+
+</script>
+</body>
+</html>