| Index: LayoutTests/http/tests/appcache/404-resource.html
|
| diff --git a/LayoutTests/http/tests/appcache/404-resource.html b/LayoutTests/http/tests/appcache/404-resource.html
|
| index 1b24e5dfd996f59b6009fb723c79d4150f96c705..a8d13fa31fcd4fe240fb9e2f75b9b2dece9eed92 100644
|
| --- a/LayoutTests/http/tests/appcache/404-resource.html
|
| +++ b/LayoutTests/http/tests/appcache/404-resource.html
|
| @@ -1,39 +1,35 @@
|
| <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 src="/js-test-resources/js-test.js"></script>
|
| <script>
|
| -if (window.testRunner) {
|
| - testRunner.dumpAsText()
|
| - testRunner.waitUntilDone();
|
| -}
|
| -
|
| -function log(message)
|
| -{
|
| - document.getElementById("result").innerHTML += message + "<br>";
|
| -}
|
| +var jsTestIsAsync = true;
|
| +description("Test that a missing explicit resource makes caching fail.");
|
|
|
| function unexpectedCallback(eventName)
|
| {
|
| - log("FAIL: An unexpected " + eventName + " event was dispatched on window.applicationCache.");
|
| + testFailed("An unexpected " + eventName + " event was dispatched on window.applicationCache.");
|
| + finishJSTest();
|
| }
|
|
|
| -function test()
|
| +function test(e)
|
| {
|
| - if (applicationCache.status == applicationCache.UNCACHED)
|
| - log("SUCCESS");
|
| - else
|
| - log("FAILURE: cache status is not uncached: " + applicationCache.status);
|
| + shouldBe("applicationCache.status", "applicationCache.UNCACHED");
|
| +
|
| + event = e;
|
| + shouldBeTrue("'reason' in event");
|
| + shouldBeTrue("'url' in event");
|
| + shouldBeTrue("'status' in event");
|
| + shouldBeTrue("'message' in event");
|
| +
|
| + shouldBeEqualToString("event.reason", "resource");
|
| + shouldBeEqualToString("event.url", "http://127.0.0.1:8000/appcache/resources/does-not-exist.txt");
|
| + shouldBe("event.status", "404");
|
|
|
| - if (window.testRunner)
|
| - testRunner.notifyDone();
|
| + finishJSTest();
|
| }
|
|
|
| -applicationCache.addEventListener('cached', function() { unexpectedCallback("cached"); cacheCallback() }, false);
|
| -applicationCache.addEventListener('noupdate', function() { unexpectedCallback("noupdate"); cacheCallback() }, false);
|
| +applicationCache.addEventListener('cached', function() { unexpectedCallback("cached"); }, false);
|
| +applicationCache.addEventListener('noupdate', function() { unexpectedCallback("noupdate"); }, false);
|
| applicationCache.addEventListener('error', test, false);
|
|
|
| </script>
|
| -</body>
|
| </html>
|
|
|