Save usage information before closing a session am: 9ba6493e1b
am: 86a1b18c24
Change-Id: I021e8792da5051f3a7cde08a7af33409e2c81194
This commit is contained in:
@@ -54,6 +54,12 @@ CdmSession::CdmSession(FileSystem* file_system,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CdmSession::~CdmSession() {
|
CdmSession::~CdmSession() {
|
||||||
|
if (usage_support_type_ == kUsageEntrySupport &&
|
||||||
|
has_provider_session_token() &&
|
||||||
|
usage_table_header_ != NULL) {
|
||||||
|
UpdateUsageEntryInformation();
|
||||||
|
}
|
||||||
|
|
||||||
if (!key_set_id_.empty()) {
|
if (!key_set_id_.empty()) {
|
||||||
// Unreserve the license ID.
|
// Unreserve the license ID.
|
||||||
file_handle_->UnreserveLicenseId(key_set_id_);
|
file_handle_->UnreserveLicenseId(key_set_id_);
|
||||||
|
|||||||
@@ -338,11 +338,12 @@ TEST_F(CdmSessionTest, UpdateUsageEntry) {
|
|||||||
|
|
||||||
// Set up mocks and expectations for the UpdateUsageEntryInformation call.
|
// Set up mocks and expectations for the UpdateUsageEntryInformation call.
|
||||||
EXPECT_CALL(*crypto_session_, GetUsageSupportType(_))
|
EXPECT_CALL(*crypto_session_, GetUsageSupportType(_))
|
||||||
.WillOnce(DoAll(SetArgPointee<0>(kUsageEntrySupport), Return(NO_ERROR)));
|
.WillRepeatedly(DoAll(
|
||||||
|
SetArgPointee<0>(kUsageEntrySupport), Return(NO_ERROR)));
|
||||||
EXPECT_CALL(*license_parser_, provider_session_token())
|
EXPECT_CALL(*license_parser_, provider_session_token())
|
||||||
.WillOnce(Return("Mock provider session token"));
|
.WillRepeatedly(Return("Mock provider session token"));
|
||||||
EXPECT_CALL(usage_table_header_, UpdateEntry(NotNull(), NotNull()))
|
EXPECT_CALL(usage_table_header_, UpdateEntry(NotNull(), NotNull()))
|
||||||
.WillOnce(Return(NO_ERROR));
|
.WillRepeatedly(Return(NO_ERROR));
|
||||||
|
|
||||||
EXPECT_EQ(NO_ERROR, cdm_session_->Init(NULL));
|
EXPECT_EQ(NO_ERROR, cdm_session_->Init(NULL));
|
||||||
EXPECT_EQ(kUsageEntrySupport, cdm_session_->get_usage_support_type())
|
EXPECT_EQ(kUsageEntrySupport, cdm_session_->get_usage_support_type())
|
||||||
|
|||||||
Reference in New Issue
Block a user