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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 4926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4937 | 4937 |
4938 // Make sure the response has an auth challenge. | 4938 // Make sure the response has an auth challenge. |
4939 const HttpResponseInfo* const response_start = trans->GetResponseInfo(); | 4939 const HttpResponseInfo* const response_start = trans->GetResponseInfo(); |
4940 ASSERT_TRUE(response_start != NULL); | 4940 ASSERT_TRUE(response_start != NULL); |
4941 ASSERT_TRUE(response_start->headers.get() != NULL); | 4941 ASSERT_TRUE(response_start->headers.get() != NULL); |
4942 EXPECT_EQ(401, response_start->headers->response_code()); | 4942 EXPECT_EQ(401, response_start->headers->response_code()); |
4943 EXPECT_TRUE(response_start->was_fetched_via_spdy); | 4943 EXPECT_TRUE(response_start->was_fetched_via_spdy); |
4944 AuthChallengeInfo* auth_challenge = response_start->auth_challenge.get(); | 4944 AuthChallengeInfo* auth_challenge = response_start->auth_challenge.get(); |
4945 ASSERT_TRUE(auth_challenge != NULL); | 4945 ASSERT_TRUE(auth_challenge != NULL); |
4946 EXPECT_FALSE(auth_challenge->is_proxy); | 4946 EXPECT_FALSE(auth_challenge->is_proxy); |
4947 EXPECT_EQ("basic", auth_challenge->scheme); | 4947 EXPECT_EQ(kBasicAuthScheme, auth_challenge->scheme); |
4948 EXPECT_EQ("MyRealm", auth_challenge->realm); | 4948 EXPECT_EQ("MyRealm", auth_challenge->realm); |
4949 | 4949 |
4950 // Restart with a username/password. | 4950 // Restart with a username/password. |
4951 AuthCredentials credentials(base::ASCIIToUTF16("foo"), | 4951 AuthCredentials credentials(base::ASCIIToUTF16("foo"), |
4952 base::ASCIIToUTF16("bar")); | 4952 base::ASCIIToUTF16("bar")); |
4953 TestCompletionCallback callback_restart; | 4953 TestCompletionCallback callback_restart; |
4954 const int rv_restart = trans->RestartWithAuth( | 4954 const int rv_restart = trans->RestartWithAuth( |
4955 credentials, callback_restart.callback()); | 4955 credentials, callback_restart.callback()); |
4956 EXPECT_EQ(ERR_IO_PENDING, rv_restart); | 4956 EXPECT_EQ(ERR_IO_PENDING, rv_restart); |
4957 const int rv_restart_complete = callback_restart.WaitForResult(); | 4957 const int rv_restart_complete = callback_restart.WaitForResult(); |
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6590 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6590 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
6591 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6591 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
6592 new SSLSocketDataProvider(ASYNC, OK)); | 6592 new SSLSocketDataProvider(ASYNC, OK)); |
6593 // Set to TLS_RSA_WITH_NULL_MD5 | 6593 // Set to TLS_RSA_WITH_NULL_MD5 |
6594 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6594 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
6595 | 6595 |
6596 RunTLSUsageCheckTest(ssl_provider.Pass()); | 6596 RunTLSUsageCheckTest(ssl_provider.Pass()); |
6597 } | 6597 } |
6598 | 6598 |
6599 } // namespace net | 6599 } // namespace net |
OLD | NEW |