Index: LayoutTests/http/tests/appcache/modified-manifest.html |
diff --git a/LayoutTests/http/tests/appcache/modified-manifest.html b/LayoutTests/http/tests/appcache/modified-manifest.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a3eac23b074f812cf1e92ec97be9a3b349b2101b |
--- /dev/null |
+++ b/LayoutTests/http/tests/appcache/modified-manifest.html |
@@ -0,0 +1,44 @@ |
+<html manifest="resources/modified-manifest.php"> |
+<script src="/js-test-resources/js-test.js"></script> |
+<script> |
+var jsTestIsAsync = true; |
+description("Test that a manifest that changes during an update fails."); |
+ |
+function unexpectedEvent(name) |
michaeln
2014/03/31 20:18:43
not used?
jsbell
2014/03/31 22:10:45
Removed.
|
+{ |
+ testFailed("Unexpected " + name + " event."); |
+ finishJSTest(); |
+} |
+ |
+var gotCheckingEvent = false; |
+function onChecking() { gotCheckingEvent = true; } |
+ |
+ |
+var gotDownloadingEvent = false; |
+function onDownloading() { gotDownloadingEvent = true; } |
+ |
+function onError(e) |
+{ |
+ shouldBeTrue("gotCheckingEvent"); |
+ shouldBeTrue("gotDownloadingEvent"); |
+ shouldBe("window.applicationCache.status", "applicationCache.UNCACHED"); |
+ |
+ event = e; |
+ shouldBeTrue("'reason' in event"); |
+ shouldBeTrue("'url' in event"); |
+ shouldBeTrue("'status' in event"); |
+ shouldBeTrue("'message' in event"); |
+ |
+ shouldBeEqualToString("event.reason", "changed"); |
+ shouldBeEqualToString("event.url", ""); |
+ shouldBe("event.status", "0"); |
+ |
+ finishJSTest(); |
+} |
+ |
+applicationCache.addEventListener('checking', onChecking, false); |
+applicationCache.addEventListener('downloading', onDownloading, false); |
+applicationCache.addEventListener('error', onError, false); |
+ |
+</script> |
+</html> |