OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/http/http_auth_handler_negotiate.h" | 5 #include "net/http/http_auth_handler_negotiate.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
23 typedef net::MockSSPILibrary MockAuthLibrary; | 23 typedef net::MockSSPILibrary MockAuthLibrary; |
24 #elif defined(OS_POSIX) | 24 #elif defined(OS_POSIX) |
25 typedef net::test::MockGSSAPILibrary MockAuthLibrary; | 25 typedef net::test::MockGSSAPILibrary MockAuthLibrary; |
26 #endif | 26 #endif |
27 | 27 |
28 namespace net { | 28 namespace net { |
29 | 29 |
30 class HttpAuthHandlerNegotiateTest : public PlatformTest { | 30 class HttpAuthHandlerNegotiateTest : public PlatformTest { |
31 public: | 31 public: |
32 virtual void SetUp() { | 32 void SetUp() override { |
33 auth_library_ = new MockAuthLibrary(); | 33 auth_library_ = new MockAuthLibrary(); |
34 resolver_.reset(new MockHostResolver()); | 34 resolver_.reset(new MockHostResolver()); |
35 resolver_->rules()->AddIPLiteralRule("alias", "10.0.0.2", | 35 resolver_->rules()->AddIPLiteralRule("alias", "10.0.0.2", |
36 "canonical.example.com"); | 36 "canonical.example.com"); |
37 | 37 |
38 url_security_manager_.reset(new MockAllowURLSecurityManager()); | 38 url_security_manager_.reset(new MockAllowURLSecurityManager()); |
39 factory_.reset(new HttpAuthHandlerNegotiate::Factory()); | 39 factory_.reset(new HttpAuthHandlerNegotiate::Factory()); |
40 factory_->set_url_security_manager(url_security_manager_.get()); | 40 factory_->set_url_security_manager(url_security_manager_.get()); |
41 factory_->set_library(auth_library_); | 41 factory_->set_library(auth_library_); |
42 factory_->set_host_resolver(resolver_.get()); | 42 factory_->set_host_resolver(resolver_.get()); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 BoundNetLog(), | 359 BoundNetLog(), |
360 &generic_handler); | 360 &generic_handler); |
361 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, rv); | 361 EXPECT_EQ(ERR_UNSUPPORTED_AUTH_SCHEME, rv); |
362 EXPECT_TRUE(generic_handler.get() == NULL); | 362 EXPECT_TRUE(generic_handler.get() == NULL); |
363 } | 363 } |
364 #endif // defined(DLOPEN_KERBEROS) | 364 #endif // defined(DLOPEN_KERBEROS) |
365 | 365 |
366 #endif // defined(OS_POSIX) | 366 #endif // defined(OS_POSIX) |
367 | 367 |
368 } // namespace net | 368 } // namespace net |
OLD | NEW |