| 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 "net/socket/ssl_client_socket.h" |
| 6 |
| 5 #include "net/base/address_list.h" | 7 #include "net/base/address_list.h" |
| 6 #include "net/base/client_socket_factory.h" | |
| 7 #include "net/base/host_resolver.h" | 8 #include "net/base/host_resolver.h" |
| 8 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 9 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 10 #include "net/base/ssl_client_socket.h" | |
| 11 #include "net/base/ssl_config_service.h" | 11 #include "net/base/ssl_config_service.h" |
| 12 #include "net/base/ssl_test_util.h" | |
| 13 #include "net/base/tcp_client_socket.h" | |
| 14 #include "net/base/test_completion_callback.h" | 12 #include "net/base/test_completion_callback.h" |
| 13 #include "net/socket/client_socket_factory.h" |
| 14 #include "net/socket/ssl_test_util.h" |
| 15 #include "net/socket/tcp_client_socket.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "testing/platform_test.h" | 17 #include "testing/platform_test.h" |
| 17 | 18 |
| 18 //----------------------------------------------------------------------------- | 19 //----------------------------------------------------------------------------- |
| 19 | 20 |
| 20 const net::SSLConfig kDefaultSSLConfig; | 21 const net::SSLConfig kDefaultSSLConfig; |
| 21 | 22 |
| 22 class SSLClientSocketTest : public PlatformTest { | 23 class SSLClientSocketTest : public PlatformTest { |
| 23 public: | 24 public: |
| 24 SSLClientSocketTest() | 25 SSLClientSocketTest() |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // Do a partial read and then exit. This test should not crash! | 362 // Do a partial read and then exit. This test should not crash! |
| 362 scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(512); | 363 scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(512); |
| 363 rv = sock->Read(buf, 512, &callback); | 364 rv = sock->Read(buf, 512, &callback); |
| 364 EXPECT_TRUE(rv >= 0 || rv == net::ERR_IO_PENDING); | 365 EXPECT_TRUE(rv >= 0 || rv == net::ERR_IO_PENDING); |
| 365 | 366 |
| 366 if (rv == net::ERR_IO_PENDING) | 367 if (rv == net::ERR_IO_PENDING) |
| 367 rv = callback.WaitForResult(); | 368 rv = callback.WaitForResult(); |
| 368 | 369 |
| 369 EXPECT_NE(rv, 0); | 370 EXPECT_NE(rv, 0); |
| 370 } | 371 } |
| OLD | NEW |