Index: chrome/test/data/prerender/prerender_loader.html |
diff --git a/chrome/test/data/prerender/prerender_loader.html b/chrome/test/data/prerender/prerender_loader.html |
index 9fed87a2f2a6990bbb1c8ad0dbb3830e274895fb..07dce525d42b32ee19d297b513d8a3de4928658c 100644 |
--- a/chrome/test/data/prerender/prerender_loader.html |
+++ b/chrome/test/data/prerender/prerender_loader.html |
@@ -3,6 +3,25 @@ |
<title>Preloader</title> |
<script> |
+ var receivedPrerenderStartEvent = false; |
+ var receivedPrerenderStopEvent = false; |
+ |
+ function PrerenderStartHandler() { |
+ receivedPrerenderStartEvent = true; |
+ } |
+ |
+ function PrerenderStopHandler() { |
+ receivedPrerenderStopEvent = true; |
+ } |
+ |
+ function ReceivedPrerenderStartEvent() { |
+ return receivedPrerenderStartEvent; |
+ } |
+ |
+ function ReceivedPrerenderStopEvent() { |
+ return receivedPrerenderStopEvent; |
+ } |
+ |
function Click() { |
var eventObject = document.createEvent('MouseEvents'); |
eventObject.initMouseEvent('click'); |
@@ -63,7 +82,10 @@ |
</head> |
<body> |
<script> |
- document.write('<link rel="prerender" href="REPLACE_WITH_PRERENDER_URL"/>'); |
+ document.write('<link id="theprerender" rel="prerender" href="REPLACE_WITH_PRERENDER_URL"/>'); |
+ prerender = document.getElementById('theprerender'); |
+ prerender.addEventListener('webkitprerenderstart', PrerenderStartHandler, false); |
+ prerender.addEventListener('webkitprerenderstop', PrerenderStopHandler, false); |
</script> |
<a target="_blank" id="toClickTarget" |
href="REPLACE_WITH_DESTINATION_URL">Link To click in new window</a> |