| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/platform_test.h" | |
| 6 #include "net/base/address_list.h" | 5 #include "net/base/address_list.h" |
| 7 #include "net/base/client_socket_factory.h" | 6 #include "net/base/client_socket_factory.h" |
| 8 #include "net/base/host_resolver.h" | 7 #include "net/base/host_resolver.h" |
| 9 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 10 #include "net/base/scoped_host_mapper.h" | 9 #include "net/base/scoped_host_mapper.h" |
| 11 #include "net/base/ssl_client_socket.h" | 10 #include "net/base/ssl_client_socket.h" |
| 12 #include "net/base/ssl_config_service.h" | 11 #include "net/base/ssl_config_service.h" |
| 13 #include "net/base/tcp_client_socket.h" | 12 #include "net/base/tcp_client_socket.h" |
| 14 #include "net/base/test_completion_callback.h" | 13 #include "net/base/test_completion_callback.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 #include "testing/platform_test.h" |
| 16 | 16 |
| 17 //----------------------------------------------------------------------------- | 17 //----------------------------------------------------------------------------- |
| 18 | 18 |
| 19 const net::SSLConfig kDefaultSSLConfig; | 19 const net::SSLConfig kDefaultSSLConfig; |
| 20 | 20 |
| 21 class SSLClientSocketTest : public PlatformTest { | 21 class SSLClientSocketTest : public PlatformTest { |
| 22 public: | 22 public: |
| 23 SSLClientSocketTest() | 23 SSLClientSocketTest() |
| 24 : socket_factory_(net::ClientSocketFactory::GetDefaultFactory()) { | 24 : socket_factory_(net::ClientSocketFactory::GetDefaultFactory()) { |
| 25 // TODO(darin): kill this exception once we have a way to test out the | 25 // TODO(darin): kill this exception once we have a way to test out the |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 char buf[512]; | 193 char buf[512]; |
| 194 rv = sock->Read(buf, sizeof(buf), &callback); | 194 rv = sock->Read(buf, sizeof(buf), &callback); |
| 195 EXPECT_TRUE(rv >= 0 || rv == net::ERR_IO_PENDING); | 195 EXPECT_TRUE(rv >= 0 || rv == net::ERR_IO_PENDING); |
| 196 | 196 |
| 197 if (rv == net::ERR_IO_PENDING) | 197 if (rv == net::ERR_IO_PENDING) |
| 198 rv = callback.WaitForResult(); | 198 rv = callback.WaitForResult(); |
| 199 | 199 |
| 200 EXPECT_NE(rv, 0); | 200 EXPECT_NE(rv, 0); |
| 201 } | 201 } |
| 202 | 202 |
| OLD | NEW |