Index: media/base/android/media_drm_bridge_unittest.cc |
diff --git a/media/base/android/media_drm_bridge_unittest.cc b/media/base/android/media_drm_bridge_unittest.cc |
index a838203304a535ab293ce809db9e208dda49a001..49da0657e549cd3cb2cceff15adda7a6b00a6692 100644 |
--- a/media/base/android/media_drm_bridge_unittest.cc |
+++ b/media/base/android/media_drm_bridge_unittest.cc |
@@ -26,6 +26,10 @@ const char kVideoMp4[] = "video/mp4"; |
const char kAudioWebM[] = "audio/webm"; |
const char kVideoWebM[] = "video/webm"; |
const char kInvalidKeySystem[] = "invalid.keysystem"; |
+const char kAcmeKeySystem[] = "com.acme.keysystem"; |
xhwang
2014/05/15 15:10:29
s/acme/foo or example to make it more obvious?
ycheo (away)
2014/05/16 04:53:38
Done.
|
+const uint8 kWidevineUuid[16] = { |
+ 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, |
+ 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED }; |
const MediaDrmBridge::SecurityLevel kLNone = |
MediaDrmBridge::SECURITY_LEVEL_NONE; |
const MediaDrmBridge::SecurityLevel kL1 = MediaDrmBridge::SECURITY_LEVEL_1; |
@@ -93,4 +97,27 @@ TEST(MediaDrmBridgeTest, IsKeySystemSupported_InvalidKeySystem) { |
EXPECT_FALSE(IsKeySystemSupportedWithType(kInvalidKeySystem, "audio/mp3")); |
} |
+TEST(MediaDrmBridgeTest, AddNewKeySystemName) { |
+ EXPECT_FALSE(IsKeySystemSupported(kAcmeKeySystem)); |
+ |
+ MediaDrmBridge::AddKeySystem(kAcmeKeySystem, |
+ // Use WV uuid, because it is the only MediaDrm we can guarentee |
xhwang
2014/05/15 15:10:29
s/uuid/UUID
s/MediaDrm/key system
ycheo (away)
2014/05/16 04:53:38
Done.
|
+ // that it is installed in the target device. |
xhwang
2014/05/15 15:10:29
nit: target/test
ycheo (away)
2014/05/16 04:53:38
Done.
|
+ std::vector<uint8>(kWidevineUuid, |
+ kWidevineUuid + arraysize(kWidevineUuid))); |
+ |
+ EXPECT_TRUE_IF_AVAILABLE(IsKeySystemSupported(kAcmeKeySystem)); |
+ EXPECT_TRUE_IF_AVAILABLE( |
+ IsKeySystemSupportedWithType(kAcmeKeySystem, kVideoMp4)); |
+} |
+ |
+TEST(MediaDrmBridgeTest, ShouldNotOverwriteExistingKeySystem) { |
+ EXPECT_TRUE_IF_AVAILABLE(IsKeySystemSupported(kWidevineKeySystem)); |
+ |
+ // Add WV keysystem again with the invalid uuid. |
+ MediaDrmBridge::AddKeySystem(kWidevineKeySystem, std::vector<uint8>(16, 99)); |
+ |
+ EXPECT_TRUE_IF_AVAILABLE(IsKeySystemSupported(kWidevineKeySystem)); |
+} |
+ |
} // namespace media |