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 12 matching lines...) Expand all Loading... |
23 | 23 |
24 class GlTestSuite : public base::TestSuite { | 24 class GlTestSuite : public base::TestSuite { |
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 main_loop_.reset(new base::MessageLoopForUI()); |
33 // Make Ozone run in single-process mode, where it doesn't expect a GPU | 34 // 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. | 35 // process and it spawns and starts its own DRM thread. |
35 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 36 ui::OzonePlatform::InitParams params; |
36 "mojo-platform-channel-handle"); | 37 params.single_process = true; |
37 main_loop_.reset(new base::MessageLoopForUI()); | 38 ui::OzonePlatform::InitializeForUI(params); |
38 ui::OzonePlatform::InitializeForUI(); | |
39 #endif | 39 #endif |
40 | 40 |
41 #if defined(OS_MACOSX) && !defined(OS_IOS) | 41 #if defined(OS_MACOSX) && !defined(OS_IOS) |
42 mock_cr_app::RegisterMockCrApp(); | 42 mock_cr_app::RegisterMockCrApp(); |
43 #endif | 43 #endif |
44 } | 44 } |
45 | 45 |
46 void Shutdown() override { | 46 void Shutdown() override { |
47 base::TestSuite::Shutdown(); | 47 base::TestSuite::Shutdown(); |
48 } | 48 } |
(...skipping 10 matching lines...) Expand all Loading... |
59 } // namespace | 59 } // namespace |
60 | 60 |
61 int main(int argc, char** argv) { | 61 int main(int argc, char** argv) { |
62 GlTestSuite test_suite(argc, argv); | 62 GlTestSuite test_suite(argc, argv); |
63 | 63 |
64 return base::LaunchUnitTests( | 64 return base::LaunchUnitTests( |
65 argc, | 65 argc, |
66 argv, | 66 argv, |
67 base::Bind(&GlTestSuite::Run, base::Unretained(&test_suite))); | 67 base::Bind(&GlTestSuite::Run, base::Unretained(&test_suite))); |
68 } | 68 } |
OLD | NEW |