| 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 |
| 22 |
| 23 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) |
| 21 #include "url/android/url_jni_registrar.h" | 24 #include "url/android/url_jni_registrar.h" |
| 22 #endif | 25 #endif |
| 23 | 26 |
| 24 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 27 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 25 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" | 28 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" |
| 26 #endif | 29 #endif |
| 27 | 30 |
| 28 using net::internal::ClientSocketPoolBaseHelper; | 31 using net::internal::ClientSocketPoolBaseHelper; |
| 29 using net::SpdySession; | 32 using net::SpdySession; |
| 30 | 33 |
| 31 int main(int argc, char** argv) { | 34 int main(int argc, char** argv) { |
| 32 // Record histograms, so we can get histograms data in tests. | 35 // Record histograms, so we can get histograms data in tests. |
| 33 base::StatisticsRecorder::Initialize(); | 36 base::StatisticsRecorder::Initialize(); |
| 34 | 37 |
| 35 #if defined(OS_ANDROID) | 38 #if defined(OS_ANDROID) |
| 36 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { | 39 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { |
| 37 {"DummySpnegoAuthenticator", | 40 {"DummySpnegoAuthenticator", |
| 38 net::android::DummySpnegoAuthenticator::RegisterJni}, | 41 net::android::DummySpnegoAuthenticator::RegisterJni}, |
| 39 {"NetAndroid", net::android::RegisterJni}, | 42 {"NetAndroid", net::android::RegisterJni}, |
| 40 {"TestFileUtil", base::RegisterContentUriTestUtils}, | 43 {"TestFileUtil", base::RegisterContentUriTestUtils}, |
| 41 {"TestUiThreadAndroid", base::RegisterTestUiThreadAndroid}, | 44 {"TestUiThreadAndroid", base::RegisterTestUiThreadAndroid}, |
| 42 {"UrlAndroid", url::android::RegisterJni}, | 45 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) |
| 46 {"UrlAndroid", url::android::RegisterJni}, |
| 47 #endif |
| 43 }; | 48 }; |
| 44 | 49 |
| 45 // 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 |
| 46 // may initiate a call to Java. | 51 // may initiate a call to Java. |
| 47 base::android::RegisterNativeMethods( | 52 base::android::RegisterNativeMethods( |
| 48 base::android::AttachCurrentThread(), | 53 base::android::AttachCurrentThread(), |
| 49 kNetTestRegisteredMethods, | 54 kNetTestRegisteredMethods, |
| 50 arraysize(kNetTestRegisteredMethods)); | 55 arraysize(kNetTestRegisteredMethods)); |
| 51 #endif | 56 #endif |
| 52 | 57 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 63 net::EnableSSLServerSockets(); | 68 net::EnableSSLServerSockets(); |
| 64 | 69 |
| 65 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 70 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 66 mojo::embedder::test::InitWithSimplePlatformSupport(); | 71 mojo::embedder::test::InitWithSimplePlatformSupport(); |
| 67 #endif | 72 #endif |
| 68 | 73 |
| 69 return base::LaunchUnitTests( | 74 return base::LaunchUnitTests( |
| 70 argc, argv, base::Bind(&NetTestSuite::Run, | 75 argc, argv, base::Bind(&NetTestSuite::Run, |
| 71 base::Unretained(&test_suite))); | 76 base::Unretained(&test_suite))); |
| 72 } | 77 } |
| OLD | NEW |