Merge MaxNumberOfSessions changes from CDM
Bug: 18377675 Implement new OEMCrypto function to get max number of sessions https://widevine-internal-review.googlesource.com/#/c/12980/ Add oemcrypto static adapter for v9 https://widevine-internal-review.googlesource.com/#/c/13022/ Support new property to query MaxNumberOfSessions in CDM https://widevine-internal-review.googlesource.com/#/c/13020/ Fix GetHdcpCapabilities incorrect return if not initialized https://widevine-internal-review.googlesource.com/#/c/13210/ Change-Id: I02738c543cedd6e38d8826f845fec6cb2b1ede3c
This commit is contained in:
committed by
John "Juce" Bruce
parent
891bd057f4
commit
23c95a1251
@@ -1597,7 +1597,7 @@ TEST_F(OEMCryptoClientTest, VersionNumber) {
|
||||
uint32_t version = OEMCrypto_APIVersion();
|
||||
cout << " OEMCrypto API version is " << version << endl;
|
||||
ASSERT_LE(8, version);
|
||||
ASSERT_GE(9, version);
|
||||
ASSERT_GE(10, version);
|
||||
}
|
||||
|
||||
TEST_F(OEMCryptoClientTest, NormalGetKeyData) {
|
||||
@@ -1650,6 +1650,13 @@ TEST_F(OEMCryptoClientTest, CheckHDCPCapability) {
|
||||
HDCPCapabilityAsString(maximum));
|
||||
}
|
||||
|
||||
TEST_F(OEMCryptoClientTest, CheckMaxNumberOfOEMCryptoSessions) {
|
||||
size_t maximum;
|
||||
OEMCryptoResult sts = OEMCrypto_GetMaxNumberOfSessions(&maximum);
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, sts);
|
||||
printf(" Max Number of Sessions: %zu.\n", maximum);
|
||||
}
|
||||
|
||||
TEST_F(OEMCryptoClientTest, KeyboxValid) {
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_IsKeyboxValid());
|
||||
}
|
||||
@@ -1732,19 +1739,23 @@ TEST_F(OEMCryptoClientTest, TwoSessionsOpenClose) {
|
||||
ASSERT_FALSE(s2.isOpen());
|
||||
}
|
||||
|
||||
TEST_F(OEMCryptoClientTest, EightSessionsOpenClose) {
|
||||
Session s[8];
|
||||
for (int i = 0; i < 8; i++) {
|
||||
TEST_F(OEMCryptoClientTest, MaxSessionsOpenClose) {
|
||||
size_t max_sessions;
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_GetMaxNumberOfSessions(&max_sessions));
|
||||
ASSERT_GT(max_sessions, 0);
|
||||
vector<Session> s(max_sessions);
|
||||
for (int i = 0; i < s.size(); i++) {
|
||||
s[i].open();
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, s[i].getStatus());
|
||||
ASSERT_TRUE(s[i].isOpen());
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int i = 0; i < s.size(); i++) {
|
||||
s[i].close();
|
||||
ASSERT_EQ(OEMCrypto_SUCCESS, s[i].getStatus());
|
||||
ASSERT_FALSE(s[i].isOpen());
|
||||
}
|
||||
}
|
||||
// TODO(kqyang): Add more tests exercising multiple sessions.
|
||||
|
||||
TEST_F(OEMCryptoClientTest, GenerateNonce) {
|
||||
Session s;
|
||||
|
||||
Reference in New Issue
Block a user