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" | |
6 #include "base/metrics/statistics_recorder.h" | 5 #include "base/metrics/statistics_recorder.h" |
7 #include "base/test/launcher/unit_test_launcher.h" | 6 #include "base/test/launcher/unit_test_launcher.h" |
8 #include "build/build_config.h" | 7 #include "build/build_config.h" |
9 #include "crypto/nss_util.h" | 8 #include "crypto/nss_util.h" |
10 #include "net/socket/client_socket_pool_base.h" | 9 #include "net/socket/client_socket_pool_base.h" |
11 #include "net/socket/ssl_server_socket.h" | 10 #include "net/socket/ssl_server_socket.h" |
12 #include "net/spdy/spdy_session.h" | 11 #include "net/spdy/spdy_session.h" |
13 #include "net/test/net_test_suite.h" | 12 #include "net/test/net_test_suite.h" |
14 | 13 |
15 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
16 #include "base/android/jni_android.h" | 15 #include "base/android/jni_android.h" |
17 #include "base/android/jni_registrar.h" | 16 #include "base/android/jni_registrar.h" |
18 #include "base/test/test_file_util.h" | 17 #include "base/test/test_file_util.h" |
19 #include "base/test/test_ui_thread_android.h" | 18 #include "base/test/test_ui_thread_android.h" |
20 #include "net/android/dummy_spnego_authenticator.h" | 19 #include "net/android/dummy_spnego_authenticator.h" |
21 #include "net/android/net_jni_registrar.h" | 20 #include "net/android/net_jni_registrar.h" |
22 #endif | 21 #endif |
23 | 22 |
24 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) | 23 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) |
25 #include "url/android/url_jni_registrar.h" | 24 #include "url/android/url_jni_registrar.h" |
26 #endif | 25 #endif |
27 | 26 |
28 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 27 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
29 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 28 #include "mojo/edk/embedder/embedder.h" |
30 #endif | 29 #endif |
31 | 30 |
32 using net::internal::ClientSocketPoolBaseHelper; | 31 using net::internal::ClientSocketPoolBaseHelper; |
33 using net::SpdySession; | 32 using net::SpdySession; |
34 | 33 |
35 int main(int argc, char** argv) { | 34 int main(int argc, char** argv) { |
36 // Record histograms, so we can get histograms data in tests. | 35 // Record histograms, so we can get histograms data in tests. |
37 base::StatisticsRecorder::Initialize(); | 36 base::StatisticsRecorder::Initialize(); |
38 | 37 |
39 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
(...skipping 12 matching lines...) Expand all Loading... |
52 // may initiate a call to Java. | 51 // may initiate a call to Java. |
53 base::android::RegisterNativeMethods( | 52 base::android::RegisterNativeMethods( |
54 base::android::AttachCurrentThread(), | 53 base::android::AttachCurrentThread(), |
55 kNetTestRegisteredMethods, | 54 kNetTestRegisteredMethods, |
56 arraysize(kNetTestRegisteredMethods)); | 55 arraysize(kNetTestRegisteredMethods)); |
57 #endif | 56 #endif |
58 | 57 |
59 NetTestSuite test_suite(argc, argv); | 58 NetTestSuite test_suite(argc, argv); |
60 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); | 59 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); |
61 | 60 |
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 | |
66 #if defined(OS_WIN) && !defined(USE_OPENSSL) | 61 #if defined(OS_WIN) && !defined(USE_OPENSSL) |
67 // We want to be sure to init NSPR on the main thread. | 62 // We want to be sure to init NSPR on the main thread. |
68 crypto::EnsureNSPRInit(); | 63 crypto::EnsureNSPRInit(); |
69 #endif | 64 #endif |
70 | 65 |
71 // Enable support for SSL server sockets, which must be done while | 66 // Enable support for SSL server sockets, which must be done while |
72 // single-threaded. | 67 // single-threaded. |
73 net::EnableSSLServerSockets(); | 68 net::EnableSSLServerSockets(); |
74 | 69 |
75 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 70 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
76 mojo::embedder::Init(); | 71 mojo::edk::Init(); |
77 #endif | 72 #endif |
78 | 73 |
79 return base::LaunchUnitTests( | 74 return base::LaunchUnitTests( |
80 argc, argv, base::Bind(&NetTestSuite::Run, | 75 argc, argv, base::Bind(&NetTestSuite::Run, |
81 base::Unretained(&test_suite))); | 76 base::Unretained(&test_suite))); |
82 } | 77 } |
OLD | NEW |