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

Side by Side Diff: content/public/test/browser_test_utils.cc

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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
« no previous file with comments | « content/common/appcache_interfaces.cc ('k') | content/public/test/test_launcher.cc » ('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 "content/public/test/browser_test_utils.h" 5 #include "content/public/test/browser_test_utils.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 context_getter->GetURLRequestContext()->cookie_store(); 227 context_getter->GetURLRequestContext()->cookie_store();
228 cookie_store->SetCookieWithOptionsAsync( 228 cookie_store->SetCookieWithOptionsAsync(
229 url, value, net::CookieOptions(), 229 url, value, net::CookieOptions(),
230 base::Bind(&SetCookieCallback, result, event)); 230 base::Bind(&SetCookieCallback, result, event));
231 } 231 }
232 232
233 scoped_ptr<net::test_server::HttpResponse> CrossSiteRedirectResponseHandler( 233 scoped_ptr<net::test_server::HttpResponse> CrossSiteRedirectResponseHandler(
234 const GURL& server_base_url, 234 const GURL& server_base_url,
235 const net::test_server::HttpRequest& request) { 235 const net::test_server::HttpRequest& request) {
236 std::string prefix("/cross-site/"); 236 std::string prefix("/cross-site/");
237 if (!base::StartsWithASCII(request.relative_url, prefix, true)) 237 if (!base::StartsWith(request.relative_url, prefix,
238 base::CompareCase::SENSITIVE))
238 return scoped_ptr<net::test_server::HttpResponse>(); 239 return scoped_ptr<net::test_server::HttpResponse>();
239 240
240 std::string params = request.relative_url.substr(prefix.length()); 241 std::string params = request.relative_url.substr(prefix.length());
241 242
242 // A hostname to redirect to must be included in the URL, therefore at least 243 // A hostname to redirect to must be included in the URL, therefore at least
243 // one '/' character is expected. 244 // one '/' character is expected.
244 size_t slash = params.find('/'); 245 size_t slash = params.find('/');
245 if (slash == std::string::npos) 246 if (slash == std::string::npos)
246 return scoped_ptr<net::test_server::HttpResponse>(); 247 return scoped_ptr<net::test_server::HttpResponse>();
247 248
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 void FrameWatcher::WaitFrames(int frames_to_wait) { 1004 void FrameWatcher::WaitFrames(int frames_to_wait) {
1004 if (frames_to_wait <= 0) 1005 if (frames_to_wait <= 0)
1005 return; 1006 return;
1006 base::RunLoop run_loop; 1007 base::RunLoop run_loop;
1007 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure()); 1008 base::AutoReset<base::Closure> reset_quit(&quit_, run_loop.QuitClosure());
1008 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait); 1009 base::AutoReset<int> reset_frames_to_wait(&frames_to_wait_, frames_to_wait);
1009 run_loop.Run(); 1010 run_loop.Run();
1010 } 1011 }
1011 1012
1012 } // namespace content 1013 } // namespace content
OLDNEW
« no previous file with comments | « content/common/appcache_interfaces.cc ('k') | content/public/test/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698