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

Unified Diff: LayoutTests/http/tests/appcache/404-resource-cross-origin.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-cross-origin.html
diff --git a/LayoutTests/http/tests/appcache/404-resource-cross-origin.html b/LayoutTests/http/tests/appcache/404-resource-cross-origin.html
new file mode 100644
index 0000000000000000000000000000000000000000..a80e47f7ae9ede0f20367ff2ee6b9fe8807db383
--- /dev/null
+++ b/LayoutTests/http/tests/appcache/404-resource-cross-origin.html
@@ -0,0 +1,31 @@
+<html manifest="resources/404-resource-cross-origin.manifest">
+<script src="/js-test-resources/js-test.js"></script>
+<script>
+var jsTestIsAsync = true;
+description("Test that a missing cross-origin resource failure doesn't leak details.");
+
+function unexpectedCallback(eventName)
+{
+ testFailed("An unexpected " + eventName + " event was dispatched on window.applicationCache.");
+ finishJSTest();
+}
+
+function test(e)
+{
+ shouldBe("applicationCache.status", "applicationCache.UNCACHED");
+
+ event = e;
+ shouldBeEqualToString("event.reason", "resource");
+ shouldBeEqualToString("event.url", "http://127.0.0.1/does-not-exist.txt");
+ shouldBe("event.status", "0");
+ shouldBeEqualToString("event.message", "");
+
+ finishJSTest();
+}
+
+applicationCache.addEventListener('cached', function() { unexpectedCallback("cached"); }, false);
+applicationCache.addEventListener('noupdate', function() { unexpectedCallback("noupdate"); }, false);
+applicationCache.addEventListener('error', test, false);
+
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698