Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: net/test/test_server.cc

Issue 7744004: Avoid long test_server timeouts by using action_timeout_ms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | net/test/test_server_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/test/test_server.h" 5 #include "net/test/test_server.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 21 matching lines...) Expand all
32 #include "net/base/test_completion_callback.h" 32 #include "net/base/test_completion_callback.h"
33 #include "net/base/test_root_certs.h" 33 #include "net/base/test_root_certs.h"
34 #include "net/socket/tcp_client_socket.h" 34 #include "net/socket/tcp_client_socket.h"
35 #include "net/test/python_utils.h" 35 #include "net/test/python_utils.h"
36 #include "testing/platform_test.h" 36 #include "testing/platform_test.h"
37 37
38 namespace net { 38 namespace net {
39 39
40 namespace { 40 namespace {
41 41
42 // Number of connection attempts for tests.
43 const int kServerConnectionAttempts = 10;
44
45 // Connection timeout in milliseconds for tests.
46 const int kServerConnectionTimeoutMs = 1000;
47
48 std::string GetHostname(TestServer::Type type, 42 std::string GetHostname(TestServer::Type type,
49 const TestServer::HTTPSOptions& options) { 43 const TestServer::HTTPSOptions& options) {
50 if (type == TestServer::TYPE_HTTPS && 44 if (type == TestServer::TYPE_HTTPS &&
51 options.server_certificate == 45 options.server_certificate ==
52 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME) { 46 TestServer::HTTPSOptions::CERT_MISMATCHED_NAME) {
53 // Return a different hostname string that resolves to the same hostname. 47 // Return a different hostname string that resolves to the same hostname.
54 return "localhost"; 48 return "localhost";
55 } 49 }
56 50
57 return "127.0.0.1"; 51 return "127.0.0.1";
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256) 402 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_AES256)
409 command_line->AppendArg(kBulkCipherSwitch + "=aes256"); 403 command_line->AppendArg(kBulkCipherSwitch + "=aes256");
410 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES) 404 if (https_options_.bulk_ciphers & HTTPSOptions::BULK_CIPHER_3DES)
411 command_line->AppendArg(kBulkCipherSwitch + "=3des"); 405 command_line->AppendArg(kBulkCipherSwitch + "=3des");
412 } 406 }
413 407
414 return true; 408 return true;
415 } 409 }
416 410
417 } // namespace net 411 } // namespace net
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_test.cc ('k') | net/test/test_server_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698