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

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

Issue 10381106: Add tests for referrer policy and prerendering (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | chrome/test/data/prerender/prerender_loader_with_referrer_policy.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 // asynchronously. 2148 // asynchronously.
2149 WebContents* web_contents = browser()->GetSelectedWebContents(); 2149 WebContents* web_contents = browser()->GetSelectedWebContents();
2150 bool display_test_result = false; 2150 bool display_test_result = false;
2151 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( 2151 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool(
2152 web_contents->GetRenderViewHost(), L"", 2152 web_contents->GetRenderViewHost(), L"",
2153 L"DidDisplayReallyPass()", 2153 L"DidDisplayReallyPass()",
2154 &display_test_result)); 2154 &display_test_result));
2155 ASSERT_TRUE(display_test_result); 2155 ASSERT_TRUE(display_test_result);
2156 } 2156 }
2157 2157
2158 // Checks that the referrer policy is used when prerendering.
2159 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderReferrerPolicy) {
2160 set_loader_path("files/prerender/prerender_loader_with_referrer_policy.html");
2161 PrerenderTestURL("files/prerender/prerender_referrer_policy.html",
2162 FINAL_STATUS_USED,
2163 1);
2164 NavigateToDestURL();
2165 }
2166
2167 // Checks that the referrer policy is used when prerendering on HTTPS.
2168 IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderSSLReferrerPolicy) {
2169 set_use_https_src(true);
2170 set_loader_path("files/prerender/prerender_loader_with_referrer_policy.html");
2171 PrerenderTestURL("files/prerender/prerender_referrer_policy.html",
2172 FINAL_STATUS_USED,
2173 1);
2174 NavigateToDestURL();
2175 }
2176
2158 } // namespace prerender 2177 } // namespace prerender
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/prerender/prerender_loader_with_referrer_policy.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698