Remove extra enumeration
This is a merge of http://go/wvgerrit/13751 from the widevine repository. The CryptoSession had an enumeration for HDCP levels that was copied from OEMCryptoCENC.h by hand. Since that header is included, there is no need to have two enumerations. b/16303994 Change-Id: Ief16ba62163776f9ca80375f3638ef4c7770e742
This commit is contained in:
@@ -168,7 +168,7 @@ class CdmEngine {
|
|||||||
|
|
||||||
void OnKeyReleaseEvent(const CdmKeySetId& key_set_id);
|
void OnKeyReleaseEvent(const CdmKeySetId& key_set_id);
|
||||||
|
|
||||||
std::string MapHdcpVersion(CryptoSession::OemCryptoHdcpVersion version);
|
std::string MapHdcpVersion(CryptoSession::HdcpCapability version);
|
||||||
|
|
||||||
// instance variables
|
// instance variables
|
||||||
CdmSessionMap sessions_;
|
CdmSessionMap sessions_;
|
||||||
|
|||||||
@@ -18,18 +18,7 @@ typedef std::map<CryptoKeyId, CryptoKey*> CryptoKeyMap;
|
|||||||
|
|
||||||
class CryptoSession {
|
class CryptoSession {
|
||||||
public:
|
public:
|
||||||
// This enum should be kept in sync with the values specified for
|
typedef OEMCrypto_HDCP_Capability HdcpCapability;
|
||||||
// HDCP capabilities in OEMCryptoCENC.h. (See comments for
|
|
||||||
// OEMCrypto_GetHDCPCapability)
|
|
||||||
typedef enum {
|
|
||||||
kOemCryptoHdcpNotSupported = 0,
|
|
||||||
kOemCryptoHdcpVersion1 = 1,
|
|
||||||
kOemCryptoHdcpVersion2 = 2,
|
|
||||||
kOemCryptoHdcpVersion2_1 = 3,
|
|
||||||
kOemCryptoHdcpVersion2_2 = 4,
|
|
||||||
kOemCryptoNoHdcpDeviceAttached = 0xff,
|
|
||||||
} OemCryptoHdcpVersion;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
kUsageDurationsInvalid = 0,
|
kUsageDurationsInvalid = 0,
|
||||||
kUsageDurationPlaybackNotBegun = 1,
|
kUsageDurationPlaybackNotBegun = 1,
|
||||||
@@ -107,8 +96,8 @@ class CryptoSession {
|
|||||||
virtual CdmResponseType DeleteAllUsageReports();
|
virtual CdmResponseType DeleteAllUsageReports();
|
||||||
virtual bool IsAntiRollbackHwPresent();
|
virtual bool IsAntiRollbackHwPresent();
|
||||||
|
|
||||||
virtual bool GetHdcpCapabilities(OemCryptoHdcpVersion* current,
|
virtual bool GetHdcpCapabilities(HdcpCapability* current,
|
||||||
OemCryptoHdcpVersion* max);
|
HdcpCapability* max);
|
||||||
virtual bool GetRandom(size_t data_length, uint8_t* random_data);
|
virtual bool GetRandom(size_t data_length, uint8_t* random_data);
|
||||||
virtual bool GetNumberOfOpenSessions(size_t* count);
|
virtual bool GetNumberOfOpenSessions(size_t* count);
|
||||||
virtual bool GetMaxNumberOfSessions(size_t* max);
|
virtual bool GetMaxNumberOfSessions(size_t* max);
|
||||||
|
|||||||
@@ -62,19 +62,19 @@ class MaxResEngine {
|
|||||||
bool can_decrypt() const { return can_decrypt_; }
|
bool can_decrypt() const { return can_decrypt_; }
|
||||||
|
|
||||||
void Update(uint32_t res,
|
void Update(uint32_t res,
|
||||||
CryptoSession::OemCryptoHdcpVersion current_hdcp_level);
|
CryptoSession::HdcpCapability current_hdcp_level);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Init(const ConstraintList& constraints);
|
void Init(const ConstraintList& constraints);
|
||||||
|
|
||||||
VideoResolutionConstraint* GetConstraintForRes(uint32_t res);
|
VideoResolutionConstraint* GetConstraintForRes(uint32_t res);
|
||||||
|
|
||||||
static CryptoSession::OemCryptoHdcpVersion ProtobufHdcpToOemCryptoHdcp(
|
static CryptoSession::HdcpCapability ProtobufHdcpToOemCryptoHdcp(
|
||||||
const OutputProtection::HDCP& input);
|
const OutputProtection::HDCP& input);
|
||||||
|
|
||||||
bool can_decrypt_;
|
bool can_decrypt_;
|
||||||
|
|
||||||
CryptoSession::OemCryptoHdcpVersion default_hdcp_level_;
|
CryptoSession::HdcpCapability default_hdcp_level_;
|
||||||
ConstraintList constraints_;
|
ConstraintList constraints_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -428,8 +428,8 @@ CdmResponseType CdmEngine::QueryStatus(CdmQueryMap* key_info) {
|
|||||||
(*key_info)[QUERY_KEY_PROVISIONING_ID] = provisioning_id;
|
(*key_info)[QUERY_KEY_PROVISIONING_ID] = provisioning_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
CryptoSession::OemCryptoHdcpVersion current_hdcp;
|
CryptoSession::HdcpCapability current_hdcp;
|
||||||
CryptoSession::OemCryptoHdcpVersion max_hdcp;
|
CryptoSession::HdcpCapability max_hdcp;
|
||||||
success = crypto_session.GetHdcpCapabilities(¤t_hdcp, &max_hdcp);
|
success = crypto_session.GetHdcpCapabilities(¤t_hdcp, &max_hdcp);
|
||||||
if (success) {
|
if (success) {
|
||||||
(*key_info)[QUERY_KEY_CURRENT_HDCP_LEVEL] = MapHdcpVersion(current_hdcp);
|
(*key_info)[QUERY_KEY_CURRENT_HDCP_LEVEL] = MapHdcpVersion(current_hdcp);
|
||||||
@@ -927,20 +927,20 @@ void CdmEngine::OnKeyReleaseEvent(const CdmKeySetId& key_set_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string CdmEngine::MapHdcpVersion(
|
std::string CdmEngine::MapHdcpVersion(
|
||||||
CryptoSession::OemCryptoHdcpVersion version) {
|
CryptoSession::HdcpCapability version) {
|
||||||
switch (version) {
|
switch (version) {
|
||||||
case CryptoSession::kOemCryptoNoHdcpDeviceAttached:
|
case HDCP_NONE:
|
||||||
return QUERY_VALUE_DISCONNECTED;
|
|
||||||
case CryptoSession::kOemCryptoHdcpNotSupported:
|
|
||||||
return QUERY_VALUE_UNPROTECTED;
|
return QUERY_VALUE_UNPROTECTED;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion1:
|
case HDCP_V1:
|
||||||
return QUERY_VALUE_HDCP_V1;
|
return QUERY_VALUE_HDCP_V1;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion2:
|
case HDCP_V2:
|
||||||
return QUERY_VALUE_HDCP_V2_0;
|
return QUERY_VALUE_HDCP_V2_0;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion2_1:
|
case HDCP_V2_1:
|
||||||
return QUERY_VALUE_HDCP_V2_1;
|
return QUERY_VALUE_HDCP_V2_1;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion2_2:
|
case HDCP_V2_2:
|
||||||
return QUERY_VALUE_HDCP_V2_2;
|
return QUERY_VALUE_HDCP_V2_2;
|
||||||
|
case HDCP_NO_DIGITAL_OUTPUT:
|
||||||
|
return QUERY_VALUE_DISCONNECTED;
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -994,27 +994,20 @@ bool CryptoSession::RewrapDeviceRSAKey(const std::string& message,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CryptoSession::GetHdcpCapabilities(OemCryptoHdcpVersion* current_version,
|
bool CryptoSession::GetHdcpCapabilities(HdcpCapability* current,
|
||||||
OemCryptoHdcpVersion* max_version) {
|
HdcpCapability* max) {
|
||||||
LOGV("GetHdcpCapabilities: id=%ld", (uint32_t)oec_session_id_);
|
LOGV("GetHdcpCapabilities: id=%ld", (uint32_t)oec_session_id_);
|
||||||
if (!initialized_) return false;
|
if (!initialized_) return false;
|
||||||
if (current_version == NULL || max_version == NULL) {
|
if (current == NULL || max == NULL) {
|
||||||
LOGE(
|
LOGE("CryptoSession::GetHdcpCapabilities: |current|, |max| cannot be NULL");
|
||||||
"CryptoSession::GetHdcpCapabilities: |current_version|, "
|
|
||||||
"|max_version| cannot be NULL");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
OEMCrypto_HDCP_Capability current, max;
|
|
||||||
OEMCryptoResult status = OEMCrypto_GetHDCPCapability(
|
OEMCryptoResult status = OEMCrypto_GetHDCPCapability(
|
||||||
requested_security_level_, ¤t, &max);
|
requested_security_level_, current, max);
|
||||||
|
|
||||||
if (OEMCrypto_SUCCESS != status) {
|
if (OEMCrypto_SUCCESS != status) {
|
||||||
LOGW("OEMCrypto_GetHDCPCapability fails with %d", status);
|
LOGW("OEMCrypto_GetHDCPCapability fails with %d", status);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*current_version = static_cast<OemCryptoHdcpVersion>(current);
|
|
||||||
*max_version = static_cast<OemCryptoHdcpVersion>(max);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -282,35 +282,35 @@ bool CdmLicense::PrepareKeyRequest(const InitializationData& init_data,
|
|||||||
client_capabilities->set_oem_crypto_api_version(api_version);
|
client_capabilities->set_oem_crypto_api_version(api_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
CryptoSession::OemCryptoHdcpVersion current_version, max_version;
|
CryptoSession::HdcpCapability current_version, max_version;
|
||||||
if (session_->GetHdcpCapabilities(¤t_version, &max_version)) {
|
if (session_->GetHdcpCapabilities(¤t_version, &max_version)) {
|
||||||
switch (max_version) {
|
switch (max_version) {
|
||||||
case CryptoSession::kOemCryptoHdcpNotSupported:
|
case HDCP_NONE:
|
||||||
client_capabilities->set_max_hdcp_version(
|
client_capabilities->set_max_hdcp_version(
|
||||||
video_widevine_server::sdk::
|
video_widevine_server::sdk::
|
||||||
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_NONE);
|
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_NONE);
|
||||||
break;
|
break;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion1:
|
case HDCP_V1:
|
||||||
client_capabilities->set_max_hdcp_version(
|
client_capabilities->set_max_hdcp_version(
|
||||||
video_widevine_server::sdk::
|
video_widevine_server::sdk::
|
||||||
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V1);
|
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V1);
|
||||||
break;
|
break;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion2:
|
case HDCP_V2:
|
||||||
client_capabilities->set_max_hdcp_version(
|
client_capabilities->set_max_hdcp_version(
|
||||||
video_widevine_server::sdk::
|
video_widevine_server::sdk::
|
||||||
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V2);
|
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V2);
|
||||||
break;
|
break;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion2_1:
|
case HDCP_V2_1:
|
||||||
client_capabilities->set_max_hdcp_version(
|
client_capabilities->set_max_hdcp_version(
|
||||||
video_widevine_server::sdk::
|
video_widevine_server::sdk::
|
||||||
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V2_1);
|
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V2_1);
|
||||||
break;
|
break;
|
||||||
case CryptoSession::kOemCryptoHdcpVersion2_2:
|
case HDCP_V2_2:
|
||||||
client_capabilities->set_max_hdcp_version(
|
client_capabilities->set_max_hdcp_version(
|
||||||
video_widevine_server::sdk::
|
video_widevine_server::sdk::
|
||||||
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V2_2);
|
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_V2_2);
|
||||||
break;
|
break;
|
||||||
case CryptoSession::kOemCryptoNoHdcpDeviceAttached:
|
case HDCP_NO_DIGITAL_OUTPUT:
|
||||||
client_capabilities->set_max_hdcp_version(
|
client_capabilities->set_max_hdcp_version(
|
||||||
video_widevine_server::sdk::
|
video_widevine_server::sdk::
|
||||||
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_NO_DIGITAL_OUTPUT);
|
ClientIdentification_ClientCapabilities_HdcpVersion_HDCP_NO_DIGITAL_OUTPUT);
|
||||||
|
|||||||
@@ -76,10 +76,10 @@ void MaxResEngine::OnTimerEvent() {
|
|||||||
int64_t current_time = clock_->GetCurrentTime();
|
int64_t current_time = clock_->GetCurrentTime();
|
||||||
if (!keys_.empty() && current_resolution_ != kNoResolution &&
|
if (!keys_.empty() && current_resolution_ != kNoResolution &&
|
||||||
current_time >= next_check_time_) {
|
current_time >= next_check_time_) {
|
||||||
CryptoSession::OemCryptoHdcpVersion current_hdcp_level;
|
CryptoSession::HdcpCapability current_hdcp_level;
|
||||||
CryptoSession::OemCryptoHdcpVersion ignored;
|
CryptoSession::HdcpCapability ignored;
|
||||||
if (!crypto_session_->GetHdcpCapabilities(¤t_hdcp_level, &ignored)) {
|
if (!crypto_session_->GetHdcpCapabilities(¤t_hdcp_level, &ignored)) {
|
||||||
current_hdcp_level = CryptoSession::kOemCryptoHdcpNotSupported;
|
current_hdcp_level = HDCP_NONE;
|
||||||
}
|
}
|
||||||
for (KeyIterator i = keys_.begin(); i != keys_.end(); ++i) {
|
for (KeyIterator i = keys_.begin(); i != keys_.end(); ++i) {
|
||||||
i->second->Update(current_resolution_, current_hdcp_level);
|
i->second->Update(current_resolution_, current_hdcp_level);
|
||||||
@@ -95,7 +95,7 @@ void MaxResEngine::DeleteAllKeys() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MaxResEngine::KeyStatus::KeyStatus(const ConstraintList& constraints)
|
MaxResEngine::KeyStatus::KeyStatus(const ConstraintList& constraints)
|
||||||
: default_hdcp_level_(CryptoSession::kOemCryptoHdcpNotSupported) {
|
: default_hdcp_level_(HDCP_NONE) {
|
||||||
Init(constraints);
|
Init(constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ void MaxResEngine::KeyStatus::Init(const ConstraintList& constraints) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MaxResEngine::KeyStatus::Update(
|
void MaxResEngine::KeyStatus::Update(
|
||||||
uint32_t res, CryptoSession::OemCryptoHdcpVersion current_hdcp_level) {
|
uint32_t res, CryptoSession::HdcpCapability current_hdcp_level) {
|
||||||
VideoResolutionConstraint* current_constraint = GetConstraintForRes(res);
|
VideoResolutionConstraint* current_constraint = GetConstraintForRes(res);
|
||||||
|
|
||||||
if (current_constraint == NULL) {
|
if (current_constraint == NULL) {
|
||||||
@@ -121,7 +121,7 @@ void MaxResEngine::KeyStatus::Update(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CryptoSession::OemCryptoHdcpVersion desired_hdcp_level;
|
CryptoSession::HdcpCapability desired_hdcp_level;
|
||||||
if (current_constraint->has_required_protection()) {
|
if (current_constraint->has_required_protection()) {
|
||||||
desired_hdcp_level = ProtobufHdcpToOemCryptoHdcp(
|
desired_hdcp_level = ProtobufHdcpToOemCryptoHdcp(
|
||||||
current_constraint->required_protection().hdcp());
|
current_constraint->required_protection().hdcp());
|
||||||
@@ -147,25 +147,26 @@ MaxResEngine::KeyStatus::GetConstraintForRes(uint32_t res) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CryptoSession::OemCryptoHdcpVersion
|
CryptoSession::HdcpCapability
|
||||||
MaxResEngine::KeyStatus::ProtobufHdcpToOemCryptoHdcp(
|
MaxResEngine::KeyStatus::ProtobufHdcpToOemCryptoHdcp(
|
||||||
const OutputProtection::HDCP& input) {
|
const OutputProtection::HDCP& input) {
|
||||||
switch (input) {
|
switch (input) {
|
||||||
case OutputProtection::HDCP_NONE:
|
case OutputProtection::HDCP_NONE:
|
||||||
return CryptoSession::kOemCryptoHdcpNotSupported;
|
return HDCP_NONE;
|
||||||
case OutputProtection::HDCP_V1:
|
case OutputProtection::HDCP_V1:
|
||||||
return CryptoSession::kOemCryptoHdcpVersion1;
|
return HDCP_V1;
|
||||||
case OutputProtection::HDCP_V2:
|
case OutputProtection::HDCP_V2:
|
||||||
return CryptoSession::kOemCryptoHdcpVersion2;
|
return HDCP_V2;
|
||||||
case OutputProtection::HDCP_V2_1:
|
case OutputProtection::HDCP_V2_1:
|
||||||
return CryptoSession::kOemCryptoHdcpVersion2_1;
|
return HDCP_V2_1;
|
||||||
case OutputProtection::HDCP_V2_2:
|
case OutputProtection::HDCP_V2_2:
|
||||||
return CryptoSession::kOemCryptoHdcpVersion2_2;
|
return HDCP_V2_2;
|
||||||
|
case OutputProtection::HDCP_NO_DIGITAL_OUTPUT:
|
||||||
|
return HDCP_NO_DIGITAL_OUTPUT;
|
||||||
default:
|
default:
|
||||||
LOGE(
|
LOGE("MaxResEngine::KeyStatus::ProtobufHdcpToOemCryptoHdcp: "
|
||||||
"MaxResEngine::KeyStatus::ProtobufHdcpToOemCryptoHdcp: "
|
"Unknown HDCP Level");
|
||||||
"Unknown HDCP Level");
|
return HDCP_NO_DIGITAL_OUTPUT;
|
||||||
return CryptoSession::kOemCryptoNoHdcpDeviceAttached;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,8 +97,7 @@ class MockCryptoSession : public CryptoSession {
|
|||||||
MOCK_METHOD0(IsOpen, bool());
|
MOCK_METHOD0(IsOpen, bool());
|
||||||
MOCK_METHOD1(GenerateRequestId, bool(std::string*));
|
MOCK_METHOD1(GenerateRequestId, bool(std::string*));
|
||||||
MOCK_METHOD1(UsageInformationSupport, bool(bool*));
|
MOCK_METHOD1(UsageInformationSupport, bool(bool*));
|
||||||
MOCK_METHOD2(GetHdcpCapabilities,
|
MOCK_METHOD2(GetHdcpCapabilities, bool(HdcpCapability*, HdcpCapability*));
|
||||||
bool(OemCryptoHdcpVersion*, OemCryptoHdcpVersion*));
|
|
||||||
MOCK_METHOD1(GetApiVersion, bool(uint32_t*));
|
MOCK_METHOD1(GetApiVersion, bool(uint32_t*));
|
||||||
MOCK_METHOD1(GenerateNonce, bool(uint32_t*));
|
MOCK_METHOD1(GenerateNonce, bool(uint32_t*));
|
||||||
MOCK_METHOD3(PrepareRequest, bool(const std::string&, bool, std::string*));
|
MOCK_METHOD3(PrepareRequest, bool(const std::string&, bool, std::string*));
|
||||||
@@ -178,10 +177,8 @@ TEST_F(CdmLicenseTest, InitFail_PolicyEngineNull) {
|
|||||||
|
|
||||||
TEST_F(CdmLicenseTest, PrepareKeyRequestValidation) {
|
TEST_F(CdmLicenseTest, PrepareKeyRequestValidation) {
|
||||||
bool usage_information_support = true;
|
bool usage_information_support = true;
|
||||||
CryptoSession::OemCryptoHdcpVersion current_hdcp_version =
|
CryptoSession::HdcpCapability current_hdcp_version = HDCP_NO_DIGITAL_OUTPUT;
|
||||||
CryptoSession::kOemCryptoNoHdcpDeviceAttached;
|
CryptoSession::HdcpCapability max_hdcp_version = HDCP_V2_1;
|
||||||
CryptoSession::OemCryptoHdcpVersion max_hdcp_version =
|
|
||||||
CryptoSession::kOemCryptoHdcpVersion2_1;
|
|
||||||
uint32_t crypto_session_api_version = 9;
|
uint32_t crypto_session_api_version = 9;
|
||||||
|
|
||||||
EXPECT_CALL(*crypto_session_, IsOpen()).WillOnce(Return(true));
|
EXPECT_CALL(*crypto_session_, IsOpen()).WillOnce(Return(true));
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ const int64_t kHdcpInterval = 10;
|
|||||||
|
|
||||||
class HdcpOnlyMockCryptoSession : public CryptoSession {
|
class HdcpOnlyMockCryptoSession : public CryptoSession {
|
||||||
public:
|
public:
|
||||||
MOCK_METHOD2(GetHdcpCapabilities,
|
MOCK_METHOD2(GetHdcpCapabilities, bool(HdcpCapability*, HdcpCapability*));
|
||||||
bool(OemCryptoHdcpVersion*, OemCryptoHdcpVersion*));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ACTION_P2(IncrementAndReturnPointee, p, a) {
|
ACTION_P2(IncrementAndReturnPointee, p, a) {
|
||||||
@@ -188,7 +187,7 @@ TEST_F(MaxResEngineTest, IsPermissiveWithoutAResolution) {
|
|||||||
TEST_F(MaxResEngineTest, HandlesResolutionsBasedOnConstraints) {
|
TEST_F(MaxResEngineTest, HandlesResolutionsBasedOnConstraints) {
|
||||||
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
||||||
.WillRepeatedly(
|
.WillRepeatedly(
|
||||||
DoAll(SetArgPointee<0>(CryptoSession::kOemCryptoNoHdcpDeviceAttached),
|
DoAll(SetArgPointee<0>(HDCP_NO_DIGITAL_OUTPUT),
|
||||||
Return(true)));
|
Return(true)));
|
||||||
|
|
||||||
max_res_engine_->SetLicense(license_);
|
max_res_engine_->SetLicense(license_);
|
||||||
@@ -229,14 +228,14 @@ TEST_F(MaxResEngineTest, RequestsHdcpImmediatelyAndOnlyAfterInterval) {
|
|||||||
EXPECT_CALL(*mock_clock_, GetCurrentTime()).WillOnce(Return(start_time));
|
EXPECT_CALL(*mock_clock_, GetCurrentTime()).WillOnce(Return(start_time));
|
||||||
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
||||||
.WillOnce(
|
.WillOnce(
|
||||||
DoAll(SetArgPointee<0>(CryptoSession::kOemCryptoHdcpVersion2_2),
|
DoAll(SetArgPointee<0>(HDCP_V2_2),
|
||||||
Return(true)));
|
Return(true)));
|
||||||
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
EXPECT_CALL(*mock_clock_, GetCurrentTime())
|
||||||
.WillOnce(Return(start_time + kHdcpInterval / 2))
|
.WillOnce(Return(start_time + kHdcpInterval / 2))
|
||||||
.WillOnce(Return(start_time + kHdcpInterval));
|
.WillOnce(Return(start_time + kHdcpInterval));
|
||||||
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
||||||
.WillOnce(
|
.WillOnce(
|
||||||
DoAll(SetArgPointee<0>(CryptoSession::kOemCryptoHdcpVersion2_2),
|
DoAll(SetArgPointee<0>(HDCP_V2_2),
|
||||||
Return(true)));
|
Return(true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +255,7 @@ TEST_F(MaxResEngineTest, DoesNotRequestHdcpWithoutALicense) {
|
|||||||
TEST_F(MaxResEngineTest, HandlesConstraintOverridingHdcp) {
|
TEST_F(MaxResEngineTest, HandlesConstraintOverridingHdcp) {
|
||||||
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
||||||
.WillRepeatedly(
|
.WillRepeatedly(
|
||||||
DoAll(SetArgPointee<0>(CryptoSession::kOemCryptoHdcpVersion2),
|
DoAll(SetArgPointee<0>(HDCP_V2),
|
||||||
Return(true)));
|
Return(true)));
|
||||||
|
|
||||||
max_res_engine_->SetLicense(license_);
|
max_res_engine_->SetLicense(license_);
|
||||||
@@ -283,7 +282,7 @@ TEST_F(MaxResEngineTest, HandlesConstraintOverridingHdcp) {
|
|||||||
TEST_F(MaxResEngineTest, HandlesNoHdcp) {
|
TEST_F(MaxResEngineTest, HandlesNoHdcp) {
|
||||||
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
EXPECT_CALL(crypto_session_, GetHdcpCapabilities(_, _))
|
||||||
.WillRepeatedly(
|
.WillRepeatedly(
|
||||||
DoAll(SetArgPointee<0>(CryptoSession::kOemCryptoHdcpNotSupported),
|
DoAll(SetArgPointee<0>(HDCP_NONE),
|
||||||
Return(true)));
|
Return(true)));
|
||||||
|
|
||||||
max_res_engine_->SetLicense(license_);
|
max_res_engine_->SetLicense(license_);
|
||||||
|
|||||||
Reference in New Issue
Block a user