Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: media/gpu/video_decode_accelerator_unittest.cc

Issue 2620653003: Add ScopedTaskScheduler in video_decode_accelerator_unittest.cc. (Closed)
Patch Set: self-review Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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/test_suite.h" 54 #include "base/test/test_suite.h"
54 #include "base/threading/thread.h" 55 #include "base/threading/thread.h"
55 #include "base/threading/thread_task_runner_handle.h" 56 #include "base/threading/thread_task_runner_handle.h"
56 #include "build/build_config.h" 57 #include "build/build_config.h"
57 #include "gpu/command_buffer/service/gpu_preferences.h" 58 #include "gpu/command_buffer/service/gpu_preferences.h"
58 #include "gpu/config/gpu_driver_bug_workarounds.h" 59 #include "gpu/config/gpu_driver_bug_workarounds.h"
59 #include "media/base/test_data_util.h" 60 #include "media/base/test_data_util.h"
60 #include "media/filters/h264_parser.h" 61 #include "media/filters/h264_parser.h"
61 #include "media/gpu/fake_video_decode_accelerator.h" 62 #include "media/gpu/fake_video_decode_accelerator.h"
62 #include "media/gpu/gpu_video_decode_accelerator_factory.h" 63 #include "media/gpu/gpu_video_decode_accelerator_factory.h"
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 #if defined(OS_WIN) || defined(USE_OZONE) 1751 #if defined(OS_WIN) || defined(USE_OZONE)
1751 // For windows the decoding thread initializes the media foundation decoder 1752 // For windows the decoding thread initializes the media foundation decoder
1752 // which uses COM. We need the thread to be a UI thread. 1753 // which uses COM. We need the thread to be a UI thread.
1753 // On Ozone, the backend initializes the event system using a UI 1754 // On Ozone, the backend initializes the event system using a UI
1754 // thread. 1755 // thread.
1755 base::MessageLoopForUI main_loop; 1756 base::MessageLoopForUI main_loop;
1756 #else 1757 #else
1757 base::MessageLoop main_loop; 1758 base::MessageLoop main_loop;
1758 #endif // OS_WIN || USE_OZONE 1759 #endif // OS_WIN || USE_OZONE
1759 1760
1761 base::test::ScopedTaskScheduler scoped_task_scheduler(&main_loop);
1762
1763 media::g_env =
1764 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>(
1765 testing::AddGlobalTestEnvironment(
1766 new media::VideoDecodeAcceleratorTestEnvironment()));
1767
1760 #if defined(USE_OZONE) 1768 #if defined(USE_OZONE)
1761 ui::OzonePlatform::InitializeForUI(); 1769 ui::OzonePlatform::InitializeForUI();
1762 #endif 1770 #endif
1763 1771
1764 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 1772 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
1765 media::VaapiWrapper::PreSandboxInitialization(); 1773 media::VaapiWrapper::PreSandboxInitialization();
1766 #elif defined(OS_WIN) 1774 #elif defined(OS_WIN)
1767 media::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); 1775 media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
1768 #endif 1776 #endif
1769 return base::TestSuite::Run(); 1777 return base::TestSuite::Run();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 continue; 1840 continue;
1833 } 1841 }
1834 if (it->first == "use-test-data-path") { 1842 if (it->first == "use-test-data-path") {
1835 media::g_test_file_path = media::GetTestDataFilePath(""); 1843 media::g_test_file_path = media::GetTestDataFilePath("");
1836 continue; 1844 continue;
1837 } 1845 }
1838 } 1846 }
1839 1847
1840 base::ShadowingAtExitManager at_exit_manager; 1848 base::ShadowingAtExitManager at_exit_manager;
1841 1849
1842 media::g_env =
1843 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>(
1844 testing::AddGlobalTestEnvironment(
1845 new media::VideoDecodeAcceleratorTestEnvironment()));
1846
1847 return base::LaunchUnitTestsSerially( 1850 return base::LaunchUnitTestsSerially(
1848 argc, argv, 1851 argc, argv,
1849 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); 1852 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite)));
1850 } 1853 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698