Index: content/renderer/media/crypto/key_systems_unittest.cc |
diff --git a/content/renderer/media/crypto/key_systems_unittest.cc b/content/renderer/media/crypto/key_systems_unittest.cc |
index 5617d270e7773d8660da2dc1be839907631931a6..8d810a07a297cb8b6462422b37dee9b1c817e308 100644 |
--- a/content/renderer/media/crypto/key_systems_unittest.cc |
+++ b/content/renderer/media/crypto/key_systems_unittest.cc |
@@ -208,7 +208,10 @@ TEST_F(KeySystemsTest, ClearKey_Basic) { |
EXPECT_TRUE(CanUseAesDecryptor(kClearKey)); |
#if defined(ENABLE_PEPPER_CDMS) |
- EXPECT_TRUE(GetPepperType(kClearKey).empty()); // Does not use Pepper. |
+ std::string type; |
+ EXPECT_DCHECK_DEATH(type = GetPepperType(kClearKey), |
+ "webkit-org.w3.clearkey is not Pepper-based"); |
+ EXPECT_TRUE(type.empty()); |
#endif |
} |
@@ -224,11 +227,14 @@ TEST_F(KeySystemsTest, ClearKey_Parent) { |
// The parent is not supported for most things. |
EXPECT_STREQ("Unknown", |
KeySystemNameForUMA(WebString::fromUTF8(kClearKeyParent)).c_str()); |
- EXPECT_FALSE(CanUseAesDecryptor(kClearKeyParent)); |
+ bool result = false; |
+ EXPECT_DCHECK_DEATH(result = CanUseAesDecryptor(kClearKeyParent), |
+ "webkit-org.w3 is not a known concrete system"); |
+ EXPECT_FALSE(result); |
#if defined(ENABLE_PEPPER_CDMS) |
std::string type; |
EXPECT_DCHECK_DEATH(type = GetPepperType(kClearKeyParent), |
- "webkit-org.w3 is not a concrete system"); |
+ "webkit-org.w3 is not a known concrete system"); |
EXPECT_TRUE(type.empty()); |
#endif |
} |
@@ -393,10 +399,16 @@ TEST_F(KeySystemsTest, ExternalClearKey_Basic) { |
"Unknown", |
KeySystemNameForUMA(WebString::fromUTF8(kExternalClearKey)).c_str()); |
- EXPECT_FALSE(CanUseAesDecryptor(kExternalClearKey)); |
#if defined(ENABLE_PEPPER_CDMS) |
+ EXPECT_FALSE(CanUseAesDecryptor(kExternalClearKey)); |
EXPECT_STREQ("application/x-ppapi-clearkey-cdm", |
GetPepperType(kExternalClearKey).c_str()); |
+#else |
+ bool result = false; |
+ EXPECT_DCHECK_DEATH( |
+ result = CanUseAesDecryptor(kExternalClearKey), |
+ "org.chromium.externalclearkey is not a known concrete system"); |
+ EXPECT_FALSE(result); |
#endif |
} |
@@ -413,11 +425,14 @@ TEST_F(KeySystemsTest, ExternalClearKey_Parent) { |
EXPECT_STREQ("Unknown", |
KeySystemNameForUMA( |
WebString::fromUTF8(kExternalClearKeyParent)).c_str()); |
- EXPECT_FALSE(CanUseAesDecryptor(kExternalClearKeyParent)); |
+ bool result = false; |
+ EXPECT_DCHECK_DEATH(result = CanUseAesDecryptor(kExternalClearKeyParent), |
+ "org.chromium is not a known concrete system"); |
+ EXPECT_FALSE(result); |
#if defined(ENABLE_PEPPER_CDMS) |
std::string type; |
EXPECT_DCHECK_DEATH(type = GetPepperType(kExternalClearKeyParent), |
- "org.chromium is not a concrete system"); |
+ "org.chromium is not a known concrete system"); |
EXPECT_TRUE(type.empty()); |
#endif |
} |
@@ -594,7 +609,15 @@ TEST_F(KeySystemsTest, Widevine_Basic) { |
kWidevineUmaName, |
KeySystemNameForUMA(WebString::fromUTF8(kWidevineAlpha)).c_str()); |
+#if defined(WIDEVINE_CDM_AVAILABLE) |
EXPECT_FALSE(CanUseAesDecryptor(kWidevineAlpha)); |
+#else |
+ bool result = false; |
+ EXPECT_DCHECK_DEATH(result = CanUseAesDecryptor(kWidevineAlpha), |
+ "com.widevine.alpha is not a known concrete system"); |
+ EXPECT_FALSE(result); |
+#endif // defined(WIDEVINE_CDM_AVAILABLE) |
+ |
#if defined(ENABLE_PEPPER_CDMS) |
#if defined(WIDEVINE_CDM_AVAILABLE) |
EXPECT_STREQ("application/x-ppapi-widevine-cdm", |
@@ -602,7 +625,7 @@ TEST_F(KeySystemsTest, Widevine_Basic) { |
#else |
std::string type; |
EXPECT_DCHECK_DEATH(type = GetPepperType(kWidevineAlpha), |
- "com.widevine.alpha is not a concrete system"); |
+ "com.widevine.alpha is not a known concrete system"); |
EXPECT_TRUE(type.empty()); |
#endif // defined(WIDEVINE_CDM_AVAILABLE) |
#endif // defined(ENABLE_PEPPER_CDMS) |
@@ -618,11 +641,14 @@ TEST_F(KeySystemsTest, Widevine_Parent) { |
// The parent is not supported for most things. |
EXPECT_STREQ("Unknown", |
KeySystemNameForUMA(WebString::fromUTF8(kWidevine)).c_str()); |
- EXPECT_FALSE(CanUseAesDecryptor(kWidevine)); |
+ bool result = false; |
+ EXPECT_DCHECK_DEATH(result = CanUseAesDecryptor(kWidevine), |
+ "com.widevine is not a known concrete system"); |
+ EXPECT_FALSE(result); |
#if defined(ENABLE_PEPPER_CDMS) |
std::string type; |
EXPECT_DCHECK_DEATH(type = GetPepperType(kWidevine), |
- "com.widevine is not a concrete system"); |
+ "com.widevine is not a known concrete system"); |
EXPECT_TRUE(type.empty()); |
#endif |
} |
@@ -803,7 +829,7 @@ TEST_F(KeySystemsTest, GetUUID_Widevine) { |
#else |
std::vector<uint8> uuid; |
EXPECT_DCHECK_DEATH(uuid = GetUUID(kWidevineAlpha), |
- "com.widevine.alpha is not a concrete system"); |
+ "com.widevine.alpha is not a known concrete system"); |
EXPECT_TRUE(uuid.empty()); |
#endif |
} |
@@ -811,7 +837,7 @@ TEST_F(KeySystemsTest, GetUUID_Widevine) { |
TEST_F(KeySystemsTest, GetUUID_Unrecognized) { |
std::vector<uint8> uuid; |
EXPECT_DCHECK_DEATH(uuid = GetUUID(kWidevine), |
- "com.widevine is not a concrete system"); |
+ "com.widevine is not a known concrete system"); |
EXPECT_TRUE(uuid.empty()); |
EXPECT_TRUE(GetUUID(kClearKey).empty()); |