| Index: media/base/key_systems_unittest.cc
|
| diff --git a/media/base/key_systems_unittest.cc b/media/base/key_systems_unittest.cc
|
| index 9d33c0691c5552dcaa05b4f0d6c5dc660077a819..44b881939c93424058b09646fdb36c6f94f619a5 100644
|
| --- a/media/base/key_systems_unittest.cc
|
| +++ b/media/base/key_systems_unittest.cc
|
| @@ -16,6 +16,7 @@
|
| #include "media/base/eme_constants.h"
|
| #include "media/base/key_system_info.h"
|
| #include "media/base/key_systems.h"
|
| +#include "media/base/media.h"
|
| #include "media/base/media_client.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| @@ -98,6 +99,18 @@ static void AddContainerAndCodecMasksForTest() {
|
| is_test_masks_added = true;
|
| }
|
|
|
| +static bool CanRunExternalKeySystemTests() {
|
| +#if defined(OS_ANDROID)
|
| + if (HasPlatformDecoderSupport())
|
| + return true;
|
| +
|
| + EXPECT_FALSE(IsSupportedKeySystem(kExternal));
|
| + return false;
|
| +#else
|
| + return true;
|
| +#endif
|
| +}
|
| +
|
| class TestMediaClient : public MediaClient {
|
| public:
|
| TestMediaClient();
|
| @@ -550,6 +563,9 @@ TEST_F(KeySystemsTest,
|
| //
|
|
|
| TEST_F(KeySystemsTest, Basic_ExternalDecryptor) {
|
| + if (!CanRunExternalKeySystemTests())
|
| + return;
|
| +
|
| EXPECT_TRUE(IsSupportedKeySystem(kExternal));
|
| EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
|
| kVideoWebM, no_codecs(), kExternal));
|
| @@ -563,6 +579,9 @@ TEST_F(KeySystemsTest, Basic_ExternalDecryptor) {
|
| TEST_F(
|
| KeySystemsTest,
|
| IsSupportedKeySystemWithMediaMimeType_ExternalDecryptor_TypesContainer1) {
|
| + if (!CanRunExternalKeySystemTests())
|
| + return;
|
| +
|
| // Valid video types.
|
| EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
|
| kVideoWebM, no_codecs(), kExternal));
|
| @@ -615,6 +634,9 @@ TEST_F(
|
| TEST_F(
|
| KeySystemsTest,
|
| IsSupportedKeySystemWithMediaMimeType_ExternalDecryptor_TypesContainer2) {
|
| + if (!CanRunExternalKeySystemTests())
|
| + return;
|
| +
|
| // Valid video types.
|
| EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
|
| kVideoFoo, no_codecs(), kExternal));
|
| @@ -665,23 +687,28 @@ TEST_F(KeySystemsTest, KeySystemNameForUMA) {
|
| EXPECT_EQ("ClearKey", GetKeySystemNameForUMA(kClearKey));
|
|
|
| // External Clear Key never has a UMA name.
|
| - EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kExternalClearKey));
|
| + if (CanRunExternalKeySystemTests())
|
| + EXPECT_EQ("Unknown", GetKeySystemNameForUMA(kExternalClearKey));
|
| }
|
|
|
| TEST_F(KeySystemsTest, KeySystemsUpdate) {
|
| EXPECT_TRUE(IsSupportedKeySystem(kUsesAes));
|
| EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
|
| kVideoWebM, no_codecs(), kUsesAes));
|
| - EXPECT_TRUE(IsSupportedKeySystem(kExternal));
|
| - EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
|
| - kVideoWebM, no_codecs(), kExternal));
|
| +
|
| + if (CanRunExternalKeySystemTests()) {
|
| + EXPECT_TRUE(IsSupportedKeySystem(kExternal));
|
| + EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(kVideoWebM, no_codecs(),
|
| + kExternal));
|
| + }
|
|
|
| UpdateClientKeySystems();
|
|
|
| EXPECT_TRUE(IsSupportedKeySystem(kUsesAes));
|
| EXPECT_TRUE(IsSupportedKeySystemWithMediaMimeType(
|
| kVideoWebM, no_codecs(), kUsesAes));
|
| - EXPECT_FALSE(IsSupportedKeySystem(kExternal));
|
| + if (CanRunExternalKeySystemTests())
|
| + EXPECT_FALSE(IsSupportedKeySystem(kExternal));
|
| }
|
|
|
| TEST_F(KeySystemsPotentiallySupportedNamesTest, PotentiallySupportedNames) {
|
|
|