| 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/test/launcher/unit_test_launcher.h" | 5 #include "base/test/launcher/unit_test_launcher.h" |
| 6 #include "base/test/test_io_thread.h" |
| 6 #include "base/test/test_suite.h" | 7 #include "base/test/test_suite.h" |
| 7 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 8 #include "mojo/edk/embedder/embedder.h" | 9 #include "mojo/edk/embedder/embedder.h" |
| 10 #include "mojo/edk/test/scoped_ipc_support.h" |
| 9 #include "services/service_manager/background/background_service_manager_main.h" | 11 #include "services/service_manager/background/background_service_manager_main.h" |
| 10 | 12 |
| 11 #if defined(USE_OZONE) | 13 #if defined(USE_OZONE) |
| 12 #include "ui/ozone/public/ozone_platform.h" | 14 #include "ui/ozone/public/ozone_platform.h" |
| 13 #endif | 15 #endif |
| 14 | 16 |
| 15 class MusGpuTestSuite : public base::TestSuite { | 17 class MusGpuTestSuite : public base::TestSuite { |
| 16 public: | 18 public: |
| 17 MusGpuTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 19 MusGpuTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
| 18 | 20 |
| 19 private: | 21 private: |
| 20 void Initialize() override { | 22 void Initialize() override { |
| 21 base::TestSuite::Initialize(); | 23 base::TestSuite::Initialize(); |
| 22 #if defined(USE_OZONE) | 24 #if defined(USE_OZONE) |
| 23 ui::OzonePlatform::InitParams params; | 25 ui::OzonePlatform::InitParams params; |
| 24 params.single_process = true; | 26 params.single_process = true; |
| 25 ui::OzonePlatform::InitializeForGPU(params); | 27 ui::OzonePlatform::InitializeForGPU(params); |
| 26 #endif | 28 #endif |
| 27 } | 29 } |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 int MasterProcessMain(int argc, char** argv) { | 32 int MasterProcessMain(int argc, char** argv) { |
| 31 MusGpuTestSuite test_suite(argc, argv); | 33 MusGpuTestSuite test_suite(argc, argv); |
| 34 |
| 32 mojo::edk::Init(); | 35 mojo::edk::Init(); |
| 36 base::TestIOThread test_io_thread(base::TestIOThread::kAutoStart); |
| 37 mojo::edk::test::ScopedIPCSupport ipc_support(test_io_thread.task_runner()); |
| 38 |
| 33 return base::LaunchUnitTests( | 39 return base::LaunchUnitTests( |
| 34 argc, argv, | 40 argc, argv, |
| 35 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); | 41 base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite))); |
| 36 } | 42 } |
| OLD | NEW |