Home | History | Annotate | Download | only in appcache
      1 <html manifest="resources/wrong-signature-2.manifest">
      2 <body>
      3 <p>Test that a manifest served with a wrong signature isn't treated as such.</p>
      4 <p>Should say SUCCESS:</p>
      5 <div id=result></div>
      6 <script>
      7 if (window.layoutTestController) {
      8     layoutTestController.dumpAsText()
      9     layoutTestController.waitUntilDone();
     10 }
     11 
     12 function log(message)
     13 {
     14     document.getElementById("result").innerHTML += message + "<br>";
     15 }
     16 
     17 function cacheCallback()
     18 {
     19     log("FAIL: An event was dispatched on window.applicationCache, even though it was not associated wuth any cache yet.");
     20 }
     21 
     22 function test()
     23 {
     24     // Wait for cache update to finish.
     25     if (window.applicationCache.status != window.applicationCache.UNCACHED)
     26         log("FAILURE: Unexpected cache status: " + window.applicationCache.status);
     27     else
     28         log("SUCCESS");
     29 
     30     if (window.layoutTestController)
     31         layoutTestController.notifyDone();
     32 }
     33 
     34 applicationCache.addEventListener('cached', function() { log("cached"); cacheCallback() }, false);
     35 applicationCache.addEventListener('noupdate', function() { log("noupdate"); cacheCallback() }, false);
     36 applicationCache.addEventListener('error', test, false);
     37 
     38 </script>
     39 </body>
     40 </html>
     41