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" | 53 #include "base/test/scoped_task_environment.h" |
54 #include "base/test/test_suite.h" | 54 #include "base/test/test_suite.h" |
55 #include "base/threading/thread.h" | 55 #include "base/threading/thread.h" |
56 #include "base/threading/thread_task_runner_handle.h" | 56 #include "base/threading/thread_task_runner_handle.h" |
57 #include "build/build_config.h" | 57 #include "build/build_config.h" |
58 #include "gpu/command_buffer/service/gpu_preferences.h" | 58 #include "gpu/command_buffer/service/gpu_preferences.h" |
59 #include "gpu/config/gpu_driver_bug_workarounds.h" | 59 #include "gpu/config/gpu_driver_bug_workarounds.h" |
60 #include "media/base/test_data_util.h" | 60 #include "media/base/test_data_util.h" |
61 #include "media/filters/h264_parser.h" | 61 #include "media/filters/h264_parser.h" |
62 #include "media/gpu/fake_video_decode_accelerator.h" | 62 #include "media/gpu/fake_video_decode_accelerator.h" |
63 #include "media/gpu/gpu_video_decode_accelerator_factory.h" | 63 #include "media/gpu/gpu_video_decode_accelerator_factory.h" |
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 class VDATestSuite : public base::TestSuite { | 1815 class VDATestSuite : public base::TestSuite { |
1816 public: | 1816 public: |
1817 VDATestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 1817 VDATestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
1818 | 1818 |
1819 int Run() { | 1819 int Run() { |
1820 #if defined(OS_WIN) || defined(USE_OZONE) | 1820 #if defined(OS_WIN) || defined(USE_OZONE) |
1821 // For windows the decoding thread initializes the media foundation decoder | 1821 // For windows the decoding thread initializes the media foundation decoder |
1822 // which uses COM. We need the thread to be a UI thread. | 1822 // which uses COM. We need the thread to be a UI thread. |
1823 // On Ozone, the backend initializes the event system using a UI | 1823 // On Ozone, the backend initializes the event system using a UI |
1824 // thread. | 1824 // thread. |
1825 base::MessageLoopForUI main_loop; | 1825 base::test::ScopedTaskEnvironment scoped_task_environment( |
| 1826 base::test::ScopedTaskEnvironment::MainThreadType::UI); |
1826 #else | 1827 #else |
1827 base::MessageLoop main_loop; | 1828 base::test::ScopedTaskEnvironment scoped_task_environment; |
1828 #endif // OS_WIN || USE_OZONE | 1829 #endif // OS_WIN || USE_OZONE |
1829 | 1830 |
1830 base::test::ScopedTaskScheduler scoped_task_scheduler(&main_loop); | |
1831 | |
1832 media::g_env = | 1831 media::g_env = |
1833 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( | 1832 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( |
1834 testing::AddGlobalTestEnvironment( | 1833 testing::AddGlobalTestEnvironment( |
1835 new media::VideoDecodeAcceleratorTestEnvironment())); | 1834 new media::VideoDecodeAcceleratorTestEnvironment())); |
1836 | 1835 |
1837 #if defined(USE_OZONE) | 1836 #if defined(USE_OZONE) |
1838 ui::OzonePlatform::InitializeForUI(); | 1837 ui::OzonePlatform::InitializeForUI(); |
1839 #endif | 1838 #endif |
1840 | 1839 |
1841 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 1840 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1916 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); | 1915 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); |
1917 } | 1916 } |
1918 } | 1917 } |
1919 | 1918 |
1920 base::ShadowingAtExitManager at_exit_manager; | 1919 base::ShadowingAtExitManager at_exit_manager; |
1921 | 1920 |
1922 return base::LaunchUnitTestsSerially( | 1921 return base::LaunchUnitTestsSerially( |
1923 argc, argv, | 1922 argc, argv, |
1924 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); | 1923 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); |
1925 } | 1924 } |
OLD | NEW |