blob: a5e6f383c788bafaad6fa75e70abe0c88c12f627 [file] [log] [blame]
<html manifest="resources/resource-redirect.manifest">
<!--
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=">
<script src="/js-test-resources/js-test.js"></script>
<script>
var jsTestIsAsync = true;
description("Test that a redirect makes resource caching fail.");
function unexpectedCallback(eventName)
{
testFailed("An unexpected " + eventName + " event was dispatched on window.applicationCache.");
finishJSTest();
}
function test(e)
{
shouldBe("window.applicationCache.status", "window.applicationCache.UNCACHED");
event = e;
shouldBeEqualToString("event.reason", "resource");
shouldBeEqualToString("event.url", "http://127.0.0.1:8000/appcache/resources/resource-redirect.php");
shouldBe("event.status", "307");
shouldBeTrue("'message' in event");
finishJSTest();
}
applicationCache.addEventListener('cached', function() { unexpectedCallback("cached"); }, false);
applicationCache.addEventListener('noupdate', function() { unexpectedCallback("noupdate"); }, false);
applicationCache.addEventListener('error', test, false);
</script>
</body>
</html>