New issue
Advanced search Search tips

Issue 657069 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Add unittests for mojo CDM

Project Member Reported by xhw...@chromium.org, Oct 18 2016

Issue description

This is to track adding unit tests for MojoCdm / MojoCdmService. The test should cover common scenarios and connection errors.

See https://codereview.chromium.org/2070753002 for an example to test MojoRenderer and MojoRendererService.
 
Cc: -xhw...@chromium.org
Owner: xhw...@chromium.org
Assign to myself to track this.
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 7 2016

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

commit bc829a7d9755e01bf12444e6aa9c37cc074884b6
Author: xhwang <xhwang@chromium.org>
Date: Wed Dec 07 00:57:01 2016

media: Add MockCdmClient

This can be shared among multiple CDM unittests and deserve a place in
mock_filters.h

Also, by having a mock class, we can use StrictMock to turn uninterested
mock calls into test failure, which wasn't possible with standalone
MOCK_METHODs.

BUG= 657069 
TEST=This only refactored test infrastructure.

Review-Url: https://codereview.chromium.org/2554163002
Cr-Commit-Position: refs/heads/master@{#436801}

[modify] https://crrev.com/bc829a7d9755e01bf12444e6aa9c37cc074884b6/media/base/mock_filters.cc
[modify] https://crrev.com/bc829a7d9755e01bf12444e6aa9c37cc074884b6/media/base/mock_filters.h
[modify] https://crrev.com/bc829a7d9755e01bf12444e6aa9c37cc074884b6/media/cdm/aes_decryptor_unittest.cc
[modify] https://crrev.com/bc829a7d9755e01bf12444e6aa9c37cc074884b6/media/cdm/cdm_adapter_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 7 2016

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

commit 1f3429ba51d768e7461bb702afb74b234efb7337
Author: xhwang <xhwang@chromium.org>
Date: Wed Dec 07 04:16:01 2016

media: Avoid access violation in MojoCdm after connection error

Upon connection error during CDM initialization, after we rejected and
dropped the promise, MojoCdm could be destructed. We should not try to
close pending sessions in this case, and in fact we shouldn't have any
sessions open before the CDM is successfully initialized.

Added a unittest to cover the case where CDM creation failed due to
connection error.

BUG= 652856 , 657069 
TEST=Manually tested. Also added a new unittest.

Review-Url: https://codereview.chromium.org/2551333002
Cr-Commit-Position: refs/heads/master@{#436857}

[modify] https://crrev.com/1f3429ba51d768e7461bb702afb74b234efb7337/media/base/cdm_session_tracker.cc
[modify] https://crrev.com/1f3429ba51d768e7461bb702afb74b234efb7337/media/base/cdm_session_tracker.h
[modify] https://crrev.com/1f3429ba51d768e7461bb702afb74b234efb7337/media/mojo/BUILD.gn
[modify] https://crrev.com/1f3429ba51d768e7461bb702afb74b234efb7337/media/mojo/clients/mojo_cdm.cc
[modify] https://crrev.com/1f3429ba51d768e7461bb702afb74b234efb7337/media/mojo/clients/mojo_cdm.h
[add] https://crrev.com/1f3429ba51d768e7461bb702afb74b234efb7337/media/mojo/clients/mojo_cdm_unittest.cc

Cc: -jrumm...@chromium.org xhw...@chromium.org
Owner: jrumm...@chromium.org
Status: Assigned (was: Available)
We'll need more test when we fix  issue 671362 . Assign to jrummell@ since he'll work on that.
Status: Fixed (was: Assigned)
Marking this as fixed as mojo_cdm_unittest.cc (updated in  issue 671362 ) has tests that verify what happens if a connection error happens before or after each operation.

Sign in to add a comment