1 <html manifest=
"resources/online-whitelist.manifest">
3 <p>Test online whitelist functionality. Should say PASS:
</p>
5 <div id=
"result"></div>
7 if (window
.testRunner
) {
8 testRunner
.dumpAsText()
9 testRunner
.waitUntilDone();
14 document
.getElementById("result").innerHTML
+= message
+ "<br>";
22 var req
= new XMLHttpRequest();
23 req
.open("GET", url
, false);
34 var req
= new XMLHttpRequest();
35 req
.open("GET", url
, false);
37 return req
.responseText
;
39 alert("Unexpected error loading " + url
+ ": " + ex
);
46 if (load("resources/counter.php?cached") != load("resources/counter.php?cached")) {
47 log("FAIL: Explicit entry didn't override online whitelist.");
51 if (load("resources/counter.php?uncached") == load("resources/counter.php?uncached")) {
52 log("FAIL: Online whitelist resource wasn't reloaded from network.");
56 if (load("resources/counter.php?uncachedxxx") == load("resources/counter.php?uncachedxxx")) {
57 log("FAIL: Online whitelist resource wasn't reloaded from network (prefix matching).");
61 if (canLoad("resources/counter.php?foobar")) {
62 log("FAIL: Uncached resource was successfully loaded.");
66 log(hadError
? "FAIL" : "PASS");
68 if (window
.testRunner
)
69 testRunner
.notifyDone();
72 applicationCache
.addEventListener('cached', test
, false);
73 applicationCache
.addEventListener('noupdate', test
, false);