Commit c7a207e1 authored by dnicoara's avatar dnicoara Committed by Commit bot

Fix at_exit error in video_decode tests

ui::OzoneGpuTestHelper needs to be uninstantiated in TearDown() since it
creates a base::Thread which wants to register with the AtExitManager.
However the AtExitManager runs out of scope before the
testing::Environment.

BUG=447798
TEST=compile and run ./video_decode_accelerator_unittest (I had
https://codereview.chromium.org/938873002/ applied as well to make sure
tests succeed)

Review URL: https://codereview.chromium.org/949183004

Cr-Commit-Position: refs/heads/master@{#319148}
parent 34a24da6
......@@ -231,17 +231,23 @@ class VideoDecodeAcceleratorTestEnvironment : public ::testing::Environment {
done.Wait();
#if defined(USE_OZONE)
gpu_helper_.reset(new ui::OzoneGpuTestHelper());
// 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());
gpu_helper_->Initialize(base::ThreadTaskRunnerHandle::Get(),
GetRenderingTaskRunner());
#endif
}
void TearDown() override { rendering_thread_.Stop(); }
void TearDown() override {
#if defined(USE_OZONE)
gpu_helper_.reset();
#endif
rendering_thread_.Stop();
}
scoped_refptr<base::SingleThreadTaskRunner> GetRenderingTaskRunner() const {
return rendering_thread_.task_runner();
......@@ -250,7 +256,7 @@ class VideoDecodeAcceleratorTestEnvironment : public ::testing::Environment {
private:
base::Thread rendering_thread_;
#if defined(USE_OZONE)
ui::OzoneGpuTestHelper gpu_helper_;
scoped_ptr<ui::OzoneGpuTestHelper> gpu_helper_;
#endif
DISALLOW_COPY_AND_ASSIGN(VideoDecodeAcceleratorTestEnvironment);
......
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