Fixes missing or broken metrics in Widevine CDM
A few metrics were missing or not properly collected in the CDM metrics. This CL addresses them. Bug: 64570194 Bug: 72866232 Test: Unit tests and Google Play manual test. Change-Id: I3a3aa4fb3eb8422c9c8c398016f02409307beb33
This commit is contained in:
@@ -605,6 +605,26 @@ class WvCdmExtendedDurationTest : public WvCdmTestBase {
|
||||
EXPECT_TRUE(license_renewal.has_key_control_nonce());
|
||||
}
|
||||
|
||||
void ValidateHasUpdateUsageEntry(const std::string& serialized_metrics)
|
||||
const {
|
||||
drm_metrics::WvCdmMetricsGroup group;
|
||||
ASSERT_TRUE(group.ParseFromString(serialized_metrics));
|
||||
bool has_update_usage_entry_metrics = false;
|
||||
for (const auto& metrics : group.metrics()) {
|
||||
for (const auto& session : metrics.session_metrics()) {
|
||||
has_update_usage_entry_metrics |=
|
||||
session.crypto_metrics()
|
||||
.crypto_session_update_usage_entry_time_us().size() > 0;
|
||||
has_update_usage_entry_metrics |=
|
||||
session.crypto_metrics().oemcrypto_update_usage_entry().size() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_TRUE(has_update_usage_entry_metrics)
|
||||
<< "metrics: " << wvcdm::b2a_hex(serialized_metrics);
|
||||
|
||||
}
|
||||
|
||||
void QueryKeyStatus(bool streaming, bool expect_renewal,
|
||||
int64_t* license_duration_remaining,
|
||||
int64_t* playback_duration_remaining) {
|
||||
@@ -1430,6 +1450,11 @@ TEST_P(WvCdmStreamingUsageReportTest, UsageTest) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Validate that update usage table entry is exercised.
|
||||
std::string serialized_metrics;
|
||||
decryptor_.GetSerializedMetrics(&serialized_metrics);
|
||||
ValidateHasUpdateUsageEntry(serialized_metrics);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Cdm, WvCdmStreamingUsageReportTest,
|
||||
|
||||
Reference in New Issue
Block a user