Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html manifest="resources/modified-manifest.php"> | |
| 2 <script src="/js-test-resources/js-test.js"></script> | |
| 3 <script> | |
| 4 var jsTestIsAsync = true; | |
| 5 description("Test that a manifest that changes during an update fails."); | |
| 6 | |
| 7 function unexpectedEvent(name) | |
|
michaeln
2014/03/31 20:18:43
not used?
jsbell
2014/03/31 22:10:45
Removed.
| |
| 8 { | |
| 9 testFailed("Unexpected " + name + " event."); | |
| 10 finishJSTest(); | |
| 11 } | |
| 12 | |
| 13 var gotCheckingEvent = false; | |
| 14 function onChecking() { gotCheckingEvent = true; } | |
| 15 | |
| 16 | |
| 17 var gotDownloadingEvent = false; | |
| 18 function onDownloading() { gotDownloadingEvent = true; } | |
| 19 | |
| 20 function onError(e) | |
| 21 { | |
| 22 shouldBeTrue("gotCheckingEvent"); | |
| 23 shouldBeTrue("gotDownloadingEvent"); | |
| 24 shouldBe("window.applicationCache.status", "applicationCache.UNCACHED"); | |
| 25 | |
| 26 event = e; | |
| 27 shouldBeTrue("'reason' in event"); | |
| 28 shouldBeTrue("'url' in event"); | |
| 29 shouldBeTrue("'status' in event"); | |
| 30 shouldBeTrue("'message' in event"); | |
| 31 | |
| 32 shouldBeEqualToString("event.reason", "changed"); | |
| 33 shouldBeEqualToString("event.url", ""); | |
| 34 shouldBe("event.status", "0"); | |
| 35 | |
| 36 finishJSTest(); | |
| 37 } | |
| 38 | |
| 39 applicationCache.addEventListener('checking', onChecking, false); | |
| 40 applicationCache.addEventListener('downloading', onDownloading, false); | |
| 41 applicationCache.addEventListener('error', onError, false); | |
| 42 | |
| 43 </script> | |
| 44 </html> | |
| OLD | NEW |