Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1907)

Unified Diff: chrome/test/data/prerender/prerender_loader.html

Issue 10918189: Add PrerenderStatusEvent on Prerenders (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase to trunk, remove some unrelated fixes... Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
« no previous file with comments | « chrome/renderer/prerender/prerender_dispatcher_unittest.cc ('k') | chrome/test/data/prerender/prerender_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698