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