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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2099 SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS, | 2099 SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS, |
2100 SpawnedTestServer::kLocalhost, | 2100 SpawnedTestServer::kLocalhost, |
2101 base::FilePath()); | 2101 base::FilePath()); |
2102 ASSERT_TRUE(test_server.Start()); | 2102 ASSERT_TRUE(test_server.Start()); |
2103 | 2103 |
2104 AddressList addr; | 2104 AddressList addr; |
2105 ASSERT_TRUE(test_server.GetAddressList(&addr)); | 2105 ASSERT_TRUE(test_server.GetAddressList(&addr)); |
2106 | 2106 |
2107 TestCompletionCallback callback; | 2107 TestCompletionCallback callback; |
2108 TestNetLog log; | 2108 TestNetLog log; |
2109 log.SetLogLevel(NetLog::LOG_ALL); | 2109 log.SetCaptureMode(NetLogCaptureMode::IncludeSocketBytes()); |
2110 scoped_ptr<StreamSocket> transport( | 2110 scoped_ptr<StreamSocket> transport( |
2111 new TCPClientSocket(addr, &log, NetLog::Source())); | 2111 new TCPClientSocket(addr, &log, NetLog::Source())); |
2112 int rv = transport->Connect(callback.callback()); | 2112 int rv = transport->Connect(callback.callback()); |
2113 if (rv == ERR_IO_PENDING) | 2113 if (rv == ERR_IO_PENDING) |
2114 rv = callback.WaitForResult(); | 2114 rv = callback.WaitForResult(); |
2115 EXPECT_EQ(OK, rv); | 2115 EXPECT_EQ(OK, rv); |
2116 | 2116 |
2117 scoped_ptr<SSLClientSocket> sock(CreateSSLClientSocket( | 2117 scoped_ptr<SSLClientSocket> sock(CreateSSLClientSocket( |
2118 transport.Pass(), test_server.host_port_pair(), SSLConfig())); | 2118 transport.Pass(), test_server.host_port_pair(), SSLConfig())); |
2119 | 2119 |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3431 ssl_config.channel_id_enabled = true; | 3431 ssl_config.channel_id_enabled = true; |
3432 | 3432 |
3433 int rv; | 3433 int rv; |
3434 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 3434 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
3435 | 3435 |
3436 EXPECT_EQ(ERR_UNEXPECTED, rv); | 3436 EXPECT_EQ(ERR_UNEXPECTED, rv); |
3437 EXPECT_FALSE(sock_->IsConnected()); | 3437 EXPECT_FALSE(sock_->IsConnected()); |
3438 } | 3438 } |
3439 | 3439 |
3440 } // namespace net | 3440 } // namespace net |
OLD | NEW |