Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: LayoutTests/http/tests/appcache/wrong-signature-2.html

Issue 217133002: AppCache error details tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Restore missing files Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698