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

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

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « 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() || base::EndsWith(cookie_header, "\r\n", true)); 38 CHECK(cookie_header.empty() ||
39 base::EndsWith(cookie_header, "\r\n", base::CompareCase::SENSITIVE));
39 40
40 url_request_context_host_.SetExpectations( 41 url_request_context_host_.SetExpectations(
41 WebSocketStandardRequestWithCookies(url.path(), url.host(), origin, 42 WebSocketStandardRequestWithCookies(url.path(), url.host(), origin,
42 cookie_header, std::string()), 43 cookie_header, std::string()),
43 response_body); 44 response_body);
44 CreateAndConnectStream(url.spec(), NoSubProtocols(), origin, nullptr); 45 CreateAndConnectStream(url.spec(), NoSubProtocols(), origin, nullptr);
45 } 46 }
46 47
47 std::string AddCRLFIfNotEmpty(const std::string& s) { 48 std::string AddCRLFIfNotEmpty(const std::string& s) {
48 return s.empty() ? s : s + "\r\n"; 49 return s.empty() ? s : s + "\r\n";
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 "", 495 "",
495 "Set-Cookie: test-cookie"}, 496 "Set-Cookie: test-cookie"},
496 }; 497 };
497 498
498 INSTANTIATE_TEST_CASE_P(WebSocketStreamServerSetCookieTest, 499 INSTANTIATE_TEST_CASE_P(WebSocketStreamServerSetCookieTest,
499 WebSocketStreamServerSetCookieTest, 500 WebSocketStreamServerSetCookieTest,
500 ValuesIn(kServerSetCookieParameters)); 501 ValuesIn(kServerSetCookieParameters));
501 502
502 } // namespace 503 } // namespace
503 } // namespace net 504 } // 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