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

Side by Side Diff: chrome/browser/prerender/prerender_browsertest.cc

Issue 6966016: Handle <link rel=prerender> in chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <deque> 5 #include <deque>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/content_settings/host_content_settings_map.h" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 } 455 }
456 } 456 }
457 457
458 WaitForLoadPrerenderContentsFactory* prerender_contents_factory_; 458 WaitForLoadPrerenderContentsFactory* prerender_contents_factory_;
459 GURL dest_url_; 459 GURL dest_url_;
460 bool use_https_src_server_; 460 bool use_https_src_server_;
461 bool call_javascript_; 461 bool call_javascript_;
462 }; 462 };
463 463
464 // Checks that a page is correctly prerendered in the case of a 464 // Checks that a page is correctly prerendered in the case of a
465 // <link rel=prefetch> tag and then loaded into a tab in response to a 465 // <link rel=prerender> tag and then loaded into a tab in response to a
466 // navigation. 466 // navigation.
467 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPage) { 467 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPage) {
468 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1); 468 PrerenderTestURL("files/prerender/prerender_page.html", FINAL_STATUS_USED, 1);
469 NavigateToDestURL(); 469 NavigateToDestURL();
470 } 470 }
471 471
472 // Checks that the prerendering of a page is canceled correctly when a 472 // Checks that the prerendering of a page is canceled correctly when a
473 // Javascript alert is called. 473 // Javascript alert is called.
474 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderAlertBeforeOnload) { 474 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderAlertBeforeOnload) {
475 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html", 475 PrerenderTestURL("files/prerender/prerender_alert_before_onload.html",
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // This version navigates to the final destination page, rather than the 542 // This version navigates to the final destination page, rather than the
543 // page which does the redirection. 543 // page which does the redirection.
544 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, 544 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest,
545 PrerenderClientRedirectNavigateToSecond) { 545 PrerenderClientRedirectNavigateToSecond) {
546 PrerenderTestURL(CreateClientRedirect("files/prerender/prerender_page.html"), 546 PrerenderTestURL(CreateClientRedirect("files/prerender/prerender_page.html"),
547 FINAL_STATUS_USED, 547 FINAL_STATUS_USED,
548 2); 548 2);
549 NavigateToURL("files/prerender/prerender_page.html"); 549 NavigateToURL("files/prerender/prerender_page.html");
550 } 550 }
551 551
552 // Checks that a prefetch for an https will prevent a prerender from happening. 552 // Checks that a prerender for an https will prevent a prerender from happening.
553 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHttps) { 553 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHttps) {
554 net::TestServer https_server(net::TestServer::TYPE_HTTPS, 554 net::TestServer https_server(net::TestServer::TYPE_HTTPS,
555 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); 555 FilePath(FILE_PATH_LITERAL("chrome/test/data")));
556 ASSERT_TRUE(https_server.Start()); 556 ASSERT_TRUE(https_server.Start());
557 GURL https_url = https_server.GetURL("files/prerender/prerender_page.html"); 557 GURL https_url = https_server.GetURL("files/prerender/prerender_page.html");
558 PrerenderTestURL(https_url, 558 PrerenderTestURL(https_url,
559 FINAL_STATUS_HTTPS, 559 FINAL_STATUS_HTTPS,
560 1); 560 1);
561 } 561 }
562 562
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 PrerenderTestURL("files/prerender/prerender_page.html", 1139 PrerenderTestURL("files/prerender/prerender_page.html",
1140 FINAL_STATUS_WINDOW_OPENER, 1140 FINAL_STATUS_WINDOW_OPENER,
1141 1); 1141 1);
1142 OpenDestUrlInNewWindowViaClick(); 1142 OpenDestUrlInNewWindowViaClick();
1143 } 1143 }
1144 1144
1145 // TODO(shishir): Add a test for the case when the page having the 1145 // TODO(shishir): Add a test for the case when the page having the
1146 // prerendering link already has an opener set. 1146 // prerendering link already has an opener set.
1147 1147
1148 } // namespace prerender 1148 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prerender/prerender_field_trial.cc » ('j') | chrome/test/data/prerender/prerender_loader.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698