Commit c42add43 authored by Wojciech Dzierżanowski's avatar Wojciech Dzierżanowski Committed by Commit Bot

Avoid race in MSE_Widevine tests

When run with the stub Widevine CDM, these tests suffer from a race
between the result of a failed StubCdm::Decrypt() and a failed
StubCdm::UpdateSession().  The tests expect the latter, but the former
often arrives first.

By allowing the stub to InitializeVideoDecoder() successfully and
returning cdm::kNoKey upon DecryptAndDecodeFrame() attempt we avoid the
DecryptingDemuxerStream errors altogether, so there is no race anymore.

Bug: 768745
Test: 'browser_tests --gtest_filter=*MSE_Widevine*' pass when run with the stub Widevine CDM

Change-Id: I35a35d006d118f8f7f9a8a64cf9334017644f4ea
Reviewed-on: https://chromium-review.googlesource.com/831026Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#524663}
parent f3037b31
...@@ -114,12 +114,12 @@ cdm::Status StubCdm::Decrypt(const cdm::InputBuffer& /* encrypted_buffer */, ...@@ -114,12 +114,12 @@ cdm::Status StubCdm::Decrypt(const cdm::InputBuffer& /* encrypted_buffer */,
cdm::Status StubCdm::InitializeAudioDecoder( cdm::Status StubCdm::InitializeAudioDecoder(
const cdm::AudioDecoderConfig& /* audio_decoder_config */) { const cdm::AudioDecoderConfig& /* audio_decoder_config */) {
return cdm::kDecryptError; return cdm::kSuccess;
} }
cdm::Status StubCdm::InitializeVideoDecoder( cdm::Status StubCdm::InitializeVideoDecoder(
const cdm::VideoDecoderConfig& /* video_decoder_config */) { const cdm::VideoDecoderConfig& /* video_decoder_config */) {
return cdm::kDecryptError; return cdm::kSuccess;
} }
void StubCdm::ResetDecoder(cdm::StreamType /* decoder_type */) { void StubCdm::ResetDecoder(cdm::StreamType /* decoder_type */) {
...@@ -131,13 +131,13 @@ void StubCdm::DeinitializeDecoder(cdm::StreamType /* decoder_type */) { ...@@ -131,13 +131,13 @@ void StubCdm::DeinitializeDecoder(cdm::StreamType /* decoder_type */) {
cdm::Status StubCdm::DecryptAndDecodeFrame( cdm::Status StubCdm::DecryptAndDecodeFrame(
const cdm::InputBuffer& /* encrypted_buffer */, const cdm::InputBuffer& /* encrypted_buffer */,
cdm::VideoFrame* /* decoded_frame */) { cdm::VideoFrame* /* decoded_frame */) {
return cdm::kDecryptError; return cdm::kNoKey;
} }
cdm::Status StubCdm::DecryptAndDecodeSamples( cdm::Status StubCdm::DecryptAndDecodeSamples(
const cdm::InputBuffer& /* encrypted_buffer */, const cdm::InputBuffer& /* encrypted_buffer */,
cdm::AudioFrames* /* audio_frames */) { cdm::AudioFrames* /* audio_frames */) {
return cdm::kDecryptError; return cdm::kNoKey;
} }
void StubCdm::Destroy() { void StubCdm::Destroy() {
......
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