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 "net/android/net_jni_registrar.h" | 18 #include "net/android/net_jni_registrar.h" |
19 #include "url/android/url_jni_registrar.h" | 19 #include "url/android/url_jni_registrar.h" |
20 #endif | 20 #endif |
21 | 21 |
22 #if !defined(OS_IOS) | 22 #if !defined(OS_IOS) |
23 #include "net/proxy/proxy_resolver_v8.h" | 23 #include "net/proxy/proxy_resolver_v8.h" |
24 #endif | 24 #endif |
25 | 25 |
26 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 26 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
27 #include "gin/public/isolate_holder.h" | 27 #include "gin/public/isolate_holder.h" |
28 #endif | 28 #endif |
29 | 29 |
30 #if !defined(OS_ANDROID) && !defined(OS_IOS) | |
31 #include "third_party/mojo/src/mojo/edk/embedder/test_embedder.h" | |
32 #endif | |
33 | |
30 using net::internal::ClientSocketPoolBaseHelper; | 34 using net::internal::ClientSocketPoolBaseHelper; |
31 using net::SpdySession; | 35 using net::SpdySession; |
32 | 36 |
33 int main(int argc, char** argv) { | 37 int main(int argc, char** argv) { |
34 // Record histograms, so we can get histograms data in tests. | 38 // Record histograms, so we can get histograms data in tests. |
35 base::StatisticsRecorder::Initialize(); | 39 base::StatisticsRecorder::Initialize(); |
36 | 40 |
37 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
38 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { | 42 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { |
39 {"NetAndroid", net::android::RegisterJni}, | 43 {"NetAndroid", net::android::RegisterJni}, |
(...skipping 22 matching lines...) Expand all Loading... | |
62 net::EnableSSLServerSockets(); | 66 net::EnableSSLServerSockets(); |
63 | 67 |
64 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 68 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
65 gin::IsolateHolder::LoadV8Snapshot(); | 69 gin::IsolateHolder::LoadV8Snapshot(); |
66 #endif | 70 #endif |
67 | 71 |
68 #if !defined(OS_IOS) | 72 #if !defined(OS_IOS) |
69 net::ProxyResolverV8::EnsureIsolateCreated(); | 73 net::ProxyResolverV8::EnsureIsolateCreated(); |
70 #endif | 74 #endif |
71 | 75 |
76 #if !defined(OS_ANDROID) && !defined(OS_IOS) | |
77 mojo::embedder::test::InitWithSimplePlatformSupport(); | |
jamesr
2015/02/13 00:59:54
you need a corresponding Shutdown() call after run
Anand Mistry (off Chromium)
2015/02/13 02:29:08
Unfortunately, my test starts CHECK failing after
| |
78 #endif | |
79 | |
72 return base::LaunchUnitTests( | 80 return base::LaunchUnitTests( |
73 argc, argv, base::Bind(&NetTestSuite::Run, | 81 argc, argv, base::Bind(&NetTestSuite::Run, |
74 base::Unretained(&test_suite))); | 82 base::Unretained(&test_suite))); |
75 } | 83 } |
OLD | NEW |