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_negotiate.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_negotiate.h')
-rw-r--r-- | net/http/http_auth_handler_negotiate.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/net/http/http_auth_handler_negotiate.h b/net/http/http_auth_handler_negotiate.h index 73b1240..4577d9c 100644 --- a/net/http/http_auth_handler_negotiate.h +++ b/net/http/http_auth_handler_negotiate.h @@ -34,16 +34,29 @@ class HttpAuthHandlerNegotiate : public HttpAuthHandler { HttpAuth::Target target, const GURL& origin, scoped_refptr<HttpAuthHandler>* handler); + +#if defined(OS_WIN) + // 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(OS_WIN) private: #if defined(OS_WIN) ULONG max_token_length_; bool first_creation_; bool is_unsupported_; + SSPILibrary* sspi_library_; #endif // defined(OS_WIN) }; #if defined(OS_WIN) - explicit HttpAuthHandlerNegotiate(ULONG max_token_length); + HttpAuthHandlerNegotiate(SSPILibrary* sspi_library, ULONG max_token_length); #else HttpAuthHandlerNegotiate(); #endif |