Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: net/test/run_all_unittests.cc

Issue 1554443003: Stop linking in the old Mojo EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and fix new flaky test Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/net.gyp ('k') | testing/buildbot/gn_isolate_map.pyl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/test/test_io_thread.h"
7 #include "build/build_config.h" 8 #include "build/build_config.h"
8 #include "crypto/nss_util.h" 9 #include "crypto/nss_util.h"
9 #include "net/socket/client_socket_pool_base.h" 10 #include "net/socket/client_socket_pool_base.h"
10 #include "net/socket/ssl_server_socket.h" 11 #include "net/socket/ssl_server_socket.h"
11 #include "net/spdy/spdy_session.h" 12 #include "net/spdy/spdy_session.h"
12 #include "net/test/net_test_suite.h" 13 #include "net/test/net_test_suite.h"
13 14
14 #if defined(OS_ANDROID) 15 #if defined(OS_ANDROID)
15 #include "base/android/jni_android.h" 16 #include "base/android/jni_android.h"
16 #include "base/android/jni_registrar.h" 17 #include "base/android/jni_registrar.h"
17 #include "base/test/test_file_util.h" 18 #include "base/test/test_file_util.h"
18 #include "base/test/test_ui_thread_android.h" 19 #include "base/test/test_ui_thread_android.h"
19 #include "net/android/dummy_spnego_authenticator.h" 20 #include "net/android/dummy_spnego_authenticator.h"
20 #include "net/android/net_jni_registrar.h" 21 #include "net/android/net_jni_registrar.h"
21 #endif 22 #endif
22 23
23 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) 24 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID)
24 #include "url/android/url_jni_registrar.h" 25 #include "url/android/url_jni_registrar.h"
25 #endif 26 #endif
26 27
27 #if !defined(OS_ANDROID) && !defined(OS_IOS) 28 #if !defined(OS_ANDROID) && !defined(OS_IOS)
28 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" 29 #include "mojo/edk/embedder/embedder.h"
29 #endif 30 #endif
30 31
31 using net::internal::ClientSocketPoolBaseHelper; 32 using net::internal::ClientSocketPoolBaseHelper;
32 using net::SpdySession; 33 using net::SpdySession;
33 34
34 int main(int argc, char** argv) { 35 int main(int argc, char** argv) {
35 // Record histograms, so we can get histograms data in tests. 36 // Record histograms, so we can get histograms data in tests.
36 base::StatisticsRecorder::Initialize(); 37 base::StatisticsRecorder::Initialize();
37 38
38 #if defined(OS_ANDROID) 39 #if defined(OS_ANDROID)
39 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = { 40 const base::android::RegistrationMethod kNetTestRegisteredMethods[] = {
40 {"DummySpnegoAuthenticator", 41 {"DummySpnegoAuthenticator",
41 net::android::DummySpnegoAuthenticator::RegisterJni}, 42 net::android::DummySpnegoAuthenticator::RegisterJni},
42 {"NetAndroid", net::android::RegisterJni}, 43 {"NetAndroid", net::android::RegisterJni},
43 {"TestFileUtil", base::RegisterContentUriTestUtils}, 44 {"TestFileUtil", base::RegisterContentUriTestUtils},
44 {"TestUiThreadAndroid", base::RegisterTestUiThreadAndroid}, 45 {"TestUiThreadAndroid", base::RegisterTestUiThreadAndroid},
45 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID) 46 #if defined(USE_ICU_ALTERNATIVES_ON_ANDROID)
46 {"UrlAndroid", url::android::RegisterJni}, 47 {"UrlAndroid", url::android::RegisterJni},
47 #endif 48 #endif
48 }; 49 };
49 50
50 // Register JNI bindings for android. Doing it early as the test suite setup 51 // Register JNI bindings for android. Doing it early as the test suite setup
51 // may initiate a call to Java. 52 // may initiate a call to Java.
52 base::android::RegisterNativeMethods( 53 base::android::RegisterNativeMethods(
53 base::android::AttachCurrentThread(), 54 base::android::AttachCurrentThread(),
54 kNetTestRegisteredMethods, 55 kNetTestRegisteredMethods,
55 arraysize(kNetTestRegisteredMethods)); 56 arraysize(kNetTestRegisteredMethods));
56 #endif 57 #endif
57 58
59 scoped_refptr<base::TaskRunner> io_task_runner;
58 NetTestSuite test_suite(argc, argv); 60 NetTestSuite test_suite(argc, argv);
59 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false); 61 ClientSocketPoolBaseHelper::set_connect_backup_jobs_enabled(false);
60 62
61 #if defined(OS_WIN) && !defined(USE_OPENSSL) 63 #if defined(OS_WIN) && !defined(USE_OPENSSL)
62 // We want to be sure to init NSPR on the main thread. 64 // We want to be sure to init NSPR on the main thread.
63 crypto::EnsureNSPRInit(); 65 crypto::EnsureNSPRInit();
64 #endif 66 #endif
65 67
66 // Enable support for SSL server sockets, which must be done while 68 // Enable support for SSL server sockets, which must be done while
67 // single-threaded. 69 // single-threaded.
68 net::EnableSSLServerSockets(); 70 net::EnableSSLServerSockets();
69 71
70 #if !defined(OS_ANDROID) && !defined(OS_IOS) 72 #if !defined(OS_ANDROID) && !defined(OS_IOS)
71 mojo::embedder::Init(); 73 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart);
74 io_task_runner = test_io_thread.task_runner();
75 mojo::edk::Init(io_task_runner.get());
72 #endif 76 #endif
73 77
74 return base::LaunchUnitTests( 78 return base::LaunchUnitTests(
75 argc, argv, base::Bind(&NetTestSuite::Run, 79 argc, argv, base::Bind(&NetTestSuite::Run,
76 base::Unretained(&test_suite))); 80 base::Unretained(&test_suite)));
77 } 81 }
OLDNEW
« no previous file with comments | « net/net.gyp ('k') | testing/buildbot/gn_isolate_map.pyl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698