OLD | NEW |
1 <html xmlns="http://www.w3.org/1999/xhtml" | 1 <html xmlns="http://www.w3.org/1999/xhtml" |
2 manifest="/resources/network-simulator.php?path=/appcache/resources/non-ht
ml.manifest"> | 2 manifest="/resources/network-simulator.php?path=/appcache/resources/non-ht
ml.manifest"> |
3 <head><title/></head> | 3 <head><title/></head> |
4 <body> | 4 <body> |
5 <p>Test that non-HTML main resources work with application cache correctly.</p> | 5 <p>Test that non-HTML main resources work with application cache correctly.</p> |
6 <p>Should say SUCCESS:</p> | 6 <p>Should say SUCCESS:</p> |
7 <div id="result"></div> | 7 <div id="result"></div> |
8 <script type="text/javascript"> | 8 <script type="text/javascript"> |
9 if (window.testRunner) { | 9 if (window.testRunner) { |
10 testRunner.dumpAsText() | 10 testRunner.dumpAsText() |
(...skipping 28 matching lines...) Expand all Loading... |
39 applicationCache.removeEventListener('cached', cached, false); | 39 applicationCache.removeEventListener('cached', cached, false); |
40 | 40 |
41 setNetworkEnabled(false); | 41 setNetworkEnabled(false); |
42 | 42 |
43 // Load a resource that does not exist in the cache. | 43 // Load a resource that does not exist in the cache. |
44 try { | 44 try { |
45 var req = new XMLHttpRequest(); | 45 var req = new XMLHttpRequest(); |
46 req.open("GET", "/resources/network-simulator.php?path=/appcache/resourc
es/not-in-cache.txt", false); | 46 req.open("GET", "/resources/network-simulator.php?path=/appcache/resourc
es/not-in-cache.txt", false); |
47 req.send(); | 47 req.send(); |
48 } catch (e) { | 48 } catch (e) { |
49 if (e.code == XMLHttpRequestException.NETWORK_ERR) | 49 if (e.code == DOMException.NETWORK_ERR) |
50 hadError = true; | 50 hadError = true; |
51 } | 51 } |
52 | 52 |
53 if (!hadError) { | 53 if (!hadError) { |
54 document.getElementById('result').innerHTML = "FAILURE: Did not get the
right exception" | 54 document.getElementById('result').innerHTML = "FAILURE: Did not get the
right exception" |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 // Load a resource that exists in the cache. | 58 // Load a resource that exists in the cache. |
59 try { | 59 try { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 | 97 |
98 applicationCache.addEventListener('cached', cached, false); | 98 applicationCache.addEventListener('cached', cached, false); |
99 applicationCache.addEventListener('noupdate', cached, false); | 99 applicationCache.addEventListener('noupdate', cached, false); |
100 | 100 |
101 applicationCache.onerror = error; | 101 applicationCache.onerror = error; |
102 | 102 |
103 </script> | 103 </script> |
104 </body> | 104 </body> |
105 </html> | 105 </html> |
OLD | NEW |