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

Side by Side Diff: chrome/browser/history/redirect_browsertest.cc

Issue 12767006: [Cleanup] Remove StringPrintf from global namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, once more Created 7 years, 9 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) 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 // Navigates the browser to server and client redirect pages and makes sure 5 // Navigates the browser to server and client redirect pages and makes sure
6 // that the correct redirects are reflected in the history database. Errors 6 // that the correct redirects are reflected in the history database. Errors
7 // here might indicate that WebKit changed the calls our glue layer gets in 7 // here might indicate that WebKit changed the calls our glue layer gets in
8 // the case of redirects. It may also mean problems with the history system. 8 // the case of redirects. It may also mean problems with the history system.
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 // http://code.google.com/p/chromium/issues/detail?id=62772 117 // http://code.google.com/p/chromium/issues/detail?id=62772
118 IN_PROC_BROWSER_TEST_F(RedirectTest, ClientEmptyReferer) { 118 IN_PROC_BROWSER_TEST_F(RedirectTest, ClientEmptyReferer) {
119 ASSERT_TRUE(test_server()->Start()); 119 ASSERT_TRUE(test_server()->Start());
120 120
121 // Create the file contents, which will do a redirect to the 121 // Create the file contents, which will do a redirect to the
122 // test server. 122 // test server.
123 GURL final_url = test_server()->GetURL(std::string()); 123 GURL final_url = test_server()->GetURL(std::string());
124 ASSERT_TRUE(final_url.is_valid()); 124 ASSERT_TRUE(final_url.is_valid());
125 std::string file_redirect_contents = StringPrintf( 125 std::string file_redirect_contents = base::StringPrintf(
126 "<html>" 126 "<html>"
127 "<head></head>" 127 "<head></head>"
128 "<body onload=\"document.location='%s'\"></body>" 128 "<body onload=\"document.location='%s'\"></body>"
129 "</html>", 129 "</html>",
130 final_url.spec().c_str()); 130 final_url.spec().c_str());
131 131
132 // Write the contents to a temporary file. 132 // Write the contents to a temporary file.
133 base::ScopedTempDir temp_directory; 133 base::ScopedTempDir temp_directory;
134 ASSERT_TRUE(temp_directory.CreateUniqueTempDir()); 134 ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
135 base::FilePath temp_file; 135 base::FilePath temp_file;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 // as a client redirect from the first (/client-redirect?) page. 304 // as a client redirect from the first (/client-redirect?) page.
305 for (std::vector<GURL>::iterator it = redirects.begin(); 305 for (std::vector<GURL>::iterator it = redirects.begin();
306 it != redirects.end(); ++it) { 306 it != redirects.end(); ++it) {
307 if (final_url.spec() == it->spec()) { 307 if (final_url.spec() == it->spec()) {
308 final_navigation_not_redirect = false; 308 final_navigation_not_redirect = false;
309 break; 309 break;
310 } 310 }
311 } 311 }
312 EXPECT_TRUE(final_navigation_not_redirect); 312 EXPECT_TRUE(final_navigation_not_redirect);
313 } 313 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698