Fix expiry time overflow if it is unlimited

Bug: 21324836

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/14392

Change-Id: I2a8da14c98f8ae0fece3667b6f6b8517577f8a98
This commit is contained in:
Kongqun Yang
2015-05-19 18:09:02 -07:00
parent b513c016ed
commit ce68b8ee88
9 changed files with 25 additions and 15 deletions

View File

@@ -1328,6 +1328,11 @@ TEST_F(WVDrmPluginTest, MarshalsEvents) {
sendEvent(DrmPlugin::kDrmPluginEventKeyNeeded, 0,
Pointee(ElementsAreArray(sessionIdRaw, kSessionIdSize)),
NULL));
// Expiry Time in Java API is in milliseconds.
EXPECT_CALL(*listener,
sendExpirationUpdate(
Pointee(ElementsAreArray(sessionIdRaw, kSessionIdSize)),
NEVER_EXPIRES));
EXPECT_CALL(*listener,
sendExpirationUpdate(
Pointee(ElementsAreArray(sessionIdRaw, kSessionIdSize)),
@@ -1364,6 +1369,7 @@ TEST_F(WVDrmPluginTest, MarshalsEvents) {
plugin.OnSessionKeysChange(cdmSessionId, cdmKeysStatus, false);
plugin.OnSessionRenewalNeeded(cdmSessionId);
plugin.OnExpirationUpdate(cdmSessionId, NEVER_EXPIRES);
plugin.OnExpirationUpdate(cdmSessionId, kExpiryTimeInSeconds);
cdmKeysStatus[kKeyId1] = kKeyStatusUsable;