#include "net/http/http_auth_handler_negotiate.h"
#include <memory>
#include <string>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "net/base/features.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_auth_mechanism.h"
#include "net/http/http_request_info.h"
#include "net/http/mock_allow_http_auth_preferences.h"
#include "net/log/net_log_with_source.h"
#include "net/net_buildflags.h"
#include "net/ssl/ssl_info.h"
#include "net/test/gtest_util.h"
#include "net/test/test_with_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "url/gurl.h"
#include "url/scheme_host_port.h"
#if !BUILDFLAG(USE_KERBEROS)
#error "use_kerberos should be true to use Negotiate authentication scheme."
#endif
#if BUILDFLAG(IS_ANDROID)
#include "net/android/dummy_spnego_authenticator.h"
#elif BUILDFLAG(IS_WIN)
#include "net/http/mock_sspi_library_win.h"
#elif BUILDFLAG(USE_EXTERNAL_GSSAPI)
#include "net/http/mock_gssapi_library_posix.h"
#else
#error "use_kerberos is true, but no Kerberos implementation available."
#endif
IsError;
IsOk;
namespace net {
constexpr char kFakeToken[] = …;
class HttpAuthHandlerNegotiateTest : public PlatformTest,
public WithTaskEnvironment { … };
TEST_F(HttpAuthHandlerNegotiateTest, DisableCname) { … }
TEST_F(HttpAuthHandlerNegotiateTest, DisableCnameStandardPort) { … }
TEST_F(HttpAuthHandlerNegotiateTest, DisableCnameNonstandardPort) { … }
TEST_F(HttpAuthHandlerNegotiateTest, CnameSync) { … }
TEST_F(HttpAuthHandlerNegotiateTest, CnameAsync) { … }
#if BUILDFLAG(IS_POSIX)
TEST_F(HttpAuthHandlerNegotiateTest, ServerNotInKerberosDatabase) { … }
TEST_F(HttpAuthHandlerNegotiateTest, NoKerberosCredentials) { … }
#if BUILDFLAG(USE_EXTERNAL_GSSAPI)
TEST_F(HttpAuthHandlerNegotiateTest, MissingGSSAPI) { … }
#endif
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
TEST_F(HttpAuthHandlerNegotiateTest, AllowGssapiLibraryLoad) { … }
#endif
#endif
class TestAuthSystem : public HttpAuthMechanism { … };
TEST_F(HttpAuthHandlerNegotiateTest, OverrideAuthSystem) { … }
}