<html manifest="THIS_FILE_DOES_NOT_EXIST.manifest">
<head>
  <script type="text/javascript">
    var onloadHasBeenCalled = false;
    var oncheckingAfterOnload = false;

    if (window.testRunner) {
        testRunner.dumpAsText()
        testRunner.waitUntilDone();
    }

    window.applicationCache.onchecking = function() {
        oncheckingAfterOnload = onloadHasBeenCalled;
    }

    window.applicationCache.onerror = function() {
        document.getElementById('result').innerHTML = oncheckingAfterOnload ? "PASS" : "FAIL";
        if (window.testRunner)
            testRunner.notifyDone();
    }

    window.applicationCache.oncached = function() {
        document.getElementById('result').innerHTML = "FAIL: oncached event received";
        if (window.testRunner)
            testRunner.notifyDone();
    }
  </script>
  <script src="THIS_FILE_DOES_NOT_EXIST.js" type="text/javascript"></script>
</head>
<body onload="onloadHasBeenCalled = true">
Test that AppicationCache events are deferred until after onload has been fired.
<div id="result">FAILURE</div>
</body>
</html>
