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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 } | 368 } |
369 | 369 |
370 #if defined(DLOPEN_KERBEROS) | 370 #if defined(DLOPEN_KERBEROS) |
371 TEST_F(HttpAuthHandlerNegotiateTest, MissingGSSAPI) { | 371 TEST_F(HttpAuthHandlerNegotiateTest, MissingGSSAPI) { |
372 std::unique_ptr<HostResolver> host_resolver(new MockHostResolver()); | 372 std::unique_ptr<HostResolver> host_resolver(new MockHostResolver()); |
373 MockAllowHttpAuthPreferences http_auth_preferences; | 373 MockAllowHttpAuthPreferences http_auth_preferences; |
374 std::unique_ptr<HttpAuthHandlerNegotiate::Factory> negotiate_factory( | 374 std::unique_ptr<HttpAuthHandlerNegotiate::Factory> negotiate_factory( |
375 new HttpAuthHandlerNegotiate::Factory()); | 375 new HttpAuthHandlerNegotiate::Factory()); |
376 negotiate_factory->set_host_resolver(host_resolver); | 376 negotiate_factory->set_host_resolver(host_resolver); |
377 negotiate_factory->set_http_auth_preferences(&http_auth_preferences); | 377 negotiate_factory->set_http_auth_preferences(&http_auth_preferences); |
378 negotiate_factory->set_library(base::WrapUnique( | 378 negotiate_factory->set_library( |
379 new GSSAPISharedLibrary("/this/library/does/not/exist"))); | 379 base::MakeUnique<GSSAPISharedLibrary>("/this/library/does/not/exist")); |
380 | 380 |
381 GURL gurl("http://www.example.com"); | 381 GURL gurl("http://www.example.com"); |
382 std::unique_ptr<HttpAuthHandler> generic_handler; | 382 std::unique_ptr<HttpAuthHandler> generic_handler; |
383 int rv = negotiate_factory->CreateAuthHandlerFromString( | 383 int rv = negotiate_factory->CreateAuthHandlerFromString( |
384 "Negotiate", | 384 "Negotiate", |
385 HttpAuth::AUTH_SERVER, | 385 HttpAuth::AUTH_SERVER, |
386 gurl, | 386 gurl, |
387 BoundNetLog(), | 387 BoundNetLog(), |
388 &generic_handler); | 388 &generic_handler); |
389 EXPECT_THAT(rv, IsError(ERR_UNSUPPORTED_AUTH_SCHEME)); | 389 EXPECT_THAT(rv, IsError(ERR_UNSUPPORTED_AUTH_SCHEME)); |
390 EXPECT_TRUE(generic_handler.get() == NULL); | 390 EXPECT_TRUE(generic_handler.get() == NULL); |
391 } | 391 } |
392 #endif // defined(DLOPEN_KERBEROS) | 392 #endif // defined(DLOPEN_KERBEROS) |
393 | 393 |
394 #endif // defined(OS_POSIX) | 394 #endif // defined(OS_POSIX) |
395 | 395 |
396 } // namespace net | 396 } // namespace net |
OLD | NEW |