Added metrics history for WV CDM for Android.
[ Merge of http://go/wvgerrit/171271 ] There is a need to maintain a short history of metrics from CDMs which have been deleted. This CL adds this ability to the Android version of the WV CDM. The history cannot yet be maintained for long, as the WV CDM instance is destroyed if unused. Further changes are required to the plugin to maintain the history beyond the life-cycle of the CDM instance, and to properly format its output. Bug: 239462891 Bug: 270166158 Test: adb shell dumpsys android.hardware.drm.IDrmFactory/widevine -m Test: atest GtsMediaTestCases Change-Id: I81c0996602722a9795fc3951030d20bb39b5816b
This commit is contained in:
@@ -1545,7 +1545,8 @@ TEST_P(WvCdmStreamingUsageReportTest, DISABLED_UsageTest) {
|
||||
|
||||
// Validate that update usage table entry is exercised.
|
||||
drm_metrics::WvCdmMetrics metrics;
|
||||
ASSERT_EQ(NO_ERROR, decryptor_->GetMetrics(kDefaultCdmIdentifier, &metrics));
|
||||
ASSERT_EQ(NO_ERROR, decryptor_->GetCurrentMetrics(
|
||||
kDefaultCdmIdentifier, &metrics));
|
||||
ValidateHasUpdateUsageEntry(metrics);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class WvContentDecryptionModuleMetricsTest : public WvCdmTestBase {
|
||||
TEST_F(WvContentDecryptionModuleMetricsTest, IdentifierNotFound) {
|
||||
drm_metrics::WvCdmMetrics metrics;
|
||||
ASSERT_EQ(wvcdm::UNKNOWN_ERROR,
|
||||
decryptor_.GetMetrics(kDefaultCdmIdentifier, &metrics));
|
||||
decryptor_.GetCurrentMetrics(kDefaultCdmIdentifier, &metrics));
|
||||
}
|
||||
|
||||
TEST_F(WvContentDecryptionModuleMetricsTest, EngineOnlyMetrics) {
|
||||
@@ -62,7 +62,7 @@ TEST_F(WvContentDecryptionModuleMetricsTest, EngineOnlyMetrics) {
|
||||
|
||||
drm_metrics::WvCdmMetrics metrics;
|
||||
ASSERT_EQ(wvcdm::NO_ERROR,
|
||||
decryptor_.GetMetrics(kDefaultCdmIdentifier, &metrics));
|
||||
decryptor_.GetCurrentMetrics(kDefaultCdmIdentifier, &metrics));
|
||||
|
||||
// 100 is an arbitrary high value that shouldn't ever occur.
|
||||
EXPECT_THAT(metrics.engine_metrics()
|
||||
@@ -110,7 +110,7 @@ TEST_F(WvContentDecryptionModuleMetricsTest, EngineAndSessionMetrics) {
|
||||
|
||||
drm_metrics::WvCdmMetrics metrics;
|
||||
ASSERT_EQ(wvcdm::NO_ERROR,
|
||||
decryptor_.GetMetrics(kDefaultCdmIdentifier, &metrics));
|
||||
decryptor_.GetCurrentMetrics(kDefaultCdmIdentifier, &metrics));
|
||||
std::string serialized_metrics;
|
||||
ASSERT_TRUE(metrics.SerializeToString(&serialized_metrics));
|
||||
|
||||
@@ -162,7 +162,8 @@ TEST_F(WvContentDecryptionModuleMetricsTest,
|
||||
for (int i = 0; i < cdm_engine_count; i++) {
|
||||
drm_metrics::WvCdmMetrics metrics;
|
||||
metrics.Clear();
|
||||
ASSERT_EQ(wvcdm::NO_ERROR, decryptor_.GetMetrics(identifiers[i], &metrics));
|
||||
ASSERT_EQ(wvcdm::NO_ERROR,
|
||||
decryptor_.GetCurrentMetrics(identifiers[i], &metrics));
|
||||
std::string serialized_metrics;
|
||||
ASSERT_TRUE(metrics.SerializeToString(&serialized_metrics));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user