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

Unified Diff: LayoutTests/http/tests/appcache/404-resource.html

Issue 217133002: AppCache error details tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: statusCode -> status 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/404-resource.html
diff --git a/LayoutTests/http/tests/appcache/404-resource.html b/LayoutTests/http/tests/appcache/404-resource.html
index 1b24e5dfd996f59b6009fb723c79d4150f96c705..fd48dbbd1e25555af5505155daa031e8704092bb 100644
--- a/LayoutTests/http/tests/appcache/404-resource.html
+++ b/LayoutTests/http/tests/appcache/404-resource.html
@@ -1,39 +1,31 @@
<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;
+ shouldBeEqualToString("event.reason", "resource");
+ shouldBeEqualToString("event.url", "http://127.0.0.1:8000/appcache/resources/does-not-exist.txt");
+ shouldBe("event.status", "404");
+ shouldBeTrue("'message' in event");
- 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>

Powered by Google App Engine
This is Rietveld 408576698