File util, generic crypto, and key query
This CL merges several CLs from the widevine repo: http://go/wvgerrit/18012 Add support for querying allowed usage for key. http://go/wvgerrit/17971 Add per-origin storage. http://go/wvgerrit/18152 Add OEMCrypto's generic crypto operations to CDM. http://go/wvgerrit/17911 QueryKeyControlInfo => QueryOemCryptoSessionId Note: numbering in wv_cdm_types.h was added in this CL and will be back ported to wvgerrit in a future CL. Change-Id: Idb9e9a67e94f62f25dc16c5307f75a08b3430b64
This commit is contained in:
@@ -66,8 +66,8 @@ class MockCDM : public WvContentDecryptionModule {
|
||||
MOCK_METHOD2(QueryKeyStatus, CdmResponseType(const CdmSessionId&,
|
||||
CdmQueryMap*));
|
||||
|
||||
MOCK_METHOD2(QueryKeyControlInfo, CdmResponseType(const CdmSessionId&,
|
||||
CdmQueryMap*));
|
||||
MOCK_METHOD2(QueryOemCryptoSessionId, CdmResponseType(const CdmSessionId&,
|
||||
CdmQueryMap*));
|
||||
|
||||
MOCK_METHOD5(GetProvisioningRequest, CdmResponseType(CdmCertificateType,
|
||||
const std::string&,
|
||||
@@ -197,7 +197,7 @@ TEST_F(WVDrmPluginTest, OpensSessions) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
@@ -454,7 +454,7 @@ TEST_F(WVDrmPluginTest, HandlesPrivacyCertCaseOfAddKey) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -968,7 +968,7 @@ TEST_F(WVDrmPluginTest, FailsGenericMethodsWithoutAnAlgorithmSet) {
|
||||
.WillRepeatedly(DoAll(SetArgPointee<4>(cdmSessionId),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
@@ -1047,7 +1047,7 @@ TEST_F(WVDrmPluginTest, CallsGenericEncrypt) {
|
||||
.WillRepeatedly(DoAll(SetArgPointee<4>(cdmSessionId),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
@@ -1107,7 +1107,7 @@ TEST_F(WVDrmPluginTest, CallsGenericDecrypt) {
|
||||
.WillRepeatedly(DoAll(SetArgPointee<4>(cdmSessionId),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
@@ -1169,7 +1169,7 @@ TEST_F(WVDrmPluginTest, CallsGenericSign) {
|
||||
.WillRepeatedly(DoAll(SetArgPointee<4>(cdmSessionId),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
@@ -1241,7 +1241,7 @@ TEST_F(WVDrmPluginTest, CallsGenericVerify) {
|
||||
.WillRepeatedly(DoAll(SetArgPointee<4>(cdmSessionId),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
@@ -1274,7 +1274,7 @@ TEST_F(WVDrmPluginTest, RegistersForEvents) {
|
||||
.WillRepeatedly(DoAll(SetArgPointee<4>(cdmSessionId),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.Times(AtLeast(1))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
@@ -1308,10 +1308,10 @@ TEST_F(WVDrmPluginTest, UnregistersForAllEventsOnDestruction) {
|
||||
.WillOnce(DoAll(SetArgPointee<4>(cdmSessionId2),
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId1, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId1, _))
|
||||
.WillOnce(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId2, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId2, _))
|
||||
.WillOnce(Invoke(setSessionIdOnMap<5>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -1458,7 +1458,7 @@ TEST_F(WVDrmPluginTest, ProvidesExpectedDefaultPropertiesToCdm) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -1498,7 +1498,7 @@ TEST_F(WVDrmPluginTest, CanSetAppId) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -1535,7 +1535,7 @@ TEST_P(WVDrmPluginOriginTest, CanSetOrigin) {
|
||||
// Provide expected mock behavior
|
||||
{
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
// Provide expected behavior when plugin closes a session
|
||||
@@ -1585,7 +1585,7 @@ TEST_F(WVDrmPluginTest, CanSetSecurityLevel) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -1670,7 +1670,7 @@ TEST_F(WVDrmPluginTest, CanSetPrivacyMode) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -1727,7 +1727,7 @@ TEST_F(WVDrmPluginTest, CanSetServiceCertificate) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -1780,7 +1780,7 @@ TEST_F(WVDrmPluginTest, CanSetSessionSharing) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
@@ -1839,7 +1839,7 @@ TEST_F(WVDrmPluginTest, AllowsStoringOfSessionSharingId) {
|
||||
Return(wvcdm::NO_ERROR)));
|
||||
|
||||
// Provide expected behavior when plugin requests session control info
|
||||
EXPECT_CALL(*cdm, QueryKeyControlInfo(cdmSessionId, _))
|
||||
EXPECT_CALL(*cdm, QueryOemCryptoSessionId(cdmSessionId, _))
|
||||
.WillRepeatedly(Invoke(setSessionIdOnMap<4>));
|
||||
|
||||
EXPECT_CALL(*cdm, CloseSession(_))
|
||||
|
||||
Reference in New Issue
Block a user