Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / test / data / prerender / prerender_page_removes_pending.html
blobae70952f8bdd2633c6c43118727a90c233e3fd8d
1 <html>
2 <!--
3 This test checks to make sure that pending prerenders which are canceled
4 while pending never start.
5 -->
6 <link id=thePrerender rel=prerender href="does_not_exist.html" />
7 <head>
8 <title>Prerender Page</title>
10 <script src="prerender_events_common.js"></script>
12 <script>
13 var pageWasPrerendered = false;
15 function DidPrerenderPass() {
16 pageWasPrerendered = true;
17 var link = document.getElementById('thePrerender');
18 if (link)
19 link.parentElement.removeChild(link)
20 return !receivedPrerenderStartEvents[0] && !receivedPrerenderStopEvents[0];
23 // Make sure DidPrerenderPass() was called first. Otherwise, the page was
24 // most likely reloaded instead of using the prerendered page.
25 function DidDisplayPass() {
26 return pageWasPrerendered && !receivedPrerenderStartEvents[0] &&
27 !receivedPrerenderStopEvents[0];
30 var link = document.getElementById('thePrerender');
31 AddEventHandlersToLinkElement(link, 0);
32 </script>
34 </head>
35 <body></body>
36 </html>