Merge "Enforce OEMCrypto insufficient resources error reporting" into pi-widevine-release

This commit is contained in:
Rahul Frias
2019-01-08 16:42:07 +00:00
committed by Android (Google) Code Review
5 changed files with 376 additions and 1114 deletions

View File

@@ -70,6 +70,14 @@ class UsageTableHeader {
DeviceFiles* handle,
metrics::CryptoMetrics* metrics);
// Test only method. This method emulates the behavior of DeleteEntry
// without actually invoking OEMCrypto (through CryptoSession)
// or storage (through DeviceFiles). It modifies internal data structures
// when DeleteEntry is mocked. This allows one to test methods that are
// dependent on DeleteEntry without having to set expectations
// for the objects that DeleteEntry depends on.
void DeleteEntryForTest(uint32_t usage_entry_number);
private:
CdmResponseType MoveEntry(uint32_t from /* usage entry number */,
const CdmUsageEntry& from_usage_entry,
@@ -118,6 +126,9 @@ class UsageTableHeader {
metrics::CryptoMetrics alternate_crypto_metrics_;
// TODO(rfrias): Move to utility class
uint32_t GetRandomInRange(size_t upper_bound_inclusive);
// Test related declarations
friend class UsageTableHeaderTest;