Chromium Code Reviews| Index: media/base/android/media_source_player_unittest.cc |
| diff --git a/media/base/android/media_source_player_unittest.cc b/media/base/android/media_source_player_unittest.cc |
| index 02ded2d5ff6ee66ce155d2856c90958ca9018d8d..ca2cb04da5d64e60a83204dfb2f14e448b1f0ed0 100644 |
| --- a/media/base/android/media_source_player_unittest.cc |
| +++ b/media/base/android/media_source_player_unittest.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/strings/stringprintf.h" |
| #include "media/base/android/media_codec_bridge.h" |
| +#include "media/base/android/media_drm_bridge.h" |
| #include "media/base/android/media_player_manager.h" |
| #include "media/base/android/media_source_player.h" |
| #include "media/base/decoder_buffer.h" |
| @@ -467,4 +468,53 @@ TEST_F(MediaSourcePlayerTest, NoRequestForDataAfterInputEOS) { |
| EXPECT_EQ(2, manager_->num_requests()); |
| } |
| +TEST_F(MediaSourcePlayerTest, CanPlayType_Widevine) { |
| + if (!MediaCodecBridge::IsAvailable() || !MediaDrmBridge::IsAvailable()) |
| + return; |
| + |
| + uint8 kWidevineUUID[] = { 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, |
| + 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED }; |
| + |
| + std::vector<uint8> widevine_uuid(kWidevineUUID, |
| + kWidevineUUID + arraysize(kWidevineUUID)); |
| + |
| + std::vector<std::string> codecs_avc(1, "video/avc"); |
| + EXPECT_TRUE(MediaSourcePlayer::IsTypeSupported( |
|
ddorwin
2013/08/28 02:28:50
Isn't this currently false for WebM on real system
xhwang
2013/08/28 18:19:15
That check is commented out. I'll enable it, test
|
| + widevine_uuid, "L3", "video/webm", codecs_avc)); |
| + EXPECT_TRUE(MediaSourcePlayer::IsTypeSupported( |
| + widevine_uuid, "L1", "video/webm", codecs_avc)); |
| + |
| + std::vector<std::string> codecs_vp8(1, "video/x-vnd.on2.vp8"); |
| + EXPECT_TRUE(MediaSourcePlayer::IsTypeSupported( |
| + widevine_uuid, "L3", "video/webm", codecs_vp8)); |
| + EXPECT_FALSE(MediaSourcePlayer::IsTypeSupported( |
| + widevine_uuid, "L1", "video/webm", codecs_vp8)); |
| + |
| + std::vector<std::string> codecs_vorbis(1, "audio/vorbis"); |
| + EXPECT_TRUE(MediaSourcePlayer::IsTypeSupported( |
| + widevine_uuid, "L3", "video/webm", codecs_vorbis)); |
| + EXPECT_FALSE(MediaSourcePlayer::IsTypeSupported( |
| + widevine_uuid, "L1", "video/webm", codecs_vorbis)); |
| +} |
| + |
| +TEST_F(MediaSourcePlayerTest, CanPlayType_InvalidUUID) { |
| + if (!MediaCodecBridge::IsAvailable() || !MediaDrmBridge::IsAvailable()) |
| + return; |
| + |
| + uint8 kInvalidUUID[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, |
| + 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }; |
| + |
| + std::vector<uint8> invalid_uuid(kInvalidUUID, |
| + kInvalidUUID + arraysize(kInvalidUUID)); |
| + |
| + std::vector<std::string> codecs_avc(1, "video/avc"); |
| + EXPECT_FALSE(MediaSourcePlayer::IsTypeSupported( |
| + invalid_uuid, "L3", "video/webm", codecs_avc)); |
| + EXPECT_FALSE(MediaSourcePlayer::IsTypeSupported( |
| + invalid_uuid, "L1", "video/webm", codecs_avc)); |
| +} |
| + |
| +TODO(xhwang): Are these IsTypeSupported tests device specific? |
| +TODO(xhwang): Add more IsTypeSupported tests. |
|
ddorwin
2013/08/28 02:28:50
FYI, when my work is done, we'll have chrome brows
xhwang
2013/08/28 18:19:15
I see. SG.
|
| + |
| } // namespace media |