Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / appcache / online-whitelist.html
blobe58812b72a4f73d7193ae0adf419bc14bc924b92
1 <html manifest="resources/online-whitelist.manifest">
2 <body>
3 <p>Test online whitelist functionality. Should say PASS:</p>
5 <div id="result"></div>
6 <script>
7 if (window.testRunner) {
8 testRunner.dumpAsText()
9 testRunner.waitUntilDone();
12 function log(message)
14 document.getElementById("result").innerHTML += message + "<br>";
17 var hadError = false;
19 function canLoad(url)
21 try {
22 var req = new XMLHttpRequest();
23 req.open("GET", url, false);
24 req.send("");
25 return true;
26 } catch (e) {
27 return false;
31 function load(url)
33 try {
34 var req = new XMLHttpRequest();
35 req.open("GET", url, false);
36 req.send("");
37 return req.responseText;
38 } catch (ex) {
39 alert("Unexpected error loading " + url + ": " + ex);
40 hadError = true;
44 function test()
46 if (load("resources/counter.php?cached") != load("resources/counter.php?cached")) {
47 log("FAIL: Explicit entry didn't override online whitelist.");
48 hadError = true;
51 if (load("resources/counter.php?uncached") == load("resources/counter.php?uncached")) {
52 log("FAIL: Online whitelist resource wasn't reloaded from network.");
53 hadError = true;
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).");
58 hadError = true;
61 if (canLoad("resources/counter.php?foobar")) {
62 log("FAIL: Uncached resource was successfully loaded.");
63 hadError = true;
66 log(hadError ? "FAIL" : "PASS");
68 if (window.testRunner)
69 testRunner.notifyDone();
72 applicationCache.addEventListener('cached', test, false);
73 applicationCache.addEventListener('noupdate', test, false);
75 </script>
76 </body>
77 </html>