OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "net/base/mock_host_resolver.h" | 6 #include "net/base/mock_host_resolver.h" |
7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
8 #include "net/http/http_auth_handler.h" | 8 #include "net/http/http_auth_handler.h" |
9 #include "net/http/http_auth_handler_factory.h" | 9 #include "net/http/http_auth_handler_factory.h" |
10 #include "net/http/mock_allow_url_security_manager.h" | 10 #include "net/http/mock_allow_url_security_manager.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 BoundNetLog(), | 157 BoundNetLog(), |
158 &handler); | 158 &handler); |
159 EXPECT_EQ(OK, rv); | 159 EXPECT_EQ(OK, rv); |
160 ASSERT_FALSE(handler.get() == NULL); | 160 ASSERT_FALSE(handler.get() == NULL); |
161 EXPECT_EQ(HttpAuth::AUTH_SCHEME_NTLM, handler->auth_scheme()); | 161 EXPECT_EQ(HttpAuth::AUTH_SCHEME_NTLM, handler->auth_scheme()); |
162 EXPECT_STREQ("", handler->realm().c_str()); | 162 EXPECT_STREQ("", handler->realm().c_str()); |
163 EXPECT_EQ(HttpAuth::AUTH_SERVER, handler->target()); | 163 EXPECT_EQ(HttpAuth::AUTH_SERVER, handler->target()); |
164 EXPECT_TRUE(handler->encrypts_identity()); | 164 EXPECT_TRUE(handler->encrypts_identity()); |
165 EXPECT_TRUE(handler->is_connection_based()); | 165 EXPECT_TRUE(handler->is_connection_based()); |
166 } | 166 } |
167 #if defined(USE_KERBEROS) | |
167 { | 168 { |
168 scoped_ptr<HttpAuthHandler> handler; | 169 scoped_ptr<HttpAuthHandler> handler; |
169 int rv = http_auth_handler_factory->CreateAuthHandlerFromString( | 170 int rv = http_auth_handler_factory->CreateAuthHandlerFromString( |
170 "Negotiate", | 171 "Negotiate", |
171 HttpAuth::AUTH_SERVER, | 172 HttpAuth::AUTH_SERVER, |
172 server_origin, | 173 server_origin, |
173 BoundNetLog(), | 174 BoundNetLog(), |
174 &handler); | 175 &handler); |
175 EXPECT_EQ(OK, rv); | 176 EXPECT_EQ(OK, rv); |
176 ASSERT_FALSE(handler.get() == NULL); | 177 ASSERT_FALSE(handler.get() == NULL); |
177 EXPECT_EQ(HttpAuth::AUTH_SCHEME_NEGOTIATE, handler->auth_scheme()); | 178 EXPECT_EQ(HttpAuth::AUTH_SCHEME_NEGOTIATE, handler->auth_scheme()); |
178 EXPECT_STREQ("", handler->realm().c_str()); | 179 EXPECT_STREQ("", handler->realm().c_str()); |
179 EXPECT_EQ(HttpAuth::AUTH_SERVER, handler->target()); | 180 EXPECT_EQ(HttpAuth::AUTH_SERVER, handler->target()); |
180 EXPECT_TRUE(handler->encrypts_identity()); | 181 EXPECT_TRUE(handler->encrypts_identity()); |
181 EXPECT_TRUE(handler->is_connection_based()); | 182 EXPECT_TRUE(handler->is_connection_based()); |
182 } | 183 } |
wtc
2011/08/12 17:21:51
Add a #else block here to perform a negative test.
Paweł Hajdan Jr.
2011/08/12 18:14:42
Done.
| |
184 #endif // defined(USE_KERBEROS) | |
183 } | 185 } |
184 | 186 |
185 } // namespace net | 187 } // namespace net |
OLD | NEW |