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 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS, | 2088 SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS, |
2089 SpawnedTestServer::kLocalhost, | 2089 SpawnedTestServer::kLocalhost, |
2090 base::FilePath()); | 2090 base::FilePath()); |
2091 ASSERT_TRUE(test_server.Start()); | 2091 ASSERT_TRUE(test_server.Start()); |
2092 | 2092 |
2093 AddressList addr; | 2093 AddressList addr; |
2094 ASSERT_TRUE(test_server.GetAddressList(&addr)); | 2094 ASSERT_TRUE(test_server.GetAddressList(&addr)); |
2095 | 2095 |
2096 TestCompletionCallback callback; | 2096 TestCompletionCallback callback; |
2097 CapturingNetLog log; | 2097 CapturingNetLog log; |
2098 log.SetLogLevel(NetLog::LOG_ALL); | 2098 log.SetCaptureMode(NetLogCaptureMode::All()); |
2099 scoped_ptr<StreamSocket> transport( | 2099 scoped_ptr<StreamSocket> transport( |
2100 new TCPClientSocket(addr, &log, NetLog::Source())); | 2100 new TCPClientSocket(addr, &log, NetLog::Source())); |
2101 int rv = transport->Connect(callback.callback()); | 2101 int rv = transport->Connect(callback.callback()); |
2102 if (rv == ERR_IO_PENDING) | 2102 if (rv == ERR_IO_PENDING) |
2103 rv = callback.WaitForResult(); | 2103 rv = callback.WaitForResult(); |
2104 EXPECT_EQ(OK, rv); | 2104 EXPECT_EQ(OK, rv); |
2105 | 2105 |
2106 scoped_ptr<SSLClientSocket> sock(CreateSSLClientSocket( | 2106 scoped_ptr<SSLClientSocket> sock(CreateSSLClientSocket( |
2107 transport.Pass(), test_server.host_port_pair(), SSLConfig())); | 2107 transport.Pass(), test_server.host_port_pair(), SSLConfig())); |
2108 | 2108 |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3223 ssl_config.channel_id_enabled = true; | 3223 ssl_config.channel_id_enabled = true; |
3224 | 3224 |
3225 int rv; | 3225 int rv; |
3226 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 3226 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
3227 | 3227 |
3228 EXPECT_EQ(ERR_UNEXPECTED, rv); | 3228 EXPECT_EQ(ERR_UNEXPECTED, rv); |
3229 EXPECT_FALSE(sock_->IsConnected()); | 3229 EXPECT_FALSE(sock_->IsConnected()); |
3230 } | 3230 } |
3231 | 3231 |
3232 } // namespace net | 3232 } // namespace net |
OLD | NEW |