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 "base/command_line.h" |
5 #include "base/metrics/statistics_recorder.h" | 6 #include "base/metrics/statistics_recorder.h" |
6 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
7 #include "build/build_config.h" | 8 #include "build/build_config.h" |
8 #include "crypto/nss_util.h" | 9 #include "crypto/nss_util.h" |
9 #include "net/socket/client_socket_pool_base.h" | 10 #include "net/socket/client_socket_pool_base.h" |
10 #include "net/socket/ssl_server_socket.h" | 11 #include "net/socket/ssl_server_socket.h" |
11 #include "net/spdy/spdy_session.h" | 12 #include "net/spdy/spdy_session.h" |
12 #include "net/test/net_test_suite.h" | 13 #include "net/test/net_test_suite.h" |
13 | 14 |
14 #if defined(OS_ANDROID) | 15 #if defined(OS_ANDROID) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // may initiate a call to Java. | 52 // may initiate a call to Java. |
52 base::android::RegisterNativeMethods( | 53 base::android::RegisterNativeMethods( |
53 base::android::AttachCurrentThread(), | 54 base::android::AttachCurrentThread(), |
54 kNetTestRegisteredMethods, | 55 kNetTestRegisteredMethods, |
55 arraysize(kNetTestRegisteredMethods)); | 56 arraysize(kNetTestRegisteredMethods)); |
56 #endif | 57 #endif |
57 | 58 |
58 NetTestSuite test_suite(argc, argv); | 59 NetTestSuite test_suite(argc, argv); |
59 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); | 60 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); |
60 | 61 |
| 62 // TODO(use_chrome_edk): This flag will go away and be default behavior soon, |
| 63 // but we explicitly add it here for test coverage. |
| 64 base::CommandLine::ForCurrentProcess()->AppendSwitch("use-new-edk"); |
| 65 |
61 #if defined(OS_WIN) && !defined(USE_OPENSSL) | 66 #if defined(OS_WIN) && !defined(USE_OPENSSL) |
62 // We want to be sure to init NSPR on the main thread. | 67 // We want to be sure to init NSPR on the main thread. |
63 crypto::EnsureNSPRInit(); | 68 crypto::EnsureNSPRInit(); |
64 #endif | 69 #endif |
65 | 70 |
66 // Enable support for SSL server sockets, which must be done while | 71 // Enable support for SSL server sockets, which must be done while |
67 // single-threaded. | 72 // single-threaded. |
68 net::EnableSSLServerSockets(); | 73 net::EnableSSLServerSockets(); |
69 | 74 |
70 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 75 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
71 mojo::embedder::Init(); | 76 mojo::embedder::Init(); |
72 #endif | 77 #endif |
73 | 78 |
74 return base::LaunchUnitTests( | 79 return base::LaunchUnitTests( |
75 argc, argv, base::Bind(&NetTestSuite::Run, | 80 argc, argv, base::Bind(&NetTestSuite::Run, |
76 base::Unretained(&test_suite))); | 81 base::Unretained(&test_suite))); |
77 } | 82 } |
OLD | NEW |