| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 23 matching lines...) Expand all Loading... |
| 34 virtual ~HttpAuthHandlerMock(); | 34 virtual ~HttpAuthHandlerMock(); |
| 35 | 35 |
| 36 void SetResolveExpectation(Resolve resolve); | 36 void SetResolveExpectation(Resolve resolve); |
| 37 | 37 |
| 38 virtual bool NeedsCanonicalName(); | 38 virtual bool NeedsCanonicalName(); |
| 39 | 39 |
| 40 virtual int ResolveCanonicalName(HostResolver* host_resolver, | 40 virtual int ResolveCanonicalName(HostResolver* host_resolver, |
| 41 CompletionCallback* callback); | 41 CompletionCallback* callback); |
| 42 | 42 |
| 43 virtual bool NeedsIdentity() { return first_round_; } | 43 virtual bool NeedsIdentity() { return first_round_; } |
| 44 virtual bool IsFinalRound() { return false; } | |
| 45 | 44 |
| 46 void SetGenerateExpectation(bool async, int rv); | 45 void SetGenerateExpectation(bool async, int rv); |
| 47 | 46 |
| 48 void set_connection_based(bool connection_based) { | 47 void set_connection_based(bool connection_based) { |
| 49 connection_based_ = connection_based; | 48 connection_based_ = connection_based; |
| 50 } | 49 } |
| 51 | 50 |
| 52 const GURL& request_url() const { | 51 const GURL& request_url() const { |
| 53 return request_url_; | 52 return request_url_; |
| 54 } | 53 } |
| 55 | 54 |
| 55 HttpAuth::AuthorizationResult HandleAnotherChallenge( |
| 56 HttpAuth::ChallengeTokenizer* challenge); |
| 57 |
| 56 // The Factory class simply returns the same handler each time | 58 // The Factory class simply returns the same handler each time |
| 57 // CreateAuthHandler is called. | 59 // CreateAuthHandler is called. |
| 58 class Factory : public HttpAuthHandlerFactory { | 60 class Factory : public HttpAuthHandlerFactory { |
| 59 public: | 61 public: |
| 60 Factory(); | 62 Factory(); |
| 61 virtual ~Factory(); | 63 virtual ~Factory(); |
| 62 | 64 |
| 63 void set_mock_handler(HttpAuthHandler* handler, HttpAuth::Target target); | 65 void set_mock_handler(HttpAuthHandler* handler, HttpAuth::Target target); |
| 64 | 66 |
| 65 void set_do_init_from_challenge(bool do_init_from_challenge) { | 67 void set_do_init_from_challenge(bool do_init_from_challenge) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 int generate_rv_; | 102 int generate_rv_; |
| 101 std::string* auth_token_; | 103 std::string* auth_token_; |
| 102 bool first_round_; | 104 bool first_round_; |
| 103 bool connection_based_; | 105 bool connection_based_; |
| 104 GURL request_url_; | 106 GURL request_url_; |
| 105 }; | 107 }; |
| 106 | 108 |
| 107 } // namespace net | 109 } // namespace net |
| 108 | 110 |
| 109 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ | 111 #endif // NET_HTTP_HTTP_AUTH_HANDLER_MOCK_H_ |
| OLD | NEW |