Commit 1b24e32a authored by Dale Curtis's avatar Dale Curtis Committed by Commit Bot

Add test for skipping drain for vp8 when using MediaCodec async.

Basic unit test, we should still see if there's a way to create an
integration test which verifies this.

BUG=1006092
R=liberato

Change-Id: Ic92871fd25964a3d23f9a015014bab1994d5e79d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918333
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715471}
parent 713f129a
......@@ -708,6 +708,28 @@ TEST_P(MediaCodecVideoDecoderVp8Test, UnregisterPlayerBeforeSyncDestruction) {
destruction_observer_->ExpectDestruction();
}
TEST_P(MediaCodecVideoDecoderVp8Test, ResetDoesNotDrainVp8WithAsyncApi) {
EXPECT_CALL(*device_info_, IsAsyncApiSupported())
.WillRepeatedly(Return(true));
auto* codec =
InitializeFully_OneDecodePending(TestVideoConfig::Large(codec_));
// Accept the first decode to transition out of the flushed state.
codec->AcceptOneInput();
PumpCodec();
// The reset should complete immediately because the codec is not VP8 so
// it doesn't need draining. We don't expect a call to Flush on the codec
// since it will be deferred until the first decode after the reset.
base::MockCallback<base::Closure> reset_cb;
EXPECT_CALL(reset_cb, Run());
mcvd_->Reset(reset_cb.Get());
// The reset should complete before destroying the codec, since TearDown will
// complete the drain for VP8. It still might not call reset since a drain
// for destroy probably doesn't, but either way we expect it before the drain.
testing::Mock::VerifyAndClearExpectations(&reset_cb);
}
TEST_P(MediaCodecVideoDecoderH264Test, ResetDoesNotDrainNonVp8Codecs) {
auto* codec =
InitializeFully_OneDecodePending(TestVideoConfig::Large(codec_));
......
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