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

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

Issue 936703002: Fix UiThreadGpu initialization for video accelerator tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 5 years, 10 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
« no previous file with comments | « content/common/gpu/media/rendering_helper.cc ('k') | ui/ozone/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8f6149d57ca5fdde39b2f2e29c178d633917ad9d..5f0e3a6d17f44734878c272a8555149e94f57d0e 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -46,6 +46,7 @@
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/synchronization/waitable_event.h"
+#include "base/thread_task_runner_handle.h"
#include "base/threading/thread.h"
#include "content/common/gpu/media/fake_video_decode_accelerator.h"
#include "content/common/gpu/media/rendering_helper.h"
@@ -73,6 +74,7 @@
#endif // OS_WIN
#if defined(USE_OZONE)
+#include "ui/ozone/public/ozone_gpu_test_helper.h"
#include "ui/ozone/public/ozone_platform.h"
#endif // defined(USE_OZONE)
@@ -227,6 +229,16 @@ class VideoDecodeAcceleratorTestEnvironment : public ::testing::Environment {
rendering_thread_.task_runner()->PostTask(
FROM_HERE, base::Bind(&RenderingHelper::InitializeOneOff, &done));
done.Wait();
+
+#if defined(USE_OZONE)
+ // Need to initialize after the rendering side since the rendering side
+ // initializes the "GPU" parts of Ozone.
+ //
+ // This also needs to be done in the test environment since this shouldn't
+ // be initialized multiple times for the same Ozone platform.
+ gpu_helper_.Initialize(base::ThreadTaskRunnerHandle::Get(),
+ GetRenderingTaskRunner());
+#endif
}
void TearDown() override { rendering_thread_.Stop(); }
@@ -237,6 +249,9 @@ class VideoDecodeAcceleratorTestEnvironment : public ::testing::Environment {
private:
base::Thread rendering_thread_;
+#if defined(USE_OZONE)
+ ui::OzoneGpuTestHelper gpu_helper_;
+#endif
DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTestEnvironment);
};
« no previous file with comments | « content/common/gpu/media/rendering_helper.cc ('k') | ui/ozone/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698