| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <arpa/inet.h> | 5 #include <arpa/inet.h> |
| 6 #include <netinet/tcp.h> | 6 #include <netinet/tcp.h> |
| 7 #include <stdarg.h> | 7 #include <stdarg.h> |
| 8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 localhost.push_back(127); | 185 localhost.push_back(127); |
| 186 localhost.push_back(0); | 186 localhost.push_back(0); |
| 187 localhost.push_back(0); | 187 localhost.push_back(0); |
| 188 localhost.push_back(1); | 188 localhost.push_back(1); |
| 189 AddressList addr_list(localhost, 443, false); | 189 AddressList addr_list(localhost, 443, false); |
| 190 TCPClientSocket* transport = new TCPClientSocket( | 190 TCPClientSocket* transport = new TCPClientSocket( |
| 191 addr_list, &log_, NetLog::Source()); | 191 addr_list, &log_, NetLog::Source()); |
| 192 | 192 |
| 193 transport->AdoptSocket(client_); | 193 transport->AdoptSocket(client_); |
| 194 scoped_ptr<SSLClientSocket> sock( | 194 scoped_ptr<SSLClientSocket> sock( |
| 195 socket_factory_->CreateSSLClientSocket(transport, | 195 socket_factory_->CreateSSLClientSocket( |
| 196 "example.com", ssl_config_, new TestSSLHostInfo())); | 196 transport, HostPortPair("example.com", 443), ssl_config_, |
| 197 new TestSSLHostInfo())); |
| 197 | 198 |
| 198 TestCompletionCallback callback; | 199 TestCompletionCallback callback; |
| 199 int rv = sock->Connect(&callback); | 200 int rv = sock->Connect(&callback); |
| 200 if (rv != OK) { | 201 if (rv != OK) { |
| 201 ASSERT_EQ(ERR_IO_PENDING, rv); | 202 ASSERT_EQ(ERR_IO_PENDING, rv); |
| 202 EXPECT_FALSE(sock->IsConnected()); | 203 EXPECT_FALSE(sock->IsConnected()); |
| 203 rv = callback.WaitForResult(); | 204 rv = callback.WaitForResult(); |
| 204 EXPECT_EQ(OK, rv); | 205 EXPECT_EQ(OK, rv); |
| 205 } | 206 } |
| 206 EXPECT_TRUE(sock->IsConnected()); | 207 EXPECT_TRUE(sock->IsConnected()); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 StartSnapStartServer("snap-start-recovery", NULL); | 312 StartSnapStartServer("snap-start-recovery", NULL); |
| 312 PerformConnection(); | 313 PerformConnection(); |
| 313 EXPECT_EQ(SSL_SNAP_START_NONE, SnapStartEventType()); | 314 EXPECT_EQ(SSL_SNAP_START_NONE, SnapStartEventType()); |
| 314 EXPECT_FALSE(DidMerge()); | 315 EXPECT_FALSE(DidMerge()); |
| 315 PerformConnection(); | 316 PerformConnection(); |
| 316 EXPECT_EQ(SSL_SNAP_START_RESUME_RECOVERY, SnapStartEventType()); | 317 EXPECT_EQ(SSL_SNAP_START_RESUME_RECOVERY, SnapStartEventType()); |
| 317 EXPECT_TRUE(DidMerge()); | 318 EXPECT_TRUE(DidMerge()); |
| 318 } | 319 } |
| 319 | 320 |
| 320 } // namespace net | 321 } // namespace net |
| OLD | NEW |