| <html manifest="resources/simple.manifest"> |
| testRunner.waitUntilDone(); |
| // Load a resource that does not exist in the cache. |
| var req = new XMLHttpRequest(); |
| req.open("GET", "resources/not-in-cache.txt", false); |
| if (e.code == DOMException.NETWORK_ERR) |
| document.getElementById('result').innerHTML = "FAILURE: Did not get the right exception" |
| // Load a resource that exists in the cache. |
| var req = new XMLHttpRequest(); |
| req.open("GET", "resources/simple.txt", false); |
| document.getElementById('result').innerHTML = "FAILURE: Could not load data from cache" |
| if (req.responseText != 'Hello, World!') { |
| document.getElementById('result').innerHTML = "FAILURE: Did not get correct data from cached resource" |
| document.getElementById('result').innerHTML = "SUCCESS" |
| applicationCache.addEventListener('cached', cached, false); |
| applicationCache.addEventListener('noupdate', cached, false); |
| <div>This tests that the application cache works by first loading a file that does not exist in the cache (to verify that a cache has been associated) and then loads a file that is in the cache</div> |
| <div id="result">FAILURE</div> |