diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-15 21:15:14 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-15 21:15:14 +0000 |
commit | db0a8ec1f7d23bb4eb68b02318f1fec45bf2e00f (patch) | |
tree | d7d466723dc550afb899b1f8f7b127b90850fdad /chrome/browser/prerender/prerender_browsertest.cc | |
parent | cfb80d827b3fe66b04e595d8cd2ce2a76c905fde (diff) | |
download | chromium_src-db0a8ec1f7d23bb4eb68b02318f1fec45bf2e00f.zip chromium_src-db0a8ec1f7d23bb4eb68b02318f1fec45bf2e00f.tar.gz chromium_src-db0a8ec1f7d23bb4eb68b02318f1fec45bf2e00f.tar.bz2 |
Revert 75001 - Cancel prerender if any of the visited URLs are https.
BUG=72486
TEST=added new unit_tests and browser_tests
Manual Test: With preendering enabled, do a search for "yahoo mail". Prerendering should be canceled
due to https.
Review URL: http://codereview.chromium.org/6480077
TBR=cbentzel@chromium.org
Review URL: http://codereview.chromium.org/6523035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75009 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_browsertest.cc')
-rw-r--r-- | chrome/browser/prerender/prerender_browsertest.cc | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index 2b35310..f946e03 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -111,19 +111,14 @@ class PrerenderBrowserTest : public InProcessBrowserTest { FinalStatus expected_final_status, int total_navigations) { ASSERT_TRUE(test_server()->Start()); + + std::string src_path = "files/prerender/prerender_loader.html?"; + src_path.append(html_file); std::string dest_path = "files/prerender/"; dest_path.append(html_file); - dest_url_ = test_server()->GetURL(dest_path); - std::vector<net::TestServer::StringPair> replacement_text; - replacement_text.push_back( - make_pair("REPLACE_WITH_PREFETCH_URL", dest_url_.spec())); - std::string replacement_path; - ASSERT_TRUE(net::TestServer::GetFilePathWithReplacements( - "files/prerender/prerender_loader.html", - replacement_text, - &replacement_path)); - GURL src_url = test_server()->GetURL(replacement_path); + GURL src_url = test_server()->GetURL(src_path); + dest_url_ = test_server()->GetURL(dest_path); Profile* profile = browser()->GetSelectedTabContents()->profile(); PrerenderManager* prerender_manager = profile->GetPrerenderManager(); @@ -257,23 +252,4 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPopup) { FINAL_STATUS_CREATE_NEW_WINDOW, 1); } -// Test that page-based redirects to https will cancel prerenders. -IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderRedirectToHttps) { - net::TestServer https_server(net::TestServer::TYPE_HTTPS, - FilePath(FILE_PATH_LITERAL("chrome/test/data"))); - ASSERT_TRUE(https_server.Start()); - GURL https_url = https_server.GetURL("files/prerender/prerender_page.html"); - std::vector<net::TestServer::StringPair> replacement_text; - replacement_text.push_back( - make_pair("REPLACE_WITH_HTTPS_URL", https_url.spec())); - std::string redirect_path; - ASSERT_TRUE(net::TestServer::GetFilePathWithReplacements( - "prerender_redirect_to_https.html", - replacement_text, - &redirect_path)); - PrerenderTestURL(redirect_path, - FINAL_STATUS_HTTPS, - 2); -} - } // namespace prerender |