diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 16:05:34 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 16:05:34 +0000 |
commit | 7c46fa57a345c80dbc812b450a9a2996ab6ace88 (patch) | |
tree | e6d3352695b9e7af5d58804bd065e3703b32c92c /net/http/http_auth_handler_ntlm.h | |
parent | 09bde0c8d97f44a3a6476ac81d84697f05ecff6f (diff) | |
download | chromium_src-7c46fa57a345c80dbc812b450a9a2996ab6ace88.zip chromium_src-7c46fa57a345c80dbc812b450a9a2996ab6ace88.tar.gz chromium_src-7c46fa57a345c80dbc812b450a9a2996ab6ace88.tar.bz2 |
Added SSPILibrary interface so unit tests can mock SSPI calls.
BUG=None
TEST=net_unittests.exe --gtest_filter="*HttpAuthSSPI*"
Review URL: http://codereview.chromium.org/650164
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_auth_handler_ntlm.h')
-rw-r--r-- | net/http/http_auth_handler_ntlm.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/net/http/http_auth_handler_ntlm.h b/net/http/http_auth_handler_ntlm.h index 9e86e1e..aebb5c4 100644 --- a/net/http/http_auth_handler_ntlm.h +++ b/net/http/http_auth_handler_ntlm.h @@ -43,11 +43,23 @@ class HttpAuthHandlerNTLM : public HttpAuthHandler { HttpAuth::Target target, const GURL& origin, scoped_refptr<HttpAuthHandler>* handler); +#if defined(NTLM_SSPI) + // Set the SSPILibrary to use. Typically the only callers which need to + // use this are unit tests which pass in a mocked-out version of the + // SSPI library. + // The caller is responsible for managing the lifetime of |*sspi_library|, + // and the lifetime must exceed that of this Factory object and all + // HttpAuthHandler's that this Factory object creates. + void set_sspi_library(SSPILibrary* sspi_library) { + sspi_library_ = sspi_library; + } +#endif // defined(NTLM_SSPI) private: #if defined(NTLM_SSPI) ULONG max_token_length_; bool first_creation_; bool is_unsupported_; + SSPILibrary* sspi_library_; #endif // defined(NTLM_SSPI) }; @@ -84,7 +96,7 @@ class HttpAuthHandlerNTLM : public HttpAuthHandler { HttpAuthHandlerNTLM(); #endif #if defined(NTLM_SSPI) - HttpAuthHandlerNTLM(ULONG max_token_length); + HttpAuthHandlerNTLM(SSPILibrary* sspi_library, ULONG max_token_length); #endif virtual bool NeedsIdentity(); |