Chromium Code Reviews| 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..e096cf80ee59e340b6e37498393bc0b6ea64e4ba 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()) |
|
ddorwin
2016/03/30 20:16:24
These are just key system registration tests. What
DaleCurtis
2016/03/30 22:40:15
This is due to your change here I think:
https://c
ddorwin
2016/03/30 22:49:38
Thanks. I forgot that code was in KeySystems.
|
| + 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,29 @@ 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()) { |
|
ddorwin
2016/03/30 20:16:24
Use of braces is inconsistent with 690. Pick one?
DaleCurtis
2016/03/31 22:10:33
Done.
|
| + EXPECT_FALSE(IsSupportedKeySystem(kExternal)); |
| + } |
| } |
| TEST_F(KeySystemsPotentiallySupportedNamesTest, PotentiallySupportedNames) { |