Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <html manifest="fail-on-update.php"> | 1 <html manifest="fail-on-update.php"> |
| 2 <body> | 2 <body> |
| 3 <div id=result></div> | 3 <div id=result></div> |
| 4 <script> | 4 <script> |
| 5 function log(message) | 5 function log(message) |
| 6 { | 6 { |
| 7 document.getElementById("result").innerHTML += message + "<br>"; | 7 document.getElementById("result").innerHTML += message + "<br>"; |
| 8 } | 8 } |
| 9 | 9 |
| 10 function test() | 10 function test() |
| 11 { | 11 { |
| 12 log("cached") | 12 log("cached") |
| 13 log("status=" + applicationCache.status); | 13 log("status=" + applicationCache.status); |
| 14 applicationCache.onnoupdate = null; | 14 applicationCache.onnoupdate = null; |
| 15 | 15 |
| 16 // Associated to a cache, so loading should fail | 16 // Associated to a cache, so loading should fail |
| 17 try { | 17 try { |
| 18 var req = new XMLHttpRequest; | 18 var req = new XMLHttpRequest; |
| 19 req.open("GET", "empty.txt", false); | 19 req.open("GET", "empty.txt", false); |
| 20 req.setRequestHeader("Cache-control", "no-store"); | |
|
Nate Chapin
2013/09/12 23:28:46
Header added to make sure this gets all the way to
| |
| 20 req.send(null); | 21 req.send(null); |
| 21 alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exc eption"); | 22 alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exc eption"); |
| 22 } catch (ex) { | 23 } catch (ex) { |
| 23 } | 24 } |
| 24 log("There should be no messages below."); | 25 log("There should be no messages below."); |
| 25 parent.postMessage("frameDone", "*"); | 26 parent.postMessage("frameDone", "*"); |
| 26 } | 27 } |
| 27 | 28 |
| 28 applicationCache.onupdateready = function() { log("updateready"); alert("Unexpec ted onupdateready event in frame") } | 29 applicationCache.onupdateready = function() { log("updateready"); alert("Unexpec ted onupdateready event in frame") } |
| 29 applicationCache.onerror = function() { log("error"); alert("Unexpected error ev ent in frame") } | 30 applicationCache.onerror = function() { log("error"); alert("Unexpected error ev ent in frame") } |
| 30 applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected no update event in frame") } | 31 applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected no update event in frame") } |
| 31 applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected ob solete event in frame") } | 32 applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected ob solete event in frame") } |
| 32 | 33 |
| 33 applicationCache.oncached = test; | 34 applicationCache.oncached = test; |
| 34 | 35 |
| 35 </script> | 36 </script> |
| 36 </body> | 37 </body> |
| 37 </html> | 38 </html> |
| OLD | NEW |