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/metrics/statistics_recorder.h" | 5 #include "base/metrics/statistics_recorder.h" |
6 #include "base/test/launcher/unit_test_launcher.h" | 6 #include "base/test/launcher/unit_test_launcher.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "crypto/nss_util.h" | 8 #include "crypto/nss_util.h" |
9 #include "net/socket/client_socket_pool_base.h" | 9 #include "net/socket/client_socket_pool_base.h" |
10 #include "net/socket/ssl_server_socket.h" | 10 #include "net/socket/ssl_server_socket.h" |
11 #include "net/spdy/spdy_session.h" | 11 #include "net/spdy/spdy_session.h" |
12 #include "net/test/net_test_suite.h" | 12 #include "net/test/net_test_suite.h" |
13 | 13 |
14 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
15 #include "base/android/jni_android.h" | 15 #include "base/android/jni_android.h" |
16 #include "base/android/jni_registrar.h" | 16 #include "base/android/jni_registrar.h" |
17 #include "base/test/test_file_util.h" | 17 #include "base/test/test_file_util.h" |
18 #include "base/test/test_ui_thread_android.h" | 18 #include "base/test/test_ui_thread_android.h" |
19 #include "net/android/dummy_spnego_authenticator.h" | 19 #include "net/android/dummy_spnego_authenticator.h" |
20 #include "net/android/net_jni_registrar.h" | 20 #include "net/android/net_jni_registrar.h" |
21 #endif | 21 #endif |
22 | 22 |
23 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) | 23 #if defined(USE_PLATFORM_ICU_ALTERNATIVES) |
24 #include "url/android/url_jni_registrar.h" // nogncheck | 24 #include "url/android/url_jni_registrar.h" // nogncheck |
25 #endif | 25 #endif |
26 | 26 |
27 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 27 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
28 #include "mojo/edk/embedder/embedder.h" // nogncheck | 28 #include "mojo/edk/embedder/embedder.h" // nogncheck |
29 #endif | 29 #endif |
30 | 30 |
31 using net::internal::ClientSocketPoolBaseHelper; | 31 using net::internal::ClientSocketPoolBaseHelper; |
32 using net::SpdySession; | 32 using net::SpdySession; |
33 | 33 |
34 int main(int argc, char** argv) { | 34 int main(int argc, char** argv) { |
35 // Record histograms, so we can get histograms data in tests. | 35 // Record histograms, so we can get histograms data in tests. |
36 base::StatisticsRecorder::Initialize(); | 36 base::StatisticsRecorder::Initialize(); |
37 | 37 |
38 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
39 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { | 39 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { |
40 {"DummySpnegoAuthenticator", | 40 {"DummySpnegoAuthenticator", |
41 net::android::DummySpnegoAuthenticator::RegisterJni}, | 41 net::android::DummySpnegoAuthenticator::RegisterJni}, |
42 {"NetAndroid", net::android::RegisterJni}, | 42 {"NetAndroid", net::android::RegisterJni}, |
43 {"TestFileUtil", base::RegisterContentUriTestUtils}, | 43 {"TestFileUtil", base::RegisterContentUriTestUtils}, |
44 {"TestUiThreadAndroid", base::RegisterTestUiThreadAndroid}, | 44 {"TestUiThreadAndroid", base::RegisterTestUiThreadAndroid}, |
45 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) | 45 #if defined(USE_PLATFORM_ICU_ALTERNATIVES) |
46 {"UrlAndroid", url::android::RegisterJni}, | 46 {"UrlAndroid", url::android::RegisterJni}, |
47 #endif | 47 #endif |
48 }; | 48 }; |
49 | 49 |
50 // Register JNI bindings for android. Doing it early as the test suite setup | 50 // Register JNI bindings for android. Doing it early as the test suite setup |
51 // may initiate a call to Java. | 51 // may initiate a call to Java. |
52 base::android::RegisterNativeMethods( | 52 base::android::RegisterNativeMethods( |
53 base::android::AttachCurrentThread(), | 53 base::android::AttachCurrentThread(), |
54 kNetTestRegisteredMethods, | 54 kNetTestRegisteredMethods, |
55 arraysize(kNetTestRegisteredMethods)); | 55 arraysize(kNetTestRegisteredMethods)); |
(...skipping 12 matching lines...) Expand all Loading... |
68 net::EnableSSLServerSockets(); | 68 net::EnableSSLServerSockets(); |
69 | 69 |
70 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 70 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
71 mojo::edk::Init(); | 71 mojo::edk::Init(); |
72 #endif | 72 #endif |
73 | 73 |
74 return base::LaunchUnitTests( | 74 return base::LaunchUnitTests( |
75 argc, argv, base::Bind(&NetTestSuite::Run, | 75 argc, argv, base::Bind(&NetTestSuite::Run, |
76 base::Unretained(&test_suite))); | 76 base::Unretained(&test_suite))); |
77 } | 77 } |
OLD | NEW |