blob: 540f769ba2ee15ea75013bee48828501e6d29dda [file] [log] [blame]
<html manifest="fail-on-update.php">
<!--
Generate this token with the command:
tools/origin_trials/generate_token.py http://127.0.0.1:8000 AppCache --expire-days=2000
-->
<meta http-equiv="origin-trial" content="AnwB3aSh6U8pmYtO/AzzxELSwk8BRJoj77nUnCq6u3N8LMJKlX/ImydQmXn3SgE0a+8RyowLbV835tXQHJMHuAEAAABQeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQXBwQ2FjaGUiLCAiZXhwaXJ5IjogMTc2MTE3NjE5OH0=">
<body>
<div id=result></div>
<script>
function log(message)
{
document.getElementById("result").innerHTML += message + "<br>";
}
function test()
{
log("cached")
log("status=" + applicationCache.status);
applicationCache.onnoupdate = null;
// Associated to a cache, so loading should fail
try {
var req = new XMLHttpRequest;
req.open("GET", "empty.txt", false);
req.setRequestHeader("Cache-control", "no-store");
req.send(null);
alert("FAIL: XMLHttpRequest for an uncached resource didn't raise an exception");
} catch (ex) {
}
log("There should be no messages below.");
parent.postMessage("frameDone", "*");
}
applicationCache.onupdateready = function() { log("updateready"); alert("Unexpected onupdateready event in frame") }
applicationCache.onerror = function() { log("error"); alert("Unexpected error event in frame") }
applicationCache.onnoupdate = function() { log("noupdate"); alert("Unexpected noupdate event in frame") }
applicationCache.onobsolete = function() { log("obsolete"); alert("Unexpected obsolete event in frame") }
applicationCache.oncached = test;
</script>
</body>
</html>