| <html manifest="does-not-exist.manifest"> |
| <!-- |
| Generate this token with the command: |
| tools/origin_trials/generate_token.py http://127.0.0.1:8000 AppCache --expire-days=2000 |
| --> |
| <meta http-equiv="origin-trial" content="AnwB3aSh6U8pmYtO/AzzxELSwk8BRJoj77nUnCq6u3N8LMJKlX/ImydQmXn3SgE0a+8RyowLbV835tXQHJMHuAEAAABQeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQXBwQ2FjaGUiLCAiZXhwaXJ5IjogMTc2MTE3NjE5OH0="> |
| |
| <script src="/js-test-resources/js-test.js"></script> |
| <script> |
| var jsTestIsAsync = true; |
| description("Test that subresources can be loaded if manifest is not available."); |
| |
| function unexpectedEvent(name) |
| { |
| testFailed("Unexpected " + name + " event."); |
| finishJSTest(); |
| } |
| |
| applicationCache.addEventListener('noupdate', function() { unexpectedEvent("noupdate") }, false); |
| applicationCache.addEventListener('downloading', function() { unexpectedEvent("downloading") }, false); |
| applicationCache.addEventListener('progress', function() { unexpectedEvent("progress") }, false); |
| applicationCache.addEventListener('updateready', function() { unexpectedEvent("updateready") }, false); |
| applicationCache.addEventListener('cached', function() { unexpectedEvent("cached") }, false); |
| applicationCache.addEventListener('obsolete', function() { unexpectedEvent("obsolete") }, false); |
| |
| function test(e) |
| { |
| shouldBeTrue("gotCheckingEvent"); |
| shouldBe("window.applicationCache.status", "applicationCache.UNCACHED"); |
| |
| event = e; |
| shouldBeEqualToString("event.reason", "manifest"); |
| shouldBeEqualToString("event.url", "http://127.0.0.1:8000/appcache/does-not-exist.manifest"); |
| shouldBe("event.status", "404"); |
| shouldBeTrue("'message' in event"); |
| |
| // The manifest failed to load, so there should be no cache, and subresources should be loaded normally. |
| try { |
| req = new XMLHttpRequest(); |
| req.open("GET", "resources/simple.txt", false); |
| req.send(); |
| |
| shouldBeEqualToString("req.responseText", 'Hello, World!'); |
| } catch (e) { |
| testFailed("Could not load data."); |
| } |
| |
| finishJSTest(); |
| } |
| |
| var gotCheckingEvent = false; |
| applicationCache.addEventListener('checking', function() { gotCheckingEvent = true; }, false); |
| applicationCache.addEventListener('error', test, false); |
| |
| </script> |
| </html> |