Commit e4378cb9 authored by Matthew Cary's avatar Matthew Cary Committed by Commit Bot

media/gpu: add mojo initialization to unittests.

Future changes to shared memory introduce an implicit dependency on
mojo, which must be initialized in unittests.

Bug: 849207
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I13de882b7f995ac33385d2f6d5f49b5ac44bb2c4
Reviewed-on: https://chromium-review.googlesource.com/1156588Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Matthew Cary <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580922}
parent 1f858421
......@@ -366,6 +366,7 @@ if (is_win || is_android || use_v4l2_codec || use_vaapi) {
"//base",
"//base/test:test_support",
"//media:test_support",
"//mojo/core/embedder",
"//testing/gtest",
"//ui/base",
"//ui/display/manager",
......@@ -474,6 +475,7 @@ if (use_v4l2_codec || use_vaapi || is_mac || is_win) {
"//base/test:test_support",
"//media:test_support",
"//media/gpu",
"//mojo/core/embedder",
"//testing/gtest",
"//ui/base",
"//ui/gfx",
......@@ -503,6 +505,7 @@ if (use_vaapi) {
"//base/test:test_support",
"//media:test_support",
"//media/gpu",
"//mojo/core/embedder",
"//testing/gtest",
"//third_party:jpeg",
"//third_party/libyuv",
......@@ -534,6 +537,7 @@ if (use_v4l2_codec || use_vaapi) {
"//media:test_support",
"//media/gpu",
"//media/mojo/services",
"//mojo/core/embedder",
"//testing/gtest",
"//third_party/libyuv",
"//ui/base",
......
......@@ -842,6 +842,7 @@ TEST_F(JpegDecodeAcceleratorTest, PerfSW) {
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
base::CommandLine::Init(argc, argv);
mojo::core::Init();
base::ShadowingAtExitManager at_exit_manager;
// Needed to enable DVLOG through --vmodule.
......
......@@ -33,6 +33,7 @@
#include "media/gpu/test/video_accelerator_unittest_helpers.h"
#include "media/gpu/vaapi/vaapi_jpeg_encode_accelerator.h"
#include "media/video/jpeg_encode_accelerator.h"
#include "mojo/core/embedder/embedder.h"
#include "third_party/libyuv/include/libyuv.h"
#include "ui/gfx/codec/jpeg_codec.h"
......@@ -635,6 +636,7 @@ TEST_F(JpegEncodeAcceleratorTest, CodedSizeAlignment) {
int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);
base::CommandLine::Init(argc, argv);
mojo::core::Init();
base::ShadowingAtExitManager at_exit_manager;
// Needed to enable DVLOG through --vmodule.
......
......@@ -140,6 +140,7 @@ source_set("unit_test") {
"//base/test:test_support",
"//gpu:test_support",
"//media/gpu:common",
"//mojo/core/embedder",
"//testing/gmock",
"//testing/gtest",
"//ui/gfx:test_support",
......
......@@ -22,6 +22,7 @@
#include "media/base/video_frame.h"
#include "media/filters/jpeg_parser.h"
#include "media/gpu/vaapi/vaapi_jpeg_decoder.h"
#include "mojo/core/embedder/embedder.h"
namespace media {
namespace {
......@@ -132,6 +133,7 @@ TEST_F(VaapiJpegDecoderTest, DecodeFail) {
} // namespace media
int main(int argc, char** argv) {
mojo::core::Init();
testing::InitGoogleTest(&argc, argv);
base::AtExitManager exit_manager;
media::VaapiWrapper::PreSandboxInitialization();
......
......@@ -1573,8 +1573,6 @@ class VDATestSuite : public base::TestSuite {
int Run() {
#if defined(OS_WIN) || defined(OS_CHROMEOS)
mojo::core::Init(); // Required only for Win7 tests.
// 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
......@@ -1610,6 +1608,7 @@ class VDATestSuite : public base::TestSuite {
} // namespace media
int main(int argc, char** argv) {
mojo::core::Init();
media::VDATestSuite test_suite(argc, argv);
// Needed to enable DVLOG through --vmodule.
......
......@@ -58,6 +58,7 @@
#include "media/video/fake_video_encode_accelerator.h"
#include "media/video/h264_parser.h"
#include "media/video/video_encode_accelerator.h"
#include "mojo/core/embedder/embedder.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(USE_VAAPI)
......@@ -2587,6 +2588,7 @@ class VEATestSuite : public base::TestSuite {
} // namespace media
int main(int argc, char** argv) {
mojo::core::Init();
media::VEATestSuite test_suite(argc, argv);
base::ShadowingAtExitManager at_exit_manager;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment