| 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/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3384 | 3384 |
| 3385 EnableChannelID(); | 3385 EnableChannelID(); |
| 3386 SSLConfig ssl_config; | 3386 SSLConfig ssl_config; |
| 3387 ssl_config.channel_id_enabled = true; | 3387 ssl_config.channel_id_enabled = true; |
| 3388 | 3388 |
| 3389 int rv; | 3389 int rv; |
| 3390 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 3390 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
| 3391 | 3391 |
| 3392 EXPECT_EQ(OK, rv); | 3392 EXPECT_EQ(OK, rv); |
| 3393 EXPECT_TRUE(sock_->IsConnected()); | 3393 EXPECT_TRUE(sock_->IsConnected()); |
| 3394 EXPECT_TRUE(sock_->WasChannelIDSent()); | 3394 SSLInfo ssl_info; |
| 3395 ASSERT_TRUE(sock_->GetSSLInfo(&ssl_info)); |
| 3396 EXPECT_TRUE(ssl_info.channel_id_sent); |
| 3395 | 3397 |
| 3396 sock_->Disconnect(); | 3398 sock_->Disconnect(); |
| 3397 EXPECT_FALSE(sock_->IsConnected()); | 3399 EXPECT_FALSE(sock_->IsConnected()); |
| 3398 } | 3400 } |
| 3399 | 3401 |
| 3400 // Connect to a server using Channel ID but failing to look up the Channel | 3402 // Connect to a server using Channel ID but failing to look up the Channel |
| 3401 // ID. It should fail. | 3403 // ID. It should fail. |
| 3402 TEST_F(SSLClientSocketChannelIDTest, FailingChannelID) { | 3404 TEST_F(SSLClientSocketChannelIDTest, FailingChannelID) { |
| 3403 SpawnedTestServer::SSLOptions ssl_options; | 3405 SpawnedTestServer::SSLOptions ssl_options; |
| 3404 | 3406 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 3431 ssl_config.channel_id_enabled = true; | 3433 ssl_config.channel_id_enabled = true; |
| 3432 | 3434 |
| 3433 int rv; | 3435 int rv; |
| 3434 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 3436 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
| 3435 | 3437 |
| 3436 EXPECT_EQ(ERR_UNEXPECTED, rv); | 3438 EXPECT_EQ(ERR_UNEXPECTED, rv); |
| 3437 EXPECT_FALSE(sock_->IsConnected()); | 3439 EXPECT_FALSE(sock_->IsConnected()); |
| 3438 } | 3440 } |
| 3439 | 3441 |
| 3440 } // namespace net | 3442 } // namespace net |
| OLD | NEW |