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/main_hook.h" | 6 #include "base/test/main_hook.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/base/net_test_suite.h" | 9 #include "net/base/net_test_suite.h" |
10 #include "net/socket/client_socket_pool_base.h" | 10 #include "net/socket/client_socket_pool_base.h" |
11 #include "net/socket/ssl_server_socket.h" | 11 #include "net/socket/ssl_server_socket.h" |
12 #include "net/spdy/spdy_session.h" | 12 #include "net/spdy/spdy_session.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 "net/android/net_jni_registrar.h" | 16 #include "net/android/net_jni_registrar.h" |
17 #endif | 17 #endif |
18 | 18 |
| 19 #if !defined(OS_IOS) |
| 20 #include "net/proxy/proxy_resolver_v8.h" |
| 21 #endif |
| 22 |
19 using net::internal::ClientSocketPoolBaseHelper; | 23 using net::internal::ClientSocketPoolBaseHelper; |
20 using net::SpdySession; | 24 using net::SpdySession; |
21 | 25 |
22 int main(int argc, char** argv) { | 26 int main(int argc, char** argv) { |
23 MainHook hook(main, argc, argv); | 27 MainHook hook(main, argc, argv); |
24 | 28 |
25 // Record histograms, so we can get histograms data in tests. | 29 // Record histograms, so we can get histograms data in tests. |
26 base::StatisticsRecorder::Initialize(); | 30 base::StatisticsRecorder::Initialize(); |
27 | 31 |
28 #if defined(OS_ANDROID) | 32 #if defined(OS_ANDROID) |
29 // Register JNI bindings for android. Doing it early as the test suite setup | 33 // Register JNI bindings for android. Doing it early as the test suite setup |
30 // may initiate a call to Java. | 34 // may initiate a call to Java. |
31 net::android::RegisterJni(base::android::AttachCurrentThread()); | 35 net::android::RegisterJni(base::android::AttachCurrentThread()); |
32 #endif | 36 #endif |
33 | 37 |
34 NetTestSuite test_suite(argc, argv); | 38 NetTestSuite test_suite(argc, argv); |
35 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); | 39 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); |
36 | 40 |
37 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
38 // We want to be sure to init NSPR on the main thread. | 42 // We want to be sure to init NSPR on the main thread. |
39 crypto::EnsureNSPRInit(); | 43 crypto::EnsureNSPRInit(); |
40 #endif | 44 #endif |
41 | 45 |
42 // Enable support for SSL server sockets, which must be done while | 46 // Enable support for SSL server sockets, which must be done while |
43 // single-threaded. | 47 // single-threaded. |
44 net::EnableSSLServerSockets(); | 48 net::EnableSSLServerSockets(); |
45 | 49 |
| 50 #if !defined(OS_IOS) |
| 51 // This has to be done on the main thread. |
| 52 net::ProxyResolverV8::RememberDefaultIsolate(); |
| 53 #endif |
| 54 |
46 return test_suite.Run(); | 55 return test_suite.Run(); |
47 } | 56 } |
OLD | NEW |