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

Unified Diff: net/http/http_auth_handler_negotiate_unittest.cc

Issue 1414313002: Allow dynamic updating of authentication policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various build problems detected on bots. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/http/http_auth_handler_negotiate_unittest.cc
diff --git a/net/http/http_auth_handler_negotiate_unittest.cc b/net/http/http_auth_handler_negotiate_unittest.cc
index 49ebdad62adb5173e02d99f1bd679bcb662e4cad..79a60051cc30f019dcf71b7357e8c0d3b9dc08cf 100644
--- a/net/http/http_auth_handler_negotiate_unittest.cc
+++ b/net/http/http_auth_handler_negotiate_unittest.cc
@@ -45,13 +45,13 @@ class HttpAuthHandlerNegotiateTest : public PlatformTest {
factory_.reset(new HttpAuthHandlerNegotiate::Factory());
factory_->set_url_security_manager(url_security_manager_.get());
#if defined(OS_ANDROID)
- std::string* authenticator =
- new std::string("org.chromium.test.DummySpnegoAuthenticator");
- factory_->set_library(authenticator);
+ scoped_ptr<std::string> authenticator(
+ new std::string("org.chromium.test.DummySpnegoAuthenticator"));
+ factory_->set_library(authenticator.Pass());
MockAuthLibrary::EnsureTestAccountExists();
#endif
#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_ANDROID))
- factory_->set_library(auth_library_);
+ factory_->set_library(make_scoped_ptr(auth_library_));
asanka 2015/10/28 03:27:43 Preexisting: This is dangerous territory. Can we a
aberent 2015/11/02 18:52:50 Not without significant refactoring of the tests (
#endif
factory_->set_host_resolver(resolver_.get());
}
@@ -224,7 +224,9 @@ class HttpAuthHandlerNegotiateTest : public PlatformTest {
#if defined(OS_WIN)
scoped_ptr<SecPkgInfoW> security_package_;
#endif
- // |auth_library_| is passed to |factory_|, which assumes ownership of it.
+ // |auth_library_| is passed to |factory_|, which assumes ownership of it, but
+ // can't be a scoped pointer to it since the tests need access when they set
+ // up the mocks after passing ownership.
MockAuthLibrary* auth_library_;
scoped_ptr<MockHostResolver> resolver_;
scoped_ptr<URLSecurityManager> url_security_manager_;
@@ -366,7 +368,7 @@ TEST_F(HttpAuthHandlerNegotiateTest, MissingGSSAPI) {
negotiate_factory->set_host_resolver(host_resolver.get());
negotiate_factory->set_url_security_manager(&url_security_manager);
negotiate_factory->set_library(
- new GSSAPISharedLibrary("/this/library/does/not/exist"));
+ make_scoped_ptr(new GSSAPISharedLibrary("/this/library/does/not/exist")));
GURL gurl("http://www.example.com");
scoped_ptr<HttpAuthHandler> generic_handler;

Powered by Google App Engine
This is Rietveld 408576698