From dcbf4aabe86ac33df42d06e5c439001dbc7cb56a Mon Sep 17 00:00:00 2001 From: "lionel.g.landwerlin" Date: Wed, 21 Jan 2015 06:07:58 -0800 Subject: [PATCH] gpu: media: unittests: explicitly create a main loop On Ozone/Freon initializing GL requires a main loop. BUG=447798 TEST=run video_encode_accelerator_unittest on freon Review URL: https://codereview.chromium.org/844533003 Cr-Commit-Position: refs/heads/master@{#312341} --- content/common/gpu/media/video_decode_accelerator_unittest.cc | 1 + content/common/gpu/media/video_encode_accelerator_unittest.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc index 99c5fb90cc76..3b9ec204cfda 100644 --- a/content/common/gpu/media/video_decode_accelerator_unittest.cc +++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc @@ -1548,6 +1548,7 @@ int main(int argc, char **argv) { } base::ShadowingAtExitManager at_exit_manager; + base::MessageLoop main_loop; content::RenderingHelper::InitializeOneOff(); return RUN_ALL_TESTS(); diff --git a/content/common/gpu/media/video_encode_accelerator_unittest.cc b/content/common/gpu/media/video_encode_accelerator_unittest.cc index 66451b5a4928..e56b03b666b9 100644 --- a/content/common/gpu/media/video_encode_accelerator_unittest.cc +++ b/content/common/gpu/media/video_encode_accelerator_unittest.cc @@ -1319,12 +1319,14 @@ int main(int argc, char** argv) { testing::InitGoogleTest(&argc, argv); // Removes gtest-specific args. base::CommandLine::Init(argc, argv); + base::ShadowingAtExitManager at_exit_manager; + base::MessageLoop main_loop; + #if defined(USE_OZONE) ui::OzonePlatform::InitializeForUI(); ui::OzonePlatform::InitializeForGPU(); #endif - base::ShadowingAtExitManager at_exit_manager; scoped_ptr test_stream_data( new base::FilePath::StringType( media::GetTestDataFilePath(content::g_default_in_filename).value() + -- 2.11.4.GIT