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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user