OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "third_party/WebKit/public/platform/WebString.h" | 9 #include "third_party/WebKit/public/platform/WebString.h" |
10 #include "webkit/renderer/media/crypto/key_systems.h" | 10 #include "webkit/renderer/media/crypto/key_systems.h" |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( | 746 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
747 "audio/mp4", avc1_codec(), kWidevineAlpha)); | 747 "audio/mp4", avc1_codec(), kWidevineAlpha)); |
748 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( | 748 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
749 "audio/mp4", avc1_and_aac_codecs(), kWidevineAlpha)); | 749 "audio/mp4", avc1_and_aac_codecs(), kWidevineAlpha)); |
750 | 750 |
751 // Non-MP4 codec. | 751 // Non-MP4 codec. |
752 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( | 752 EXPECT_FALSE(IsSupportedKeySystemWithMediaMimeType( |
753 "audio/mp4", vorbis_codec(), kWidevineAlpha)); | 753 "audio/mp4", vorbis_codec(), kWidevineAlpha)); |
754 } | 754 } |
755 | 755 |
| 756 #if defined(OS_ANDROID) |
| 757 TEST_F(KeySystemsTest, GetUUID_Widevine) { |
| 758 std::vector<uint8> uuid = GetUUID(kWidevineAlpha); |
| 759 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 760 EXPECT_EQ(16u, uuid.size()); |
| 761 EXPECT_EQ(0xED, uuid[15]); |
| 762 #else |
| 763 EXPECT_TRUE(uuid.empty()); |
| 764 #endif |
| 765 } |
| 766 |
| 767 TEST_F(KeySystemsTest, GetUUID_Unrecognized) { |
| 768 EXPECT_TRUE(GetUUID(kWidevine).empty()); |
| 769 EXPECT_TRUE(GetUUID(kClearKey).empty()); |
| 770 EXPECT_TRUE(GetUUID("").empty()); |
| 771 } |
| 772 #endif // defined(OS_ANDROID) |
| 773 |
756 } // namespace webkit_media | 774 } // namespace webkit_media |
OLD | NEW |