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

Unified Diff: media/base/key_systems_unittest.cc

Issue 1840173004: Flip unified media pipeline to default-on w/ disabled holdback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Comments. Fix UMA. Created 4 years, 9 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | media/base/media.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | media/base/media.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698