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_gssapi_posix.h" | 5 #include "net/http/http_auth_gssapi_posix.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/native_library.h" | 10 #include "base/native_library.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 in_buffer, | 69 in_buffer, |
70 out_buffer); | 70 out_buffer); |
71 } | 71 } |
72 | 72 |
73 } // namespace | 73 } // namespace |
74 | 74 |
75 TEST(HttpAuthGSSAPIPOSIXTest, GSSAPIStartup) { | 75 TEST(HttpAuthGSSAPIPOSIXTest, GSSAPIStartup) { |
76 // TODO(ahendrickson): Manipulate the libraries and paths to test each of the | 76 // TODO(ahendrickson): Manipulate the libraries and paths to test each of the |
77 // libraries we expect, and also whether or not they have the interface | 77 // libraries we expect, and also whether or not they have the interface |
78 // functions we want. | 78 // functions we want. |
79 scoped_ptr<GSSAPILibrary> gssapi(new GSSAPISharedLibrary("")); | 79 scoped_ptr<GSSAPILibrary> gssapi(new GSSAPISharedLibrary(std::string())); |
80 DCHECK(gssapi.get()); | 80 DCHECK(gssapi.get()); |
81 EXPECT_TRUE(gssapi.get()->Init()); | 81 EXPECT_TRUE(gssapi.get()->Init()); |
82 } | 82 } |
83 | 83 |
84 #if defined(DLOPEN_KERBEROS) | 84 #if defined(DLOPEN_KERBEROS) |
85 TEST(HttpAuthGSSAPIPOSIXTest, GSSAPILoadCustomLibrary) { | 85 TEST(HttpAuthGSSAPIPOSIXTest, GSSAPILoadCustomLibrary) { |
86 scoped_ptr<GSSAPILibrary> gssapi( | 86 scoped_ptr<GSSAPILibrary> gssapi( |
87 new GSSAPISharedLibrary("/this/library/does/not/exist")); | 87 new GSSAPISharedLibrary("/this/library/does/not/exist")); |
88 EXPECT_FALSE(gssapi.get()->Init()); | 88 EXPECT_FALSE(gssapi.get()->Init()); |
89 } | 89 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 EXPECT_EQ(OK, auth_gssapi.GenerateAuthToken(NULL, L"HTTP/intranet.google.com", | 265 EXPECT_EQ(OK, auth_gssapi.GenerateAuthToken(NULL, L"HTTP/intranet.google.com", |
266 &auth_token)); | 266 &auth_token)); |
267 std::string second_challenge_text = "Negotiate =happyjoy="; | 267 std::string second_challenge_text = "Negotiate =happyjoy="; |
268 HttpAuth::ChallengeTokenizer second_challenge(second_challenge_text.begin(), | 268 HttpAuth::ChallengeTokenizer second_challenge(second_challenge_text.begin(), |
269 second_challenge_text.end()); | 269 second_challenge_text.end()); |
270 EXPECT_EQ(HttpAuth::AUTHORIZATION_RESULT_INVALID, | 270 EXPECT_EQ(HttpAuth::AUTHORIZATION_RESULT_INVALID, |
271 auth_gssapi.ParseChallenge(&second_challenge)); | 271 auth_gssapi.ParseChallenge(&second_challenge)); |
272 } | 272 } |
273 | 273 |
274 } // namespace net | 274 } // namespace net |
OLD | NEW |