| OLD | NEW |
| 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 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ | 5 #ifndef NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ |
| 6 #define NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ | 6 #define NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 HttpAuthHandlerMock(); | 60 HttpAuthHandlerMock(); |
| 61 | 61 |
| 62 virtual ~HttpAuthHandlerMock(); | 62 virtual ~HttpAuthHandlerMock(); |
| 63 | 63 |
| 64 void SetResolveExpectation(Resolve resolve); | 64 void SetResolveExpectation(Resolve resolve); |
| 65 | 65 |
| 66 virtual bool NeedsCanonicalName(); | 66 virtual bool NeedsCanonicalName(); |
| 67 | 67 |
| 68 virtual int ResolveCanonicalName(HostResolver* host_resolver, | 68 virtual int ResolveCanonicalName(HostResolver* host_resolver, |
| 69 OldCompletionCallback* callback); | 69 const CompletionCallback& callback); |
| 70 | 70 |
| 71 | 71 |
| 72 void SetGenerateExpectation(bool async, int rv); | 72 void SetGenerateExpectation(bool async, int rv); |
| 73 | 73 |
| 74 void set_connection_based(bool connection_based) { | 74 void set_connection_based(bool connection_based) { |
| 75 connection_based_ = connection_based; | 75 connection_based_ = connection_based; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void set_allows_default_credentials(bool allows_default_credentials) { | 78 void set_allows_default_credentials(bool allows_default_credentials) { |
| 79 allows_default_credentials_ = allows_default_credentials; | 79 allows_default_credentials_ = allows_default_credentials; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 92 HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; | 92 HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; |
| 93 virtual bool NeedsIdentity() OVERRIDE; | 93 virtual bool NeedsIdentity() OVERRIDE; |
| 94 virtual bool AllowsDefaultCredentials() OVERRIDE; | 94 virtual bool AllowsDefaultCredentials() OVERRIDE; |
| 95 virtual bool AllowsExplicitCredentials() OVERRIDE; | 95 virtual bool AllowsExplicitCredentials() OVERRIDE; |
| 96 | 96 |
| 97 protected: | 97 protected: |
| 98 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; | 98 virtual bool Init(HttpAuth::ChallengeTokenizer* challenge) OVERRIDE; |
| 99 | 99 |
| 100 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 100 virtual int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
| 101 const HttpRequestInfo* request, | 101 const HttpRequestInfo* request, |
| 102 OldCompletionCallback* callback, | 102 const CompletionCallback& callback, |
| 103 std::string* auth_token) OVERRIDE; | 103 std::string* auth_token) OVERRIDE; |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 void OnResolveCanonicalName(); | 106 void OnResolveCanonicalName(); |
| 107 | 107 |
| 108 void OnGenerateAuthToken(); | 108 void OnGenerateAuthToken(); |
| 109 | 109 |
| 110 Resolve resolve_; | 110 Resolve resolve_; |
| 111 OldCompletionCallback* user_callback_; | 111 CompletionCallback callback_; |
| 112 base::WeakPtrFactory<HttpAuthHandlerMock> ptr_factory_; | 112 base::WeakPtrFactory<HttpAuthHandlerMock> weak_factory_; |
| 113 bool generate_async_; | 113 bool generate_async_; |
| 114 int generate_rv_; | 114 int generate_rv_; |
| 115 std::string* auth_token_; | 115 std::string* auth_token_; |
| 116 bool first_round_; | 116 bool first_round_; |
| 117 bool connection_based_; | 117 bool connection_based_; |
| 118 bool allows_default_credentials_; | 118 bool allows_default_credentials_; |
| 119 bool allows_explicit_credentials_; | 119 bool allows_explicit_credentials_; |
| 120 GURL request_url_; | 120 GURL request_url_; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace net | 123 } // namespace net |
| 124 | 124 |
| 125 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ | 125 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ |
| OLD | NEW |