| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
| 8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/gl/test/gl_image_test_support.h" | 10 #include "ui/gl/test/gl_image_test_support.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 GlTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) { | 26 GlTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) { |
| 27 } | 27 } |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 void Initialize() override { | 30 void Initialize() override { |
| 31 base::TestSuite::Initialize(); | 31 base::TestSuite::Initialize(); |
| 32 #if defined(USE_OZONE) | 32 #if defined(USE_OZONE) |
| 33 // Make Ozone run in single-process mode, where it doesn't expect a GPU | 33 // Make Ozone run in single-process mode, where it doesn't expect a GPU |
| 34 // process and it spawns and starts its own DRM thread. | 34 // process and it spawns and starts its own DRM thread. |
| 35 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 35 ui::OzonePlatform::InitParams params; |
| 36 "mojo-platform-channel-handle"); | 36 params.single_process = true; |
| 37 main_loop_.reset(new base::MessageLoopForUI()); | 37 ui::OzonePlatform::InitializeForUI(params); |
| 38 ui::OzonePlatform::InitializeForUI(); | |
| 39 #endif | 38 #endif |
| 40 | 39 |
| 41 #if defined(OS_MACOSX) && !defined(OS_IOS) | 40 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 42 mock_cr_app::RegisterMockCrApp(); | 41 mock_cr_app::RegisterMockCrApp(); |
| 43 #endif | 42 #endif |
| 44 } | 43 } |
| 45 | 44 |
| 46 void Shutdown() override { | 45 void Shutdown() override { |
| 47 base::TestSuite::Shutdown(); | 46 base::TestSuite::Shutdown(); |
| 48 } | 47 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 59 } // namespace | 58 } // namespace |
| 60 | 59 |
| 61 int main(int argc, char** argv) { | 60 int main(int argc, char** argv) { |
| 62 GlTestSuite test_suite(argc, argv); | 61 GlTestSuite test_suite(argc, argv); |
| 63 | 62 |
| 64 return base::LaunchUnitTests( | 63 return base::LaunchUnitTests( |
| 65 argc, | 64 argc, |
| 66 argv, | 65 argv, |
| 67 base::Bind(&GlTestSuite::Run, base::Unretained(&test_suite))); | 66 base::Bind(&GlTestSuite::Run, base::Unretained(&test_suite))); |
| 68 } | 67 } |
| OLD | NEW |