Source release 16.2.0

This commit is contained in:
John W. Bruce
2020-04-10 16:13:07 -07:00
parent 1ff9f8588a
commit b830b1d1fb
883 changed files with 509706 additions and 143739 deletions

View File

@@ -22,10 +22,15 @@ namespace wvcdm {
// to configure OEMCrypto to use a test keybox.
class WvCdmTestBase : public ::testing::Test {
public:
WvCdmTestBase() : config_(default_config_), binary_provisioning_(false) {}
// Default number of provisioning try attempts.
constexpr static size_t kDefaultMaxProvisioningAttempts = 10;
WvCdmTestBase();
~WvCdmTestBase() override {}
void SetUp() override;
virtual std::string binary_key_id() const { return a2bs_hex(config_.key_id()); }
virtual std::string binary_key_id() const {
return a2bs_hex(config_.key_id());
}
// Returns true if the test program should continue, if false, the caller
// should exit. This should be called by main() to allow the user to pass in
@@ -74,7 +79,7 @@ class WvCdmTestBase : public ::testing::Test {
bool binary_provisioning_;
};
class TestCryptoSession : public CryptoSession {
class TestCryptoSession : public CryptoSession {
public:
explicit TestCryptoSession(metrics::CryptoMetrics* crypto_metrics);
// This intercepts nonce flood errors, which is useful for tests that request
@@ -90,7 +95,7 @@ class TestCryptoSession : public CryptoSession {
class TestLicenseHolder {
public:
// cdm_engine must exist and outlive the TestLicenseHolder.
TestLicenseHolder(CdmEngine *cdm_engine);
TestLicenseHolder(CdmEngine* cdm_engine);
~TestLicenseHolder();
// Caller must ensure device already provisioned.
void OpenSession(const std::string& key_system);
@@ -144,6 +149,12 @@ class TestLicenseHolder {
std::vector<uint8_t> session_key_;
};
// Given a PSSH data structure, this makes a PSSH string for use in
// generating a license request.
std::string MakePSSH(const video_widevine::WidevinePsshData& header);
// Given a serialized PSSH data, this generates a full PSSH string.
std::string MakePSSH(const std::string& serialized_header);
} // namespace wvcdm
#endif // WVCDM_CORE_TEST_BASE_H_