| 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 "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2315 EXPECT_TRUE(sock->WasEverUsed()); | 2315 EXPECT_TRUE(sock->WasEverUsed()); |
| 2316 | 2316 |
| 2317 // TODO(davidben): Read one byte to ensure the test server has responded and | 2317 // TODO(davidben): Read one byte to ensure the test server has responded and |
| 2318 // then assert IsConnectedAndIdle is false. This currently doesn't work | 2318 // then assert IsConnectedAndIdle is false. This currently doesn't work |
| 2319 // because neither SSLClientSocketNSS nor SSLClientSocketOpenSSL check their | 2319 // because neither SSLClientSocketNSS nor SSLClientSocketOpenSSL check their |
| 2320 // SSL implementation's internal buffers. Either call PR_Available and | 2320 // SSL implementation's internal buffers. Either call PR_Available and |
| 2321 // SSL_pending, although the former isn't actually implemented or perhaps | 2321 // SSL_pending, although the former isn't actually implemented or perhaps |
| 2322 // attempt to read one byte extra. | 2322 // attempt to read one byte extra. |
| 2323 } | 2323 } |
| 2324 | 2324 |
| 2325 // This test is only enabled on NSS until False Start support is added for | 2325 TEST_F(SSLClientSocketFalseStartTest, FalseStartEnabled) { |
| 2326 // OpenSSL. http://crbug.com/354132 | |
| 2327 #if defined(USE_NSS) | |
| 2328 #define MAYBE_FalseStartEnabled FalseStartEnabled | |
| 2329 #else | |
| 2330 #define MAYBE_FalseStartEnabled DISABLED_FalseStartEnabled | |
| 2331 #endif // USE_NSS | |
| 2332 TEST_F(SSLClientSocketFalseStartTest, MAYBE_FalseStartEnabled) { | |
| 2333 // False Start requires NPN and a forward-secret cipher suite. | 2326 // False Start requires NPN and a forward-secret cipher suite. |
| 2334 SpawnedTestServer::SSLOptions server_options; | 2327 SpawnedTestServer::SSLOptions server_options; |
| 2335 server_options.key_exchanges = | 2328 server_options.key_exchanges = |
| 2336 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_DHE_RSA; | 2329 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_DHE_RSA; |
| 2337 server_options.enable_npn = true; | 2330 server_options.enable_npn = true; |
| 2338 SSLConfig client_config; | 2331 SSLConfig client_config; |
| 2339 client_config.next_protos.push_back("http/1.1"); | 2332 client_config.next_protos.push_back("http/1.1"); |
| 2340 TestFalseStart(server_options, client_config, true); | 2333 TestFalseStart(server_options, client_config, true); |
| 2341 } | 2334 } |
| 2342 | 2335 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2355 SpawnedTestServer::SSLOptions server_options; | 2348 SpawnedTestServer::SSLOptions server_options; |
| 2356 server_options.key_exchanges = | 2349 server_options.key_exchanges = |
| 2357 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_RSA; | 2350 SpawnedTestServer::SSLOptions::KEY_EXCHANGE_RSA; |
| 2358 server_options.enable_npn = true; | 2351 server_options.enable_npn = true; |
| 2359 SSLConfig client_config; | 2352 SSLConfig client_config; |
| 2360 client_config.next_protos.push_back("http/1.1"); | 2353 client_config.next_protos.push_back("http/1.1"); |
| 2361 TestFalseStart(server_options, client_config, false); | 2354 TestFalseStart(server_options, client_config, false); |
| 2362 } | 2355 } |
| 2363 | 2356 |
| 2364 } // namespace net | 2357 } // namespace net |
| OLD | NEW |