New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 768745 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

Fix tests failing filtered by name: `MSE_Widevine`

Reported by rkuk...@yandex-team.ru, Sep 26 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0

Steps to reproduce the problem:
1. Build browser_tests with gn args "is_component_build=true is_debug=true enable_widevine=true"
2. browser_tests.exe --gtest_filter=MSE_Widevine*

What is the expected behavior?

What went wrong?
15 tests failed:                                                                                                                               
    MSE_Widevine/EncryptedMediaTest.Playback_AudioClearVideo_WebM/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)            
    MSE_Widevine/EncryptedMediaTest.Playback_VP9Video_WebM_Fullsample/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)        
    MSE_Widevine/EncryptedMediaTest.Playback_VP9Video_WebM_Subsample/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)         
    MSE_Widevine/EncryptedMediaTest.Playback_VideoClearAudio_WebM/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)            
    MSE_Widevine/EncryptedMediaTest.Playback_VideoClearAudio_WebM_Opus/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)       
    MSE_Widevine/EncryptedMediaTest.PolicyCheck/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)                              
    MSE_Widevine_Mojo/EncryptedMediaTest.InvalidResponseKeyError/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)             
    MSE_Widevine_Mojo/EncryptedMediaTest.Playback_AudioClearVideo_WebM/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)       
    MSE_Widevine_Mojo/EncryptedMediaTest.Playback_VP9Video_WebM_Fullsample/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)   
    MSE_Widevine_Mojo/EncryptedMediaTest.Playback_VP9Video_WebM_Subsample/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)    
    MSE_Widevine_Mojo/EncryptedMediaTest.Playback_VideoAudio_WebM/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)            
    MSE_Widevine_Mojo/EncryptedMediaTest.Playback_VideoAudio_WebM_Opus/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)       
    MSE_Widevine_Mojo/EncryptedMediaTest.Playback_VideoClearAudio_WebM/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)       
    MSE_Widevine_Mojo/EncryptedMediaTest.Playback_VideoClearAudio_WebM_Opus/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)  
    MSE_Widevine_Mojo/EncryptedMediaTest.PolicyCheck/0 (../../chrome/browser/media/encrypted_media_browsertest.cc:530)                         

Did this work before? N/A 

Chrome version: Chromium	63.0.3223.0 (Developer Build) (64-bit)  Channel: dev
OS Version: 10.0
Flash Version: 

Output example: http://www.paste.org/flat/86177

The tests were broken by this commit:
https://chromium.googlesource.com/chromium/src/+/689cd428394fe4065d040bb56e24df681f634cd5%5E%21/
 
Cc: sc00335...@techmahindra.com
Labels: Triaged-ET TE-NeedsTriageHelp
Unable to build the Chrome from our end, hence adding TE-NeedsTriageHelp label for further triage of the issue
Cc: xhw...@chromium.org
Components: Internals>Media>Encrypted
Labels: OS-Mac
Status: Available (was: Unconfirmed)
I've been looking at those failures recently.  It's not always the same set of failing tests, but in the particular cases I've looked at the problem as I see it is the following:

- DecoderSelector tries to initialize DecryptingVideoDecoder and it fails: StubCdm::InitializeVideoDecoder() always fails
- DecoderSelector then successfully initializes DecryptingDemuxerStream and a non-decrypting VideoDecoder
- Playback starts, StubCdm::Decrypt() fails (as always), putting the pipeline in the error state
- StubCdm::UpdateSession() also fails (as always), generating the EME_UPDATE_FAILED title that is actually expected by the test
- Because of the way Utils.setResultInTitle() in //media/test/data/eme_player_js/utils.js works, only the first of the errors matters
- There is a race between those two errors. In my case, the demuxer error "wins" most of the time

@xhwang, do you run these tests with the stub CDM or the full Widevine CDM? I guess the full CDM eliminates the race because the decryption actually works. OTOH the license server is only available on Linux, and also only for Chrome, because the server is sadly not present in the public repo. And if the license cannot be updated the full CDM will also fail, right?

I'm not sure what the best course of action here is. With the stub CDM and no license server there's quite little that can really be tested anyway. Maybe we could change the stub to pretend the decoder initialization is successful and to generate some dummy (e.g., black/silent) frames in DecryptAndDecodeFrame()/DecryptAndDecodeSamples()?

Note that downstream projects cannot really test it with the full CDM and the license server.

Comment 3 by xhw...@chromium.org, Dec 15 2017

We run it with the real Widevine CDM and I never expect stub CDM to pass these tests.

In other words, these test only works in the case where the CDM is bundled (e.g. in Google Chrome), not component updated.

The easiest solution would be to restrict these tests to only run when the CDM is bundled. WDYT?
There's no point in keeping tests that are expected to fail, so if we don't find a better way we'll indeed have to disable them.

Quick question before I explore other options though: Does the test suffer from the race problem when testing with the real CDM but without the license server? Or is the decoding somehow suspended until the session update either succeeds or fails?

Comment 5 by xhw...@chromium.org, Dec 15 2017

In most cases we don't have the license server and we just stop the test after session update etc. In some cases we have a simplified license server to test playback though.

https://cs.chromium.org/chromium/src/chrome/browser/media/encrypted_media_browsertest.cc?rcl=c4dd10518c291c20a9881e6720d8b9a9505c2010&l=159
Owner: wdzierza...@opera.com
Status: Started (was: Available)
I may have found a simple tweak to the stub code that stabilizes the test, see https://chromium-review.googlesource.com/c/chromium/src/+/831026.
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c42add43e4cc9bc096f4e4a1eadc065b27f0b8ca

commit c42add43e4cc9bc096f4e4a1eadc065b27f0b8ca
Author: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Date: Mon Dec 18 07:56:08 2017

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/831026
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#524663}
[modify] https://crrev.com/c42add43e4cc9bc096f4e4a1eadc065b27f0b8ca/media/cdm/stub/stub_cdm.cc

Status: Fixed (was: Started)

Sign in to add a comment