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

Unified Diff: content/browser/media/encrypted_media_browsertest.cc

Issue 27230004: Do not run MSE related tests when MSE is not available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Comments Created 7 years, 2 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
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..60a512f8985c1b9e9da7493327f6396d47aeb0a5 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 "base/android/build_info.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 (base::android::BuildInfo::GetInstance()->sdk_int() < 16) {
+ LOG(INFO) << "Skipping test - MSE only supported in JellyBean and later.";
+ 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,14 @@ class EncryptedMediaTest : public content::MediaBrowserTest,
const char* key_system,
SrcType src_type,
const char* expectation) {
+#if defined(OS_ANDROID)
+ DCHECK_EQ(src_type, MSE) << "EME only works with MSE on Android.";
+ if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) {
+ LOG(INFO) << "Skipping test - MSE only supported in JellyBean and later.";
+ 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 +134,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)));

Powered by Google App Engine
This is Rietveld 408576698