blob: 9e622a81b5249608e4dedd8c9e6f0ec6f729ecfa [file] [log] [blame]
<html manifest="resources/manifest-redirect.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>
<p>Test that a redirect makes resource caching fail.</p>
<p>Should say SUCCESS:</p>
<div id=result></div>
<script>
if (window.testRunner) {
testRunner.dumpAsText()
testRunner.waitUntilDone();
}
function log(message)
{
document.getElementById("result").innerHTML += message + "<br>";
}
function cacheCallback()
{
log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
}
function test()
{
// Wait for cache update to finish.
if (window.applicationCache.status != window.applicationCache.UNCACHED)
log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
else
log("SUCCESS");
if (window.testRunner)
testRunner.notifyDone();
}
applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
applicationCache.addEventListener('error', test, false);
</script>
</body>
</html>