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 "net/android/net_jni_registrar.h" | 19 #include "net/android/net_jni_registrar.h" |
19 #include "url/android/url_jni_registrar.h" | 20 #include "url/android/url_jni_registrar.h" |
20 #endif | 21 #endif |
21 | 22 |
22 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 23 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
23 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" | 24 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" |
24 #endif | 25 #endif |
25 | 26 |
26 using net::internal::ClientSocketPoolBaseHelper; | 27 using net::internal::ClientSocketPoolBaseHelper; |
27 using net::SpdySession; | 28 using net::SpdySession; |
28 | 29 |
29 int main(int argc, char** argv) { | 30 int main(int argc, char** argv) { |
30 // Record histograms, so we can get histograms data in tests. | 31 // Record histograms, so we can get histograms data in tests. |
31 base::StatisticsRecorder::Initialize(); | 32 base::StatisticsRecorder::Initialize(); |
32 | 33 |
33 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
34 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { | 35 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { |
35 {"NetAndroid", net::android::RegisterJni}, | 36 {"NetAndroid", net::android::RegisterJni}, |
36 {"TestFileUtil", base::RegisterContentUriTestUtils}, | 37 {"TestFileUtil", base::RegisterContentUriTestUtils}, |
37 {"UrlAndroid", url::android::RegisterJni}, | 38 {"TestUiThreadAndroid", base::RegisterTestUiThreadAndroid}, |
| 39 {"UrlAndroid", url::android::RegisterJni}, |
38 }; | 40 }; |
39 | 41 |
40 // Register JNI bindings for android. Doing it early as the test suite setup | 42 // Register JNI bindings for android. Doing it early as the test suite setup |
41 // may initiate a call to Java. | 43 // may initiate a call to Java. |
42 base::android::RegisterNativeMethods( | 44 base::android::RegisterNativeMethods( |
43 base::android::AttachCurrentThread(), | 45 base::android::AttachCurrentThread(), |
44 kNetTestRegisteredMethods, | 46 kNetTestRegisteredMethods, |
45 arraysize(kNetTestRegisteredMethods)); | 47 arraysize(kNetTestRegisteredMethods)); |
46 #endif | 48 #endif |
47 | 49 |
(...skipping 10 matching lines...) Expand all Loading... |
58 net::EnableSSLServerSockets(); | 60 net::EnableSSLServerSockets(); |
59 | 61 |
60 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 62 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
61 mojo::embedder::test::InitWithSimplePlatformSupport(); | 63 mojo::embedder::test::InitWithSimplePlatformSupport(); |
62 #endif | 64 #endif |
63 | 65 |
64 return base::LaunchUnitTests( | 66 return base::LaunchUnitTests( |
65 argc, argv, base::Bind(&NetTestSuite::Run, | 67 argc, argv, base::Bind(&NetTestSuite::Run, |
66 base::Unretained(&test_suite))); | 68 base::Unretained(&test_suite))); |
67 } | 69 } |
OLD | NEW |