Index: LayoutTests/http/tests/appcache/wrong-signature-2.html |
diff --git a/LayoutTests/http/tests/appcache/wrong-signature-2.html b/LayoutTests/http/tests/appcache/wrong-signature-2.html |
index fd6da7f375fc9d530151b5606e12e0aeedb9db5f..f66b58884bdef52e6e8c1dba2914be9341a2f3ad 100644 |
--- a/LayoutTests/http/tests/appcache/wrong-signature-2.html |
+++ b/LayoutTests/http/tests/appcache/wrong-signature-2.html |
@@ -1,34 +1,30 @@ |
<html manifest="resources/wrong-signature-2.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); |