1 <html manifest=
"resources/versioned-manifest.php">
3 <p>Test a simple offline application self-update process. Should print a series of messages followed with DONE:
</p>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText();
9 testRunner
.waitUntilDone();
14 document
.getElementById("result").innerHTML
+= message
+ "<br>";
17 function modifyManifest()
19 var req
= new XMLHttpRequest
;
20 req
.open("GET", "resources/versioned-manifest.php?command=step", false);
28 applicationCache
.oncached = function() { log("FAIL: Unexpected cached event") }
29 applicationCache
.onnoupdate = function() { log("FAIL: Unexpected noupdate event") }
30 applicationCache
.onupdateready = function() { setTimeout(test2
, 0) }
32 log("Updating cache group...");
33 setTimeout("applicationCache.update()", 0);
38 log((applicationCache
.status
== applicationCache
.UPDATEREADY
) ? "Cache status is UPDATEREADY" : ("FAIL: Incorrect cache status, " + applicationCache
.status
));
41 applicationCache
.onupdateready = function() { setTimeout(test3
, 0) }
43 log("Updating cache group once more...");
44 setTimeout("applicationCache.update()", 0);
49 log((applicationCache
.status
== applicationCache
.UPDATEREADY
) ? "Cache status is UPDATEREADY" : ("FAIL: Incorrect cache status, " + applicationCache
.status
));
51 log("Associating document with the newest cache version...");
52 applicationCache
.swapCache();
54 log((applicationCache
.status
== applicationCache
.IDLE
) ? "Cache status is IDLE" : ("FAIL: Incorrect cache status, " + applicationCache
.status
));
57 if (window
.testRunner
)
58 testRunner
.notifyDone();
61 applicationCache
.oncached
= test
;
62 applicationCache
.onnoupdate
= test
;
63 applicationCache
.onupdateready = function() { log("FAIL: Unexpected updateready event") }
64 applicationCache
.onerror = function() { log("FAIL: Unexpected error event") }
65 applicationCache
.onobsolete = function() { log("FAIL: Unexpected obsolete event") }