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 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 | 864 |
865 VideoDecodeAcceleratorTest::VideoDecodeAcceleratorTest() | 865 VideoDecodeAcceleratorTest::VideoDecodeAcceleratorTest() |
866 : rendering_thread_("GLRenderingVDAClientThread") {} | 866 : rendering_thread_("GLRenderingVDAClientThread") {} |
867 | 867 |
868 void VideoDecodeAcceleratorTest::SetUp() { | 868 void VideoDecodeAcceleratorTest::SetUp() { |
869 ParseAndReadTestVideoData(g_test_video_data, &test_video_files_); | 869 ParseAndReadTestVideoData(g_test_video_data, &test_video_files_); |
870 | 870 |
871 // Initialize the rendering thread. | 871 // Initialize the rendering thread. |
872 base::Thread::Options options; | 872 base::Thread::Options options; |
873 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; | 873 options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; |
874 #if defined(OS_WIN) | 874 #if defined(OS_WIN) || defined(USE_OZONE) |
875 // For windows the decoding thread initializes the media foundation decoder | 875 // For windows the decoding thread initializes the media foundation decoder |
876 // which uses COM. We need the thread to be a UI thread. | 876 // which uses COM. We need the thread to be a UI thread. |
| 877 // On Ozone, the backend initializes the event system using a UI |
| 878 // thread. |
877 options.message_loop_type = base::MessageLoop::TYPE_UI; | 879 options.message_loop_type = base::MessageLoop::TYPE_UI; |
878 #endif // OS_WIN | 880 #endif // OS_WIN || USE_OZONE |
879 | 881 |
880 rendering_thread_.StartWithOptions(options); | 882 rendering_thread_.StartWithOptions(options); |
881 rendering_loop_proxy_ = rendering_thread_.message_loop_proxy(); | 883 rendering_loop_proxy_ = rendering_thread_.message_loop_proxy(); |
882 } | 884 } |
883 | 885 |
884 void VideoDecodeAcceleratorTest::TearDown() { | 886 void VideoDecodeAcceleratorTest::TearDown() { |
885 rendering_loop_proxy_->PostTask( | 887 rendering_loop_proxy_->PostTask( |
886 FROM_HERE, | 888 FROM_HERE, |
887 base::Bind(&STLDeleteElements<std::vector<TestVideoFile*> >, | 889 base::Bind(&STLDeleteElements<std::vector<TestVideoFile*> >, |
888 &test_video_files_)); | 890 &test_video_files_)); |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 continue; | 1446 continue; |
1445 } | 1447 } |
1446 | 1448 |
1447 if (it->first == "num_play_throughs") { | 1449 if (it->first == "num_play_throughs") { |
1448 std::string input(it->second.begin(), it->second.end()); | 1450 std::string input(it->second.begin(), it->second.end()); |
1449 CHECK(base::StringToInt(input, &content::g_num_play_throughs)); | 1451 CHECK(base::StringToInt(input, &content::g_num_play_throughs)); |
1450 continue; | 1452 continue; |
1451 } | 1453 } |
1452 if (it->first == "v" || it->first == "vmodule") | 1454 if (it->first == "v" || it->first == "vmodule") |
1453 continue; | 1455 continue; |
| 1456 if (it->first == "ozone-platform" || it->first == "ozone-use-surfaceless") |
| 1457 continue; |
1454 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1458 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
1455 } | 1459 } |
1456 | 1460 |
1457 base::ShadowingAtExitManager at_exit_manager; | 1461 base::ShadowingAtExitManager at_exit_manager; |
1458 content::RenderingHelper::InitializeOneOff(); | 1462 content::RenderingHelper::InitializeOneOff(); |
1459 | 1463 |
1460 return RUN_ALL_TESTS(); | 1464 return RUN_ALL_TESTS(); |
1461 } | 1465 } |
OLD | NEW |