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

Side by Side Diff: net/websockets/websocket_stream_cookie_test.cc

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « net/tools/flip_server/mem_cache.cc ('k') | pdf/document_loader.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <string> 5 #include <string>
6 6
7 #include "base/callback_forward.h" 7 #include "base/callback_forward.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 17 matching lines...) Expand all
28 28
29 class TestBase : public WebSocketStreamCreateTestBase { 29 class TestBase : public WebSocketStreamCreateTestBase {
30 public: 30 public:
31 void CreateAndConnect(const GURL& url, 31 void CreateAndConnect(const GURL& url,
32 const std::string& origin, 32 const std::string& origin,
33 const std::string& cookie_header, 33 const std::string& cookie_header,
34 const std::string& response_body) { 34 const std::string& response_body) {
35 // We assume cookie_header ends with CRLF if not empty, as 35 // We assume cookie_header ends with CRLF if not empty, as
36 // WebSocketStandardRequestWithCookies requires. Use AddCRLFIfNotEmpty 36 // WebSocketStandardRequestWithCookies requires. Use AddCRLFIfNotEmpty
37 // in a call site. 37 // in a call site.
38 CHECK(cookie_header.empty() || EndsWith(cookie_header, "\r\n", true)); 38 CHECK(cookie_header.empty() || base::EndsWith(cookie_header, "\r\n", true));
39 39
40 url_request_context_host_.SetExpectations( 40 url_request_context_host_.SetExpectations(
41 WebSocketStandardRequestWithCookies(url.path(), url.host(), origin, 41 WebSocketStandardRequestWithCookies(url.path(), url.host(), origin,
42 cookie_header, std::string()), 42 cookie_header, std::string()),
43 response_body); 43 response_body);
44 CreateAndConnectStream(url.spec(), NoSubProtocols(), origin, nullptr); 44 CreateAndConnectStream(url.spec(), NoSubProtocols(), origin, nullptr);
45 } 45 }
46 46
47 std::string AddCRLFIfNotEmpty(const std::string& s) { 47 std::string AddCRLFIfNotEmpty(const std::string& s) {
48 return s.empty() ? s : s + "\r\n"; 48 return s.empty() ? s : s + "\r\n";
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 "", 494 "",
495 "Set-Cookie: test-cookie"}, 495 "Set-Cookie: test-cookie"},
496 }; 496 };
497 497
498 INSTANTIATE_TEST_CASE_P(WebSocketStreamServerSetCookieTest, 498 INSTANTIATE_TEST_CASE_P(WebSocketStreamServerSetCookieTest,
499 WebSocketStreamServerSetCookieTest, 499 WebSocketStreamServerSetCookieTest,
500 ValuesIn(kServerSetCookieParameters)); 500 ValuesIn(kServerSetCookieParameters));
501 501
502 } // namespace 502 } // namespace
503 } // namespace net 503 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/flip_server/mem_cache.cc ('k') | pdf/document_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698