1 <html manifest="xhr-foreign-resource-2.manifest"> 2 <body> 3 <div id=result></div> 4 <script> 5 function log(message) 6 { 7 document.getElementById("result").innerHTML += message + "<br>"; 8 } 9 10 function cached() 11 { 12 applicationCache.onnoupdate = null; 13 applicationCache.oncached = null; 14 15 // simple.txt is only listed s a resource in main frame's manifest, so loading should fail. 16 try { 17 var req = new XMLHttpRequest; 18 req.open("GET", "simple.txt", false); 19 req.send(""); 20 log("FAIL"); 21 log("applicationCache.status = " + applicationCache.status); 22 parent.postMessage("FAIL", "*"); 23 } catch (ex) { 24 log("Frame OK"); 25 parent.postMessage("SUCCESS", "*"); 26 } 27 } 28 29 applicationCache.onnoupdate = cached; 30 applicationCache.oncached = cached; 31 32 applicationCache.onupdateready = function() { log("FAIL: received unexpected updateready event") } 33 applicationCache.onerror = function() { log("FAIL: received unexpected error event") } 34 </script> 35 </body> 36 </html> 37