Index: content/browser/media/encrypted_media_browsertest.cc |
diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc |
index 8f30094a88aaec7da5a463ed7b358d24a2a7d55e..71aee046fda85fc93a8da8040783730cbccbabee 100644 |
--- a/content/browser/media/encrypted_media_browsertest.cc |
+++ b/content/browser/media/encrypted_media_browsertest.cc |
@@ -10,6 +10,9 @@ |
#include "content/public/common/content_switches.h" |
#include "content/public/test/browser_test_utils.h" |
#include "content/shell/browser/shell.h" |
+#if defined(OS_ANDROID) |
+#include "media/base/android/media_codec_bridge.h" |
+#endif |
// Available key systems. |
static const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; |
@@ -59,6 +62,18 @@ class EncryptedMediaTest : public content::MediaBrowserTest, |
} |
void TestConfigChange() { |
+ if (CurrentSourceType() != MSE) { |
+ LOG(INFO) << "Skipping test - config change only applies to MSE."; |
+ return; |
+ } |
+ |
+#if defined(OS_ANDROID) |
+ if (!media::MediaCodecBridge::IsAvailable()) { |
+ LOG(INFO) << "Could not run test - MSE not supported."; |
+ return; |
+ } |
+#endif // defined(OS_ANDROID) |
+ |
std::vector<StringPair> query_params; |
query_params.push_back(std::make_pair("keysystem", CurrentKeySystem())); |
query_params.push_back(std::make_pair("runencrypted", "1")); |
@@ -71,6 +86,13 @@ class EncryptedMediaTest : public content::MediaBrowserTest, |
const char* key_system, |
SrcType src_type, |
const char* expectation) { |
+#if defined(OS_ANDROID) |
+ if (src_type == MSE && !media::MediaCodecBridge::IsAvailable()) { |
+ LOG(INFO) << "Could not run test - MSE not supported."; |
+ return; |
+ } |
+#endif // defined(OS_ANDROID) |
+ |
std::vector<StringPair> query_params; |
query_params.push_back(std::make_pair("mediafile", media_file)); |
query_params.push_back(std::make_pair("mediatype", media_type)); |
@@ -111,7 +133,7 @@ using ::testing::Values; |
// Encrypted media playback with SRC is not supported on Android. |
INSTANTIATE_TEST_CASE_P(SRC_ClearKey, EncryptedMediaTest, |
Combine(Values(kClearKeyKeySystem), Values(SRC))); |
-#endif // defined(OS_ANDROID) |
+#endif // !defined(OS_ANDROID) |
INSTANTIATE_TEST_CASE_P(MSE_ClearKey, EncryptedMediaTest, |
Combine(Values(kClearKeyKeySystem), Values(MSE))); |