test.html (1347B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="UTF-8" /> 5 <!-- random words that should not end up on disk --> 6 <title>gigantic experience</title> 7 </head> 8 <body> 9 <h1>focus test page</h1> 10 <!-- More random words that should not end up on disk --> 11 <p>groovy rabbits</p> 12 <p>This test page installs a service worker and saves a cookie.</p> 13 14 <h2 id="cookieHeading">Cookie</h2> 15 <p> 16 Initial: 17 <script type="text/javascript"> 18 document.write(document.cookie); 19 </script> 20 </p> 21 <p> 22 <!-- Setting a cookie --> 23 <script type="text/javascript"> 24 document.cookie = 25 "birthday=armchair; expires=Tue, 18 Dec 2035 12:00:00 UTC; path=/"; 26 document.write("Cookie saved"); 27 </script> 28 </p> 29 <p> 30 Afterwards: 31 <script type="text/javascript"> 32 document.write(document.cookie); 33 </script> 34 </p> 35 36 <h2>Service worker</h2> 37 <p id="status"></p> 38 39 <script type="text/javascript"> 40 // Add a key value pair to local storage. This is required by WebViewDataTest which asserts 41 // that the local storage directory should exist 42 var script = document.createElement("script"); 43 script.src = "service-worker.js"; 44 45 document.head.appendChild(script); //or something of the likes 46 </script> 47 </body> 48 </html>