Commit f3820911 authored by Asanka Herath's avatar Asanka Herath Committed by Commit Bot

[net/auth] Move MockAuthLibrary declaration to platform files.

This mildly reduces the number of platform specific code in files that
are supposed to be cross platform.

R=eroman@chromium.org

Bug: 927182
Change-Id: I854f452ac95a9dbeca326821d7efd9c2ea4c61b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693565
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680094}
parent e3695ccc
...@@ -137,6 +137,9 @@ class DummySpnegoAuthenticator { ...@@ -137,6 +137,9 @@ class DummySpnegoAuthenticator {
}; };
} // namespace android } // namespace android
using MockAuthLibrary = android::DummySpnegoAuthenticator;
} // namespace net } // namespace net
#endif // NET_ANDROID_DUMMY_SPNEGO_AUTHENTICATOR_H_ #endif // NET_ANDROID_DUMMY_SPNEGO_AUTHENTICATOR_H_
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include "net/http/mock_sspi_library_win.h" #include "net/http/mock_sspi_library_win.h"
#elif BUILDFLAG(USE_EXTERNAL_GSSAPI) #elif BUILDFLAG(USE_EXTERNAL_GSSAPI)
#include "net/http/mock_gssapi_library_posix.h" #include "net/http/mock_gssapi_library_posix.h"
#else
#error "use_kerberos is true, but no Kerberos implementation available."
#endif #endif
using net::test::IsError; using net::test::IsError;
...@@ -45,16 +47,6 @@ namespace net { ...@@ -45,16 +47,6 @@ namespace net {
constexpr char kFakeToken[] = "FakeToken"; constexpr char kFakeToken[] = "FakeToken";
#if defined(OS_ANDROID)
using MockAuthLibrary = net::android::DummySpnegoAuthenticator;
#elif defined(OS_WIN)
using MockAuthLibrary = MockSSPILibrary;
#elif BUILDFLAG(USE_EXTERNAL_GSSAPI)
using MockAuthLibrary = test::MockGSSAPILibrary;
#else
#error "use_kerberos is true, but no Kerberos implementation available."
#endif
class HttpAuthHandlerNegotiateTest : public PlatformTest, class HttpAuthHandlerNegotiateTest : public PlatformTest,
public WithScopedTaskEnvironment { public WithScopedTaskEnvironment {
public: public:
......
...@@ -203,6 +203,8 @@ class MockGSSAPILibrary : public GSSAPILibrary { ...@@ -203,6 +203,8 @@ class MockGSSAPILibrary : public GSSAPILibrary {
} // namespace test } // namespace test
using MockAuthLibrary = test::MockGSSAPILibrary;
} // namespace net } // namespace net
#endif // NET_HTTP_MOCK_GSSAPI_LIBRARY_POSIX_H_ #endif // NET_HTTP_MOCK_GSSAPI_LIBRARY_POSIX_H_
...@@ -106,6 +106,8 @@ class MockSSPILibrary : public SSPILibrary { ...@@ -106,6 +106,8 @@ class MockSSPILibrary : public SSPILibrary {
std::set<PSecPkgInfoW> expected_freed_packages_; std::set<PSecPkgInfoW> expected_freed_packages_;
}; };
using MockAuthLibrary = MockSSPILibrary;
} // namespace net } // namespace net
#endif // NET_HTTP_MOCK_SSPI_LIBRARY_WIN_H_ #endif // NET_HTTP_MOCK_SSPI_LIBRARY_WIN_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment