Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / appcache / wrong-signature.html
index 9a96591..2e572b4 100644 (file)
@@ -1,38 +1,30 @@
 <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;
+    shouldBeEqualToString("event.reason", "signature");
+    shouldBeEqualToString("event.url", "");
+    shouldBe("event.status", "0");
+    shouldBeTrue("'message' in event");
 
-    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>