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

Side by Side Diff: net/http/http_auth_handler_factory_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_handler_factory.cc ('k') | net/http/http_auth_handler_mock.h » ('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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "net/base/net_errors.h" 6 #include "net/base/net_errors.h"
7 #include "net/dns/mock_host_resolver.h" 7 #include "net/dns/mock_host_resolver.h"
8 #include "net/http/http_auth_handler.h" 8 #include "net/http/http_auth_handler.h"
9 #include "net/http/http_auth_handler_factory.h" 9 #include "net/http/http_auth_handler_factory.h"
10 #include "net/http/mock_allow_url_security_manager.h" 10 #include "net/http/mock_allow_url_security_manager.h"
11 #include "net/http/url_security_manager.h" 11 #include "net/http/url_security_manager.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 namespace { 16 namespace {
17 17
18 class MockHttpAuthHandlerFactory : public HttpAuthHandlerFactory { 18 class MockHttpAuthHandlerFactory : public HttpAuthHandlerFactory {
19 public: 19 public:
20 explicit MockHttpAuthHandlerFactory(int return_code) : 20 explicit MockHttpAuthHandlerFactory(int return_code) :
21 return_code_(return_code) {} 21 return_code_(return_code) {}
22 ~MockHttpAuthHandlerFactory() override {} 22 ~MockHttpAuthHandlerFactory() override {}
23 23
24 int CreateAuthHandler(HttpAuthChallengeTokenizer* challenge, 24 int CreateAuthHandler(const HttpAuthChallengeTokenizer& challenge,
25 HttpAuth::Target target, 25 HttpAuth::Target target,
26 const GURL& origin, 26 const GURL& origin,
27 CreateReason reason, 27 CreateReason reason,
28 int nonce_count, 28 int nonce_count,
29 const BoundNetLog& net_log, 29 const BoundNetLog& net_log,
30 scoped_ptr<HttpAuthHandler>* handler) override { 30 scoped_ptr<HttpAuthHandler>* handler) override {
31 handler->reset(); 31 handler->reset();
32 return return_code_; 32 return return_code_;
33 } 33 }
34 34
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 EXPECT_STREQ("", handler->realm().c_str()); 174 EXPECT_STREQ("", handler->realm().c_str());
175 EXPECT_EQ(HttpAuth::AUTH_SERVER, handler->target()); 175 EXPECT_EQ(HttpAuth::AUTH_SERVER, handler->target());
176 #else 176 #else
177 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, rv); 177 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, rv);
178 EXPECT_TRUE(handler.get() == NULL); 178 EXPECT_TRUE(handler.get() == NULL);
179 #endif // defined(USE_KERBEROS) && !defined(OS_ANDROID) 179 #endif // defined(USE_KERBEROS) && !defined(OS_ANDROID)
180 } 180 }
181 } 181 }
182 182
183 } // namespace net 183 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_factory.cc ('k') | net/http/http_auth_handler_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698