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

Side by Side Diff: chrome/test/data/prerender/prerender_xhr_get.html

Issue 6901128: Cancel prerenders that spawn post requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Method name changes and more tests. Created 9 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script>
4 var pageWasPrerendered = false;
5
6 // Make sure plugin was not loaded while prerendering.
7 function DidPrerenderPass() {
8 pageWasPrerendered = true;
9 return true;
10 }
11
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;
16 }
17
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 =
cbentzel 2011/05/02 20:27:38 Is it guaranteed that the GET will have been issue
dominich 2011/05/02 21:04:55 No. I could change the XHRequests to be synchronou
cbentzel 2011/05/03 14:24:46 OK.
24 "Received:" + xhr.responseText;
25 } else {
26 document.getElementById("dynamic").innerHTML =
27 "Error code: " + xhr.status;
28 }
29 }
30 };
31
32 xhr.open("GET", "prerender_xhr_get.html", true);
33 xhr.send(null);
34 }
35
36 do_xhr();
37 </script>
38 </head>
39 <body>
40 <div id="dynamic">
41 Waiting for XHR response.
42 </div>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698