| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/files/file_path.h" | |
| 7 #include "base/message_loop/message_loop.h" | |
| 8 #include "base/test/launcher/unit_test_launcher.h" | 6 #include "base/test/launcher/unit_test_launcher.h" |
| 9 #include "base/threading/thread.h" | |
| 10 #include "mash/test/mash_test_suite.h" | 7 #include "mash/test/mash_test_suite.h" |
| 11 #include "mojo/edk/embedder/embedder.h" | |
| 12 #include "mojo/edk/embedder/scoped_ipc_support.h" | |
| 13 #include "services/catalog/catalog.h" | |
| 14 | 8 |
| 15 namespace { | 9 int MasterProcessMain(int argc, char** argv) { |
| 16 | |
| 17 const base::FilePath::CharType kCatalogFilename[] = | |
| 18 FILE_PATH_LITERAL("mash_unittests_catalog.json"); | |
| 19 | |
| 20 } // namespace | |
| 21 | |
| 22 int main(int argc, char** argv) { | |
| 23 mash::test::MashTestSuite test_suite(argc, argv); | 10 mash::test::MashTestSuite test_suite(argc, argv); |
| 24 | 11 |
| 25 catalog::Catalog::LoadDefaultCatalogManifest( | |
| 26 base::FilePath(kCatalogFilename)); | |
| 27 | |
| 28 mojo::edk::Init(); | |
| 29 base::Thread ipc_thread("IPC thread"); | |
| 30 ipc_thread.StartWithOptions( | |
| 31 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); | |
| 32 mojo::edk::ScopedIPCSupport ipc_support( | |
| 33 ipc_thread.task_runner(), | |
| 34 mojo::edk::ScopedIPCSupport::ShutdownPolicy::CLEAN); | |
| 35 | |
| 36 return base::LaunchUnitTests(argc, argv, | 12 return base::LaunchUnitTests(argc, argv, |
| 37 base::Bind(&mash::test::MashTestSuite::Run, | 13 base::Bind(&mash::test::MashTestSuite::Run, |
| 38 base::Unretained(&test_suite))); | 14 base::Unretained(&test_suite))); |
| 39 } | 15 } |
| OLD | NEW |