Commit befce30d authored by Miguel Casas's avatar Miguel Casas Committed by Commit Bot

media/gpu/test: s/LOG_ASSERT/ASSERT_TRUE/ in v_d_client

Some test-only files under media/gpu/test use LOG_ASSERT(), which causes
the test binary to crash and leave an unsymbolized callstack when run on
the CrOs Tast infra.

This CL changes some of those refs to GTest's ASSERT_TRUE(), that is
equivalent to EXPECT_TRUE()+return (not all LOG_ASSERT()s are that easy
to replace since they are inside functions returning something).

Replacing video_decoder_client.cc should fix the VP9.2 not being
initialized (since it's disabled temporarily)- the test is expected
to fail but not to crash.

Bug: 1020776
Change-Id: Iddd6ed9080db4abe62f93730c84e77bfcbc9305f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1897358Reviewed-by: default avatarDavid Staessens <dstaessens@chromium.org>
Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712417}
parent 4c0c63a3
......@@ -130,7 +130,7 @@ bool VideoDecoderClient::WaitForFrameProcessors() {
}
void VideoDecoderClient::WaitForRenderer() {
LOG_ASSERT(frame_renderer_);
ASSERT_TRUE(frame_renderer_);
frame_renderer_->WaitUntilRenderingDone();
}
......@@ -174,7 +174,7 @@ void VideoDecoderClient::CreateDecoderTask(bool* success,
base::WaitableEvent* done) {
DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_client_sequence_checker_);
DCHECK_EQ(decoder_client_state_, VideoDecoderClientState::kUninitialized);
LOG_ASSERT(!decoder_) << "Can't create decoder: already created";
ASSERT_TRUE(!decoder_) << "Can't create decoder: already created";
if (decoder_client_config_.use_vd) {
#if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION)
......@@ -205,8 +205,8 @@ void VideoDecoderClient::InitializeDecoderTask(const Video* video,
DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_client_sequence_checker_);
DCHECK(decoder_client_state_ == VideoDecoderClientState::kUninitialized ||
decoder_client_state_ == VideoDecoderClientState::kIdle);
LOG_ASSERT(decoder_) << "Can't initialize decoder: not created yet";
LOG_ASSERT(video);
ASSERT_TRUE(decoder_) << "Can't initialize decoder: not created yet";
ASSERT_TRUE(video);
video_ = video;
encoded_data_helper_ =
......@@ -354,7 +354,7 @@ void VideoDecoderClient::DecoderInitializedTask(bool status) {
DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_client_sequence_checker_);
DCHECK(decoder_client_state_ == VideoDecoderClientState::kUninitialized ||
decoder_client_state_ == VideoDecoderClientState::kIdle);
LOG_ASSERT(status) << "Initializing decoder failed";
ASSERT_TRUE(status) << "Initializing decoder failed";
decoder_client_state_ = VideoDecoderClientState::kIdle;
FireEvent(VideoPlayerEvent::kInitialized);
......@@ -363,7 +363,7 @@ void VideoDecoderClient::DecoderInitializedTask(bool status) {
void VideoDecoderClient::DecodeDoneTask(media::DecodeStatus status) {
DCHECK_CALLED_ON_VALID_SEQUENCE(decoder_client_sequence_checker_);
DCHECK_NE(VideoDecoderClientState::kIdle, decoder_client_state_);
LOG_ASSERT(status != media::DecodeStatus::ABORTED ||
ASSERT_TRUE(status != media::DecodeStatus::ABORTED ||
decoder_client_state_ == VideoDecoderClientState::kResetting);
DVLOGF(4);
......
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