blob: 251a8e0a449e5c3c54ab3164b895e8a6f3fd839f [file] [log] [blame]
<!DOCTYPE HTML>
<html manifest="resources/fail-on-update.php">
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function setManifestDeleted(state, callback)
{
var req = new XMLHttpRequest;
req.onreadystatechange = function() {
if (req.readyState == 4)
callback();
}
req.open("GET", "resources/fail-on-update.php?command=" + (state ? "delete" : "reset"));
req.send(null);
}
function test()
{
clearTimeout(timeoutId);
setManifestDeleted(true, afterDelete);
function afterDelete()
{
applicationCache.update();
window.location = 'resources/notify-no-crash.html';
}
}
function resetManifest()
{
if (applicationCache.status != applicationCache.UNCACHED && applicationCache.status != applicationCache.OBSOLETE) {
timeoutId = setTimeout(resetManifest, 100);
return;
}
setManifestDeleted(false, function() {
location.reload();
});
}
applicationCache.addEventListener('noupdate', function() { setTimeout(test, 0) }, false);
applicationCache.addEventListener('cached', function() { setTimeout(test, 0) }, false);
// If the manifest script happened to be in a wrong state, reset it.
var timeoutId = setTimeout(resetManifest, 100);
</script>
<p>Test for a particular incorrect assertion failure.</p>
</html>