Html程序  |  36行  |  872 B

<html manifest="https://127.0.0.1:8443/appcache/resources/different-https-origin-resource.manifest">
<script>
var hadError = false;
var result;

function finish()
{
    if (!hadError)
        result = "PASS";
    parent.postMessage(result, '*');
}
function fail()
{
    result = "FAIL: Different https origin resource is getting downloaded to cache.";
    hadError = true;
}
function error()
{
    result = "ERROR";
    hadError = true;
    finish();
}
function progressHandler(e)
{
    // The only resource listed in the manifest file is in a different https origin and should be skipped.
    if (e.loaded != 0 || e.total != 0)
        fail();
}

applicationCache.onprogress = progressHandler;
applicationCache.onnoupdate = function() { finish(); }
applicationCache.oncached = function() { finish(); }
applicationCache.onerror = function() { error(); }
</script>
</html>