Test session should continue with no keybox

Merge from Widevine repo of http://go/wvgerrit/142149

This CL updates the TestCryptoSession so that it will recover from
initializing without a keybox. This allows unit and integration tests
to be run using a test keybox on a device that does not have any
keybox.

Bug: 210807585
Bug: 161925952
Change-Id: I8639bd733a50ae5af3a7c786347b5a06a9d783ce
This commit is contained in:
Fred Gylys-Colwell
2021-12-19 07:25:33 +00:00
parent 2f57079f6a
commit 75b87c7f59
3 changed files with 50 additions and 40 deletions

View File

@@ -323,8 +323,11 @@ class CryptoSession {
int session_count() const { return session_count_; }
bool initialized() const { return initialized_; }
void OverrideInitializedForTesting(bool initialized) {
initialized_ = initialized;
void set_initialized(bool initialized) { initialized_ = initialized; }
// Cache api version and fallback policy. Call this once at initialization.
void CacheVersion();
void OverrideNeedKeyboxForTesting(bool needs_keybox_provisioning) {
needs_keybox_provisioning_ = needs_keybox_provisioning;
}
private: