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 |
| 27 #include "gin/public/isolate_holder.h" |
| 28 #endif |
| 29 |
26 using net::internal::ClientSocketPoolBaseHelper; | 30 using net::internal::ClientSocketPoolBaseHelper; |
27 using net::SpdySession; | 31 using net::SpdySession; |
28 | 32 |
29 int main(int argc, char** argv) { | 33 int main(int argc, char** argv) { |
30 // Record histograms, so we can get histograms data in tests. | 34 // Record histograms, so we can get histograms data in tests. |
31 base::StatisticsRecorder::Initialize(); | 35 base::StatisticsRecorder::Initialize(); |
32 | 36 |
33 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
34 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { | 38 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { |
35 {"NetAndroid", net::android::RegisterJni}, | 39 {"NetAndroid", net::android::RegisterJni}, |
(...skipping 14 matching lines...) Expand all Loading... |
50 | 54 |
51 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
52 // We want to be sure to init NSPR on the main thread. | 56 // We want to be sure to init NSPR on the main thread. |
53 crypto::EnsureNSPRInit(); | 57 crypto::EnsureNSPRInit(); |
54 #endif | 58 #endif |
55 | 59 |
56 // Enable support for SSL server sockets, which must be done while | 60 // Enable support for SSL server sockets, which must be done while |
57 // single-threaded. | 61 // single-threaded. |
58 net::EnableSSLServerSockets(); | 62 net::EnableSSLServerSockets(); |
59 | 63 |
| 64 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
| 65 gin::IsolateHolder::LoadV8Snapshot(); |
| 66 #endif |
| 67 |
60 #if !defined(OS_IOS) | 68 #if !defined(OS_IOS) |
61 net::ProxyResolverV8::EnsureIsolateCreated(); | 69 net::ProxyResolverV8::EnsureIsolateCreated(); |
62 #endif | 70 #endif |
63 | 71 |
64 return base::LaunchUnitTests( | 72 return base::LaunchUnitTests( |
65 argc, argv, base::Bind(&NetTestSuite::Run, | 73 argc, argv, base::Bind(&NetTestSuite::Run, |
66 base::Unretained(&test_suite))); | 74 base::Unretained(&test_suite))); |
67 } | 75 } |
OLD | NEW |