Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: media/base/android/media_drm_bridge_unittest.cc

Issue 284183003: Add MediaDrmBridge::AddKeySystemUuidMapping(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« media/base/android/media_drm_bridge.cc ('K') | « media/base/android/media_drm_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698