Avoid throwing exceptions when sessions are closed

[ Merge of http://go/wvgerrit/14404 ]

Closing a non-existant (already closed) session results in an exception
being thrown though mediaDrm. The mediaDrm plugin will now ignore
errors when called though MediaDrm.closeSession.

b/21122725

Change-Id: Ib1c48ade4bdb131195ee56ce2af32bf0cd2166da
This commit is contained in:
Rahul Frias
2015-05-22 10:23:25 -07:00
parent 3a7ef26375
commit 5f227dd85d
2 changed files with 15 additions and 2 deletions

View File

@@ -220,6 +220,19 @@ TEST_F(WVDrmPluginTest, ClosesSessions) {
ASSERT_EQ(OK, res);
}
TEST_F(WVDrmPluginTest, ClosesSessionWithoutReturningError) {
StrictMock<MockCDM> cdm;
StrictMock<MockCrypto> crypto;
WVDrmPlugin plugin(&cdm, &crypto);
EXPECT_CALL(cdm, CloseSession(cdmSessionId))
.WillOnce(Return(SESSION_NOT_FOUND_1));
status_t res = plugin.closeSession(sessionId);
ASSERT_EQ(OK, res);
}
TEST_F(WVDrmPluginTest, GeneratesKeyRequests) {
StrictMock<MockCDM> cdm;
StrictMock<MockCrypto> crypto;