1 <html manifest="access-via-redirect.manifest"> 2 3 <p>This tests that the start of redirect chain doesn't get into an application cache if the end of the chain has a manifest.</p> 4 <p id="result">FAILURE</p> 5 6 <script> 7 if (window.layoutTestController) { 8 layoutTestController.dumpAsText() 9 layoutTestController.waitUntilDone(); 10 } 11 12 function canLoad(url) 13 { 14 try { 15 var req = new XMLHttpRequest(); 16 req.open("GET", url, false); 17 req.send(""); 18 return true; 19 } catch (e) { 20 return false; 21 } 22 } 23 24 function cached() 25 { 26 if (canLoad("/appcache/access-via-redirect.php")) { 27 document.getElementById('result').innerHTML = "FAILURE: Start of redirect chain is in cache." 28 return; 29 } 30 31 if (!canLoad("access-via-redirect.html")) { 32 document.getElementById('result').innerHTML = "FAILURE: Could not load main resource from cache." 33 return; 34 } 35 36 document.getElementById('result').innerHTML = "SUCCESS" 37 38 if (window.layoutTestController) 39 layoutTestController.notifyDone(); 40 } 41 42 applicationCache.addEventListener('cached', cached, false); 43 applicationCache.addEventListener('noupdate', cached, false); 44 45 </script> 46 </html> 47