| Index: LayoutTests/http/tests/appcache/wrong-signature.html
|
| diff --git a/LayoutTests/http/tests/appcache/wrong-signature.html b/LayoutTests/http/tests/appcache/wrong-signature.html
|
| index 9a965917e8fcc1a471ce4a9c8b9de67ba5c2ea19..f40ac3d0070e1894a89d15bfa44e31dae5583860 100644
|
| --- a/LayoutTests/http/tests/appcache/wrong-signature.html
|
| +++ b/LayoutTests/http/tests/appcache/wrong-signature.html
|
| @@ -1,38 +1,34 @@
|
| <html manifest="resources/wrong-signature.manifest">
|
| -<body>
|
| -<p>Test that a manifest served with a wrong signature isn't treated as such.</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();
|
| -}
|
| +var jsTestIsAsync = true;
|
| +description("Test that a manifest served with a wrong signature isn't treated as such.");
|
|
|
| -function log(message)
|
| +function unexpectedEvent(name)
|
| {
|
| - document.getElementById("result").innerHTML += message + "<br>";
|
| + testFailed("Unexpected " + name + " event.");
|
| + finishJSTest();
|
| }
|
|
|
| -function cacheCallback()
|
| +function test(e)
|
| {
|
| - log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
|
| -}
|
| + shouldBe("window.applicationCache.status", "applicationCache.UNCACHED");
|
|
|
| -function test()
|
| -{
|
| - // Wait for cache update to finish.
|
| - if (window.applicationCache.status != window.applicationCache.UNCACHED)
|
| - log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
|
| - else
|
| - log("SUCCESS");
|
| + event = e;
|
| + shouldBeTrue("'reason' in event");
|
| + shouldBeTrue("'url' in event");
|
| + shouldBeTrue("'status' in event");
|
| + shouldBeTrue("'message' in event");
|
| +
|
| + shouldBeEqualToString("event.reason", "signature");
|
| + shouldBeEqualToString("event.url", "");
|
| + shouldBe("event.status", "0");
|
|
|
| - if (window.testRunner)
|
| - testRunner.notifyDone();
|
| + finishJSTest();
|
| }
|
|
|
| -applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
|
| -applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
|
| +applicationCache.addEventListener('cached', function() { unexpectedEvent("cached"); }, false);
|
| +applicationCache.addEventListener('noupdate', function() { unexpectedEvent("noupdate"); }, false);
|
| applicationCache.addEventListener('error', test, false);
|
|
|
| </script>
|
|
|