Index: services/service_manager/runner/host/service_process_launcher_unittest.cc |
diff --git a/services/service_manager/runner/host/service_process_launcher_unittest.cc b/services/service_manager/runner/host/service_process_launcher_unittest.cc |
index 866bd5b687c536728721bfbb8eda306f22ad10dd..cb6fd54cca4fb13116bd47aa57bb8e70890217c5 100644 |
--- a/services/service_manager/runner/host/service_process_launcher_unittest.cc |
+++ b/services/service_manager/runner/host/service_process_launcher_unittest.cc |
@@ -15,12 +15,17 @@ |
#include "base/message_loop/message_loop.h" |
#include "base/path_service.h" |
#include "base/run_loop.h" |
+#include "base/threading/thread.h" |
+#include "mojo/edk/embedder/embedder.h" |
+#include "mojo/edk/embedder/scoped_ipc_support.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace service_manager { |
namespace { |
const char kTestServiceName[] = "host_test_service"; |
+ |
+const base::FilePath::CharType kPackagesPath[] = FILE_PATH_LITERAL("Packages"); |
#if defined(OS_WIN) |
const base::FilePath::CharType kServiceExtension[] = |
@@ -66,7 +71,7 @@ |
#else |
#define MAYBE_StartJoin StartJoin |
#endif // defined(OS_ANDROID) |
-TEST(ServiceProcessLauncherTest, MAYBE_StartJoin) { |
+TEST(ServieProcessLauncherTest, MAYBE_StartJoin) { |
base::FilePath service_manager_dir; |
PathService::Get(base::DIR_MODULE, &service_manager_dir); |
base::MessageLoop message_loop; |
@@ -74,10 +79,18 @@ |
new base::SequencedWorkerPool(3, "blocking_pool", |
base::TaskPriority::USER_VISIBLE)); |
- base::FilePath test_service_path; |
- base::PathService::Get(base::DIR_EXE, &test_service_path); |
- test_service_path = test_service_path.AppendASCII(kTestServiceName) |
- .AddExtension(kServiceExtension); |
+ base::Thread io_thread("io_thread"); |
+ base::Thread::Options options; |
+ options.message_loop_type = base::MessageLoop::TYPE_IO; |
+ io_thread.StartWithOptions(options); |
+ |
+ auto ipc_support = base::MakeUnique<mojo::edk::ScopedIPCSupport>( |
+ io_thread.task_runner(), |
+ mojo::edk::ScopedIPCSupport::ShutdownPolicy::CLEAN); |
+ |
+ base::FilePath test_service_path = |
+ base::FilePath(kPackagesPath).AppendASCII(kTestServiceName) |
+ .AppendASCII(kTestServiceName) .AddExtension(kServiceExtension); |
ServiceProcessLauncherDelegateImpl service_process_launcher_delegate; |
ServiceProcessLauncher launcher(blocking_pool.get(), |
@@ -92,6 +105,7 @@ |
launcher.Join(); |
blocking_pool->Shutdown(); |
+ ipc_support.reset(); |
EXPECT_EQ(1u, service_process_launcher_delegate.get_and_clear_adjust_count()); |
} |