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

Side by Side Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 2136453004: Reland of place string::find(prefix) == 0 pattern with base::StartsWith(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « base/trace_event/trace_config.cc ('k') | chrome/browser/chromeos/profiles/profile_helper.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <queue> 5 #include <queue>
6 #include <set> 6 #include <set>
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after
2348 const char kDownloadPathPrefix[] = "/download_cookie_isolation_test"; 2348 const char kDownloadPathPrefix[] = "/download_cookie_isolation_test";
2349 2349
2350 // EmbeddedTestServer request handler for use with DownloadCookieIsolation test. 2350 // EmbeddedTestServer request handler for use with DownloadCookieIsolation test.
2351 // Responds with the next status code in |status_codes| if the 'Cookie' header 2351 // Responds with the next status code in |status_codes| if the 'Cookie' header
2352 // sent with the request matches the query() part of the URL. Otherwise, fails 2352 // sent with the request matches the query() part of the URL. Otherwise, fails
2353 // the request with an HTTP 403. The body of the response is the value of the 2353 // the request with an HTTP 403. The body of the response is the value of the
2354 // Cookie header. 2354 // Cookie header.
2355 std::unique_ptr<net::test_server::HttpResponse> HandleDownloadRequestWithCookie( 2355 std::unique_ptr<net::test_server::HttpResponse> HandleDownloadRequestWithCookie(
2356 std::queue<net::HttpStatusCode>* status_codes, 2356 std::queue<net::HttpStatusCode>* status_codes,
2357 const net::test_server::HttpRequest& request) { 2357 const net::test_server::HttpRequest& request) {
2358 if (request.relative_url.find(kDownloadPathPrefix) != 0) { 2358 if (!base::StartsWith(request.relative_url, kDownloadPathPrefix,
2359 base::CompareCase::SENSITIVE)) {
2359 return std::unique_ptr<net::test_server::HttpResponse>(); 2360 return std::unique_ptr<net::test_server::HttpResponse>();
2360 } 2361 }
2361 2362
2362 std::string cookie_to_expect = request.GetURL().query(); 2363 std::string cookie_to_expect = request.GetURL().query();
2363 const auto cookie_header_it = request.headers.find("cookie"); 2364 const auto cookie_header_it = request.headers.find("cookie");
2364 std::unique_ptr<net::test_server::BasicHttpResponse> response; 2365 std::unique_ptr<net::test_server::BasicHttpResponse> response;
2365 2366
2366 // Return a 403 if there's no cookie or if the cookie doesn't match. 2367 // Return a 403 if there's no cookie or if the cookie doesn't match.
2367 if (cookie_header_it == request.headers.end() || 2368 if (cookie_header_it == request.headers.end() ||
2368 cookie_header_it->second != cookie_to_expect) { 2369 cookie_header_it->second != cookie_to_expect) {
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 gfx::Point embedder_origin = 3587 gfx::Point embedder_origin =
3587 GetEmbedderWebContents()->GetContainerBounds().origin(); 3588 GetEmbedderWebContents()->GetContainerBounds().origin();
3588 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y()); 3589 guest_rect.Offset(-embedder_origin.x(), -embedder_origin.y());
3589 3590
3590 // Generate and send synthetic touch event. 3591 // Generate and send synthetic touch event.
3591 content::SimulateTouchPressAt(GetEmbedderWebContents(), 3592 content::SimulateTouchPressAt(GetEmbedderWebContents(),
3592 guest_rect.CenterPoint()); 3593 guest_rect.CenterPoint());
3593 EXPECT_TRUE(aura_webview->HasFocus()); 3594 EXPECT_TRUE(aura_webview->HasFocus());
3594 } 3595 }
3595 #endif 3596 #endif
OLDNEW
« no previous file with comments | « base/trace_event/trace_config.cc ('k') | chrome/browser/chromeos/profiles/profile_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698