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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 #include "base/stl_util.h" | 43 #include "base/stl_util.h" |
44 #include "base/strings/string_number_conversions.h" | 44 #include "base/strings/string_number_conversions.h" |
45 #include "base/strings/string_split.h" | 45 #include "base/strings/string_split.h" |
46 #include "base/strings/stringize_macros.h" | 46 #include "base/strings/stringize_macros.h" |
47 #include "base/strings/stringprintf.h" | 47 #include "base/strings/stringprintf.h" |
48 #include "base/strings/utf_string_conversions.h" | 48 #include "base/strings/utf_string_conversions.h" |
49 #include "base/synchronization/condition_variable.h" | 49 #include "base/synchronization/condition_variable.h" |
50 #include "base/synchronization/lock.h" | 50 #include "base/synchronization/lock.h" |
51 #include "base/synchronization/waitable_event.h" | 51 #include "base/synchronization/waitable_event.h" |
52 #include "base/test/launcher/unit_test_launcher.h" | 52 #include "base/test/launcher/unit_test_launcher.h" |
53 #include "base/test/scoped_task_scheduler.h" | |
54 #include "base/test/test_suite.h" | 53 #include "base/test/test_suite.h" |
55 #include "base/threading/thread.h" | 54 #include "base/threading/thread.h" |
56 #include "base/threading/thread_task_runner_handle.h" | 55 #include "base/threading/thread_task_runner_handle.h" |
57 #include "build/build_config.h" | 56 #include "build/build_config.h" |
58 #include "gpu/command_buffer/service/gpu_preferences.h" | 57 #include "gpu/command_buffer/service/gpu_preferences.h" |
59 #include "gpu/config/gpu_driver_bug_workarounds.h" | 58 #include "gpu/config/gpu_driver_bug_workarounds.h" |
60 #include "media/base/test_data_util.h" | 59 #include "media/base/test_data_util.h" |
61 #include "media/filters/h264_parser.h" | 60 #include "media/filters/h264_parser.h" |
62 #include "media/gpu/fake_video_decode_accelerator.h" | 61 #include "media/gpu/fake_video_decode_accelerator.h" |
63 #include "media/gpu/gpu_video_decode_accelerator_factory.h" | 62 #include "media/gpu/gpu_video_decode_accelerator_factory.h" |
64 #include "media/gpu/rendering_helper.h" | 63 #include "media/gpu/rendering_helper.h" |
65 #include "media/gpu/video_accelerator_unittest_helpers.h" | 64 #include "media/gpu/video_accelerator_unittest_helpers.h" |
66 #include "testing/gtest/include/gtest/gtest.h" | 65 #include "testing/gtest/include/gtest/gtest.h" |
67 #include "ui/gfx/codec/png_codec.h" | 66 #include "ui/gfx/codec/png_codec.h" |
68 #include "ui/gl/gl_image.h" | 67 #include "ui/gl/gl_image.h" |
69 | 68 |
70 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
70 #include "base/test/scoped_task_environment.h" | |
gab
2017/05/01 19:05:04
wrong include block
fdoray
2017/05/03 17:38:14
Done.
| |
71 #include "base/win/windows_version.h" | 71 #include "base/win/windows_version.h" |
72 #include "media/gpu/dxva_video_decode_accelerator_win.h" | 72 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
73 #elif defined(OS_CHROMEOS) | 73 #elif defined(OS_CHROMEOS) |
74 #if defined(USE_V4L2_CODEC) | 74 #if defined(USE_V4L2_CODEC) |
75 #include "media/gpu/v4l2_device.h" | 75 #include "media/gpu/v4l2_device.h" |
76 #include "media/gpu/v4l2_slice_video_decode_accelerator.h" | 76 #include "media/gpu/v4l2_slice_video_decode_accelerator.h" |
77 #include "media/gpu/v4l2_video_decode_accelerator.h" | 77 #include "media/gpu/v4l2_video_decode_accelerator.h" |
78 #endif | 78 #endif |
79 #if defined(ARCH_CPU_X86_FAMILY) | 79 #if defined(ARCH_CPU_X86_FAMILY) |
80 #include "media/gpu/vaapi_video_decode_accelerator.h" | 80 #include "media/gpu/vaapi_video_decode_accelerator.h" |
(...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1809 // - Test life-cycle: Seek/Stop/Pause/Play for a single decoder. | 1809 // - Test life-cycle: Seek/Stop/Pause/Play for a single decoder. |
1810 // - Test alternate configurations | 1810 // - Test alternate configurations |
1811 // - Test failure conditions. | 1811 // - Test failure conditions. |
1812 // - Test frame size changes mid-stream | 1812 // - Test frame size changes mid-stream |
1813 | 1813 |
1814 class VDATestSuite : public base::TestSuite { | 1814 class VDATestSuite : public base::TestSuite { |
1815 public: | 1815 public: |
1816 VDATestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 1816 VDATestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
1817 | 1817 |
1818 int Run() { | 1818 int Run() { |
1819 #if defined(OS_WIN) || defined(USE_OZONE) | 1819 base::test::ScopedTaskEnvironment scoped_task_environment; |
1820 // For windows the decoding thread initializes the media foundation decoder | |
1821 // which uses COM. We need the thread to be a UI thread. | |
1822 // On Ozone, the backend initializes the event system using a UI | |
1823 // thread. | |
1824 base::MessageLoopForUI main_loop; | |
gab
2017/05/01 19:05:04
ForUI?
fdoray
2017/05/03 17:38:14
Done.
| |
1825 #else | |
1826 base::MessageLoop main_loop; | |
1827 #endif // OS_WIN || USE_OZONE | |
1828 | |
1829 base::test::ScopedTaskScheduler scoped_task_scheduler(&main_loop); | |
1830 | 1820 |
1831 media::g_env = | 1821 media::g_env = |
1832 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( | 1822 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( |
1833 testing::AddGlobalTestEnvironment( | 1823 testing::AddGlobalTestEnvironment( |
1834 new media::VideoDecodeAcceleratorTestEnvironment())); | 1824 new media::VideoDecodeAcceleratorTestEnvironment())); |
1835 | 1825 |
1836 #if defined(USE_OZONE) | 1826 #if defined(USE_OZONE) |
1837 ui::OzonePlatform::InitializeForUI(); | 1827 ui::OzonePlatform::InitializeForUI(); |
1838 #endif | 1828 #endif |
1839 | 1829 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1915 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); | 1905 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); |
1916 } | 1906 } |
1917 } | 1907 } |
1918 | 1908 |
1919 base::ShadowingAtExitManager at_exit_manager; | 1909 base::ShadowingAtExitManager at_exit_manager; |
1920 | 1910 |
1921 return base::LaunchUnitTestsSerially( | 1911 return base::LaunchUnitTestsSerially( |
1922 argc, argv, | 1912 argc, argv, |
1923 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); | 1913 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); |
1924 } | 1914 } |
OLD | NEW |