OLD | NEW |
1 <html manifest="resources/simple.manifest"> | 1 <html manifest="resources/simple.manifest"> |
2 <script> | 2 <script> |
3 if (window.testRunner) { | 3 if (window.testRunner) { |
4 testRunner.dumpAsText() | 4 testRunner.dumpAsText() |
5 testRunner.waitUntilDone(); | 5 testRunner.waitUntilDone(); |
6 } | 6 } |
7 | 7 |
8 function cached() | 8 function cached() |
9 { | 9 { |
10 var hadError = false; | 10 var hadError = false; |
11 | 11 |
12 // Load a resource that does not exist in the cache. | 12 // Load a resource that does not exist in the cache. |
13 try { | 13 try { |
14 var req = new XMLHttpRequest(); | 14 var req = new XMLHttpRequest(); |
15 req.open("GET", "resources/not-in-cache.txt", false); | 15 req.open("GET", "resources/not-in-cache.txt", false); |
16 req.send(); | 16 req.send(); |
17 } catch (e) { | 17 } catch (e) { |
18 if (e.code == XMLHttpRequestException.NETWORK_ERR) | 18 if (e.code == DOMException.NETWORK_ERR) |
19 hadError = true; | 19 hadError = true; |
20 } | 20 } |
21 | 21 |
22 if (!hadError) { | 22 if (!hadError) { |
23 document.getElementById('result').innerHTML = "FAILURE: Did not get the
right exception" | 23 document.getElementById('result').innerHTML = "FAILURE: Did not get the
right exception" |
24 return; | 24 return; |
25 } | 25 } |
26 | 26 |
27 // Load a resource that exists in the cache. | 27 // Load a resource that exists in the cache. |
28 try { | 28 try { |
(...skipping 17 matching lines...) Expand all Loading... |
46 } | 46 } |
47 | 47 |
48 applicationCache.addEventListener('cached', cached, false); | 48 applicationCache.addEventListener('cached', cached, false); |
49 applicationCache.addEventListener('noupdate', cached, false); | 49 applicationCache.addEventListener('noupdate', cached, false); |
50 | 50 |
51 </script> | 51 </script> |
52 <div>This tests that the application cache works by first loading a file that do
es not exist in the cache (to verify that a cache has been associated) and then
loads a file that is in the cache</div> | 52 <div>This tests that the application cache works by first loading a file that do
es not exist in the cache (to verify that a cache has been associated) and then
loads a file that is in the cache</div> |
53 | 53 |
54 <div id="result">FAILURE</div> | 54 <div id="result">FAILURE</div> |
55 </html> | 55 </html> |
OLD | NEW |