Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: net/http/http_auth_handler_negotiate_unittest.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_auth_handler_factory.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_factory.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698