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

Unified Diff: content/common/gpu/media/video_decode_accelerator_unittest.cc

Issue 835653005: gpu: media: RenderingHelper: wait for the display & window to be ready (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move platform window creation off the rendering thread Created 5 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/video_decode_accelerator_unittest.cc
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index 3b9ec204cfda9e8d6f2da06fbbbda909d6b61e0a..10e50d4d493d730f8983e5710b7aa1708e435cad 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -956,19 +956,7 @@ VideoDecodeAcceleratorTest::VideoDecodeAcceleratorTest()
void VideoDecodeAcceleratorTest::SetUp() {
ParseAndReadTestVideoData(g_test_video_data, &test_video_files_);
-
- // Initialize the rendering thread.
- base::Thread::Options options;
- options.message_loop_type = base::MessageLoop::TYPE_DEFAULT;
-#if defined(OS_WIN) || defined(USE_OZONE)
- // For windows the decoding thread initializes the media foundation decoder
- // which uses COM. We need the thread to be a UI thread.
- // On Ozone, the backend initializes the event system using a UI
- // thread.
- options.message_loop_type = base::MessageLoop::TYPE_UI;
-#endif // OS_WIN || USE_OZONE
-
- rendering_thread_.StartWithOptions(options);
+ rendering_thread_.Start();
rendering_loop_proxy_ = rendering_thread_.message_loop_proxy();
}
@@ -987,6 +975,7 @@ void VideoDecodeAcceleratorTest::TearDown() {
done.Wait();
rendering_thread_.Stop();
+ rendering_helper_.TearDown();
}
void VideoDecodeAcceleratorTest::ParseAndReadTestVideoData(
@@ -1054,6 +1043,8 @@ void VideoDecodeAcceleratorTest::UpdateTestVideoFileParams(
void VideoDecodeAcceleratorTest::InitializeRenderingHelper(
const RenderingHelperParams& helper_params) {
+ rendering_helper_.Setup();
+
base::WaitableEvent done(false, false);
rendering_loop_proxy_->PostTask(
FROM_HERE,
@@ -1548,7 +1539,15 @@ int main(int argc, char **argv) {
}
base::ShadowingAtExitManager at_exit_manager;
+#if defined(OS_WIN) || defined(USE_OZONE)
+ // For windows the decoding thread initializes the media foundation decoder
+ // which uses COM. We need the thread to be a UI thread.
+ // On Ozone, the backend initializes the event system using a UI
+ // thread.
+ base::MessageLoopForUI main_loop;
+#else
base::MessageLoop main_loop;
+#endif // OS_WIN || USE_OZONE
content::RenderingHelper::InitializeOneOff();
return RUN_ALL_TESTS();
« content/common/gpu/media/rendering_helper.cc ('K') | « content/common/gpu/media/rendering_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698