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

Unified Diff: ipc/mojo/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/mojo/ipc_mojo_perftest.cc ('k') | ipc/mojo/scoped_ipc_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/run_all_unittests.cc
diff --git a/ipc/mojo/run_all_unittests.cc b/ipc/mojo/run_all_unittests.cc
index 43a1e4e0e8d5d2cfef3e506ce32c53a941f342a9..3fe26647f450e609794a7802451bed2af6fefe43 100644
--- a/ipc/mojo/run_all_unittests.cc
+++ b/ipc/mojo/run_all_unittests.cc
@@ -4,10 +4,13 @@
#include "base/at_exit.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_io_thread.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
-#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/embedder.h"
+#include "mojo/edk/embedder/platform_channel_pair.h"
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
@@ -20,7 +23,24 @@ int main(int argc, char** argv) {
base::RegisterContentUriTestUtils(env);
#endif
base::TestSuite test_suite(argc, argv);
- mojo::embedder::Init();
+ // Must be run before mojo::edk::Init.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("broker-handle")) {
+ mojo::edk::PreInitializeChildProcess();
+ }
+
+ base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart);
+ mojo::edk::Init(test_io_thread.task_runner());
+
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("broker-handle")) {
+ std::string broker_handle_str =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ "broker-handle");
+ mojo::edk::ScopedPlatformHandle broker_handle =
+ mojo::edk::PlatformChannelPair::
+ PassClientHandleFromParentProcessFromString(broker_handle_str);
+ mojo::edk::SetParentPipeHandle(std::move(broker_handle));
+ }
+
return base::LaunchUnitTestsSerially(
argc, argv,
base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite)));
« no previous file with comments | « ipc/mojo/ipc_mojo_perftest.cc ('k') | ipc/mojo/scoped_ipc_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698