1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/bind.h" 6 #include "base/test/launcher/unit_test_launcher.h" 7 #include "base/test/multiprocess_test.h" 8 #include "base/test/test_io_thread.h" 9 #include "base/test/test_suite.h" 10 #include "build/build_config.h" 11 #include "mojo/core/embedder/embedder.h" 12 #include "mojo/core/embedder/scoped_ipc_support.h" 13 14 #if defined(OS_MACOSX) && !defined(OS_IOS) 15 #include "base/mac/mach_port_broker.h" 16 #endif 17 main(int argc,char ** argv)18int main(int argc, char** argv) { 19 base::TestSuite test_suite(argc, argv); 20 mojo::core::Init(); 21 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); 22 mojo::core::ScopedIPCSupport ipc_support( 23 test_io_thread.task_runner(), 24 mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN); 25 26 #if defined(OS_MACOSX) && !defined(OS_IOS) 27 base::MachPortBroker mach_broker("mojo_test"); 28 CHECK(mach_broker.Init()); 29 mojo::core::SetMachPortProvider(&mach_broker); 30 #endif 31 32 return base::LaunchUnitTests( 33 argc, argv, 34 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); 35 } 36