| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 virtual ~HttpAuthHandlerMock(); | 61 virtual ~HttpAuthHandlerMock(); |
| 62 | 62 |
| 63 void SetResolveExpectation(Resolve resolve); | 63 void SetResolveExpectation(Resolve resolve); |
| 64 | 64 |
| 65 virtual bool NeedsCanonicalName(); | 65 virtual bool NeedsCanonicalName(); |
| 66 | 66 |
| 67 virtual int ResolveCanonicalName(HostResolver* host_resolver, | 67 virtual int ResolveCanonicalName(HostResolver* host_resolver, |
| 68 const CompletionCallback& callback); | 68 const CompletionCallback& callback); |
| 69 | 69 |
| 70 | |
| 71 void SetGenerateExpectation(bool async, int rv); | 70 void SetGenerateExpectation(bool async, int rv); |
| 72 | 71 |
| 73 void set_connection_based(bool connection_based) { | 72 void set_connection_based(bool connection_based) { |
| 74 connection_based_ = connection_based; | 73 connection_based_ = connection_based; |
| 75 } | 74 } |
| 76 | 75 |
| 77 void set_allows_default_credentials(bool allows_default_credentials) { | 76 void set_allows_default_credentials(bool allows_default_credentials) { |
| 78 allows_default_credentials_ = allows_default_credentials; | 77 allows_default_credentials_ = allows_default_credentials; |
| 79 } | 78 } |
| 80 | 79 |
| 81 void set_allows_explicit_credentials(bool allows_explicit_credentials) { | 80 void set_allows_explicit_credentials(bool allows_explicit_credentials) { |
| 82 allows_explicit_credentials_ = allows_explicit_credentials; | 81 allows_explicit_credentials_ = allows_explicit_credentials; |
| 83 } | 82 } |
| 84 | 83 |
| 85 const GURL& request_url() const { | 84 const GURL& request_url() const { return request_url_; } |
| 86 return request_url_; | |
| 87 } | |
| 88 | 85 |
| 89 // HttpAuthHandler: | 86 // HttpAuthHandler: |
| 90 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( | 87 virtual HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 91 HttpAuthChallengeTokenizer* challenge) OVERRIDE; | 88 HttpAuthChallengeTokenizer* challenge) OVERRIDE; |
| 92 virtual bool NeedsIdentity() OVERRIDE; | 89 virtual bool NeedsIdentity() OVERRIDE; |
| 93 virtual bool AllowsDefaultCredentials() OVERRIDE; | 90 virtual bool AllowsDefaultCredentials() OVERRIDE; |
| 94 virtual bool AllowsExplicitCredentials() OVERRIDE; | 91 virtual bool AllowsExplicitCredentials() OVERRIDE; |
| 95 | 92 |
| 96 protected: | 93 protected: |
| 97 virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE; | 94 virtual bool Init(HttpAuthChallengeTokenizer* challenge) OVERRIDE; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 bool first_round_; | 112 bool first_round_; |
| 116 bool connection_based_; | 113 bool connection_based_; |
| 117 bool allows_default_credentials_; | 114 bool allows_default_credentials_; |
| 118 bool allows_explicit_credentials_; | 115 bool allows_explicit_credentials_; |
| 119 GURL request_url_; | 116 GURL request_url_; |
| 120 }; | 117 }; |
| 121 | 118 |
| 122 } // namespace net | 119 } // namespace net |
| 123 | 120 |
| 124 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ | 121 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ |
| OLD | NEW |