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