Skip to content

Commit

Permalink
media/gpu/test: Destroy test environment after run to idle.
Browse files Browse the repository at this point in the history
media::VideoDecoder implementation may be destroyed on different
thread from the thread that the client releases it. We should make
sure the destruction is done before test environment is released.

This CL call RunUntilIdle() before releasing the test environment.

BUG=none
TEST=run video_decode_accelerator_perf_tests on Eve

Change-Id: Ifeec98da8c2f7a9798d45f973bcf2e4901bdb411
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772874
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: David Staessens <dstaessens@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691540}
  • Loading branch information
Chih-Yu Huang authored and Commit Bot committed Aug 29, 2019
1 parent edc96b6 commit 5545e86
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions media/gpu/test/video_test_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ void VideoTestEnvironment::SetUp() {
}

void VideoTestEnvironment::TearDown() {
// Some implementations (like VideoDecoder) might be destroyed on a different
// thread from the thread that the client releases it on. Call RunUntilIdle()
// to ensure this kind of destruction is finished before |task_environment_|
// is destroyed.
task_environment_->RunUntilIdle();
task_environment_ = nullptr;
}

base::FilePath::StringType VideoTestEnvironment::GetTestName() const {
Expand Down

0 comments on commit 5545e86

Please sign in to comment.