| <html manifest="resources/404-resource.manifest"> |
| <script src="/js-test-resources/js-test.js"></script> |
| <script> |
| var jsTestIsAsync = true; |
| description("Test that a missing explicit resource makes caching fail."); |
| |
| function unexpectedCallback(eventName) |
| { |
| testFailed("An unexpected " + eventName + " event was dispatched on window.applicationCache."); |
| finishJSTest(); |
| } |
| |
| function test(e) |
| { |
| shouldBe("applicationCache.status", "applicationCache.UNCACHED"); |
| |
| event = e; |
| shouldBeEqualToString("event.reason", "resource"); |
| shouldBeEqualToString("event.url", "http://127.0.0.1:8000/appcache/resources/does-not-exist.txt"); |
| shouldBe("event.status", "404"); |
| shouldBeTrue("'message' in event"); |
| |
| finishJSTest(); |
| } |
| |
| applicationCache.addEventListener('cached', function() { unexpectedCallback("cached"); }, false); |
| applicationCache.addEventListener('noupdate', function() { unexpectedCallback("noupdate"); }, false); |
| applicationCache.addEventListener('error', test, false); |
| |
| </script> |
| </html> |