OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or | 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or |
8 // Win/EGL. | 8 // Win/EGL. |
9 // - ClientState is an enum for the state of the decode client used by the test. | 9 // - ClientState is an enum for the state of the decode client used by the test. |
10 // - ClientStateNotification is a barrier abstraction that allows the test code | 10 // - ClientStateNotification is a barrier abstraction that allows the test code |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // for all test cases. | 261 // for all test cases. |
262 class VideoDecodeAcceleratorTestEnvironment : public ::testing::Environment { | 262 class VideoDecodeAcceleratorTestEnvironment : public ::testing::Environment { |
263 public: | 263 public: |
264 VideoDecodeAcceleratorTestEnvironment() | 264 VideoDecodeAcceleratorTestEnvironment() |
265 : rendering_thread_("GLRenderingVDAClientThread") {} | 265 : rendering_thread_("GLRenderingVDAClientThread") {} |
266 | 266 |
267 void SetUp() override { | 267 void SetUp() override { |
268 base::Thread::Options options; | 268 base::Thread::Options options; |
269 #if defined(OS_WIN) | 269 #if defined(OS_WIN) |
270 options.message_loop_type = base::MessageLoop::TYPE_UI; | 270 options.message_loop_type = base::MessageLoop::TYPE_UI; |
| 271 #elif defined(USE_OZONE) |
| 272 // Some ozone platforms (e.g. drm) expects to be able to watch a file |
| 273 // handler from this thread. So use the IO type message loop here. |
| 274 options.message_loop_type = base::MessageLoop::TYPE_IO; |
271 #endif | 275 #endif |
272 rendering_thread_.StartWithOptions(options); | 276 rendering_thread_.StartWithOptions(options); |
273 | 277 |
274 base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC, | 278 base::WaitableEvent done(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
275 base::WaitableEvent::InitialState::NOT_SIGNALED); | 279 base::WaitableEvent::InitialState::NOT_SIGNALED); |
276 rendering_thread_.task_runner()->PostTask( | 280 rendering_thread_.task_runner()->PostTask( |
277 FROM_HERE, base::Bind(&RenderingHelper::InitializeOneOff, &done)); | 281 FROM_HERE, base::Bind(&RenderingHelper::InitializeOneOff, &done)); |
278 done.Wait(); | 282 done.Wait(); |
279 | 283 |
280 #if defined(USE_OZONE) | 284 #if defined(USE_OZONE) |
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1911 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); | 1915 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); |
1912 } | 1916 } |
1913 } | 1917 } |
1914 | 1918 |
1915 base::ShadowingAtExitManager at_exit_manager; | 1919 base::ShadowingAtExitManager at_exit_manager; |
1916 | 1920 |
1917 return base::LaunchUnitTestsSerially( | 1921 return base::LaunchUnitTestsSerially( |
1918 argc, argv, | 1922 argc, argv, |
1919 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); | 1923 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); |
1920 } | 1924 } |
OLD | NEW |