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

Side by Side Diff: net/http/http_auth_unittest.cc

Issue 1383613002: [net/http auth] Cleanup. Method names, and constness. Base URL: https://chromium.googlesource.com/chromium/src.git@mock-auth-handler-generalization
Patch Set: Created 5 years, 2 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/http/http_auth_sspi_win_unittest.cc ('k') | net/http/http_network_transaction_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 15 matching lines...) Expand all
26 26
27 namespace { 27 namespace {
28 28
29 HttpAuthHandlerMock* CreateMockHandler(bool expect_multiple_challenges) { 29 HttpAuthHandlerMock* CreateMockHandler(bool expect_multiple_challenges) {
30 HttpAuthHandlerMock* auth_handler = new HttpAuthHandlerMock(); 30 HttpAuthHandlerMock* auth_handler = new HttpAuthHandlerMock();
31 auth_handler->set_expect_multiple_challenges(expect_multiple_challenges); 31 auth_handler->set_expect_multiple_challenges(expect_multiple_challenges);
32 std::string challenge_text = "Mock"; 32 std::string challenge_text = "Mock";
33 HttpAuthChallengeTokenizer challenge(challenge_text.begin(), 33 HttpAuthChallengeTokenizer challenge(challenge_text.begin(),
34 challenge_text.end()); 34 challenge_text.end());
35 GURL origin("www.example.com"); 35 GURL origin("www.example.com");
36 EXPECT_TRUE(auth_handler->InitFromChallenge(&challenge, HttpAuth::AUTH_SERVER, 36 EXPECT_EQ(OK, auth_handler->HandleInitialChallenge(
37 origin, BoundNetLog())); 37 challenge, HttpAuth::AUTH_SERVER, origin, BoundNetLog()));
38 return auth_handler; 38 return auth_handler;
39 } 39 }
40 40
41 HttpResponseHeaders* HeadersFromResponseText(const std::string& response) { 41 HttpResponseHeaders* HeadersFromResponseText(const std::string& response) {
42 return new HttpResponseHeaders( 42 return new HttpResponseHeaders(
43 HttpUtil::AssembleRawHeaders(response.c_str(), response.length())); 43 HttpUtil::AssembleRawHeaders(response.c_str(), response.length()));
44 } 44 }
45 45
46 HttpAuth::AuthorizationResult HandleChallengeResponse( 46 HttpAuth::AuthorizationResult HandleChallengeResponse(
47 bool expect_multiple_challenges, 47 bool expect_multiple_challenges,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 std::string name; 254 std::string name;
255 255
256 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_SERVER); 256 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_SERVER);
257 EXPECT_STREQ("Authorization", name.c_str()); 257 EXPECT_STREQ("Authorization", name.c_str());
258 258
259 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_PROXY); 259 name = HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_PROXY);
260 EXPECT_STREQ("Proxy-Authorization", name.c_str()); 260 EXPECT_STREQ("Proxy-Authorization", name.c_str());
261 } 261 }
262 262
263 } // namespace net 263 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_sspi_win_unittest.cc ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698