Update cdm provision tests to work with prov 4
[ Merge of http://go/wvgerrit/150810 ] This CL changes the call "Provision()" in some tests to use "EnsureProvisioned()". The latter can actually call "Provision()" twice in case of Prov 4 being used: first call to get oemcert.bin and second call to get drm cert.bin. Also added a file clean up during test tear-down. Test: opk_ta with prov2 and prov4 Bug: 180530495 Bug: 236317198 Change-Id: I37c8708ead7f18e8b4d619bf6a080424e45406ee
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
// source code may only be used and distributed under the Widevine License
|
// source code may only be used and distributed under the Widevine License
|
||||||
// Agreement.
|
// Agreement.
|
||||||
// These tests are for the cdm engine, and code below it in the stack. In
|
// These tests are for the cdm engine, and code below it in the stack. In
|
||||||
// particular, we assume that the OEMCrypo layer works, and has a valid keybox.
|
// particular, we assume that the OEMCrypto layer works, and has a valid keybox.
|
||||||
// This is because we need a valid RSA certificate, and will attempt to connect
|
// This is because we need a valid RSA certificate, and will attempt to connect
|
||||||
// to the provisioning server to request one if we don't.
|
// to the provisioning server to request one if we don't.
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class WvCdmEnginePreProvTest : public WvCdmTestBaseWithEngine {
|
|||||||
CdmResponseType status = cdm_engine_.OpenSession(
|
CdmResponseType status = cdm_engine_.OpenSession(
|
||||||
config_.key_system(), nullptr, nullptr, &session_id_);
|
config_.key_system(), nullptr, nullptr, &session_id_);
|
||||||
if (status == NEED_PROVISIONING) {
|
if (status == NEED_PROVISIONING) {
|
||||||
Provision();
|
EnsureProvisioned();
|
||||||
status = cdm_engine_.OpenSession(config_.key_system(), nullptr, nullptr,
|
status = cdm_engine_.OpenSession(config_.key_system(), nullptr, nullptr,
|
||||||
&session_id_);
|
&session_id_);
|
||||||
}
|
}
|
||||||
@@ -335,20 +335,22 @@ TEST_F(WvCdmEngineTest, SetLicensingServiceInvalidCertificate) {
|
|||||||
NO_ERROR);
|
NO_ERROR);
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(WvCdmEnginePreProvTestStaging, ProvisioningTest) { Provision(); }
|
TEST_F(WvCdmEnginePreProvTestStaging, ProvisioningTest) { EnsureProvisioned(); }
|
||||||
|
|
||||||
TEST_F(WvCdmEnginePreProvTestUatBinary, ProvisioningTest) { Provision(); }
|
TEST_F(WvCdmEnginePreProvTestUatBinary, ProvisioningTest) {
|
||||||
|
EnsureProvisioned();
|
||||||
|
}
|
||||||
|
|
||||||
// Test that provisioning works.
|
// Test that provisioning works.
|
||||||
TEST_F(WvCdmEngineTest, ProvisioningTest) { Provision(); }
|
TEST_F(WvCdmEngineTest, ProvisioningTest) { EnsureProvisioned(); }
|
||||||
|
|
||||||
// Test that provisioning works, even if device is already provisioned.
|
// Test that provisioning works, even if device is already provisioned.
|
||||||
TEST_F(WvCdmEngineTest, ReprovisioningTest) {
|
TEST_F(WvCdmEngineTest, ReprovisioningTest) {
|
||||||
// Provision once.
|
// Provision once.
|
||||||
Provision();
|
EnsureProvisioned();
|
||||||
// Verify that we can provision a second time, even though we already
|
// Verify that we can provision a second time, even though we already
|
||||||
// provisioned once.
|
// provisioned once.
|
||||||
Provision();
|
EnsureProvisioned();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WvCdmEngineTest, BaseIsoBmffMessageTest) {
|
TEST_F(WvCdmEngineTest, BaseIsoBmffMessageTest) {
|
||||||
|
|||||||
Reference in New Issue
Block a user