Unregister from GCM when the only GCM app is removed
[chromium-blink-merge.git] / chrome / test / data / prerender / prerender_xhr_head.html
blobd78e9214795f1585b8e1abcff22178b989df93d8
1 <html>
2 <head>
3 <script>
4 var pageWasPrerendered = false;
6 // Make sure plugin was not loaded while prerendering.
7 function DidPrerenderPass() {
8 pageWasPrerendered = true;
9 return true;
12 // Make sure DidPrerenderPass() was called first. Otherwise, the page was
13 // most likely reloaded instead of using the prerendered page.
14 function DidDisplayPass() {
15 return pageWasPrerendered;
18 function do_xhr() {
19 var xhr = new XMLHttpRequest();
20 xhr.onreadystatechange = function() {
21 if(xhr.readyState == 4) {
22 if(xhr.status == 200) {
23 document.getElementById("dynamic").innerHTML =
24 "Received:" + xhr.responseText;
25 } else {
26 document.getElementById("dynamic").innerHTML =
27 "Error code: " + xhr.status;
32 xhr.open("HEAD", "prerender_xhr_head.html", true);
33 xhr.send(null);
36 do_xhr();
37 </script>
38 </head>
39 <body>
40 <div id="dynamic">
41 Waiting for XHR response.
42 </div>
43 </body>
44 </html>