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

Unified Diff: chrome/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
« no previous file with comments | « no previous file | content/browser/media/encrypted_media_browsertest.cc » ('j') | content/child/DEPS » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/encrypted_media_browsertest.cc
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc
index 850d16c3d42e2523e6dcb03050d405eb3dca8e05..e466daf12eecd201beb5ba80c6434734dc4af3ec 100644
--- a/chrome/browser/media/encrypted_media_browsertest.cc
+++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -11,6 +11,9 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/test/browser_test_utils.h"
+#if defined(OS_ANDROID)
+#include "base/android/build_info.h"
+#endif
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@@ -96,12 +99,25 @@ class EncryptedMediaTest : public 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) {
qinmin 2013/10/16 22:14:34 make this a static boolean function at the top of
xhwang 2013/10/17 00:46:19 Done.
+ LOG(INFO) << "Skipping test - MSE only supported in JellyBean and later.";
ddorwin 2013/10/16 22:51:46 JB is two words. Maybe just say 4.1?
xhwang 2013/10/17 00:46:19 I tried 4.1 but in the context I need to use "Andr
+ return;
+ }
+#endif // defined(OS_ANDROID)
+
#if defined(WIDEVINE_CDM_AVAILABLE)
if (IsWidevine(CurrentKeySystem())) {
LOG(INFO) << "ConfigChange test cannot run with Widevine.";
return;
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)
+
std::vector<StringPair> query_params;
query_params.push_back(std::make_pair("keysystem", CurrentKeySystem()));
query_params.push_back(std::make_pair("runencrypted", "1"));
@@ -114,6 +130,14 @@ class EncryptedMediaTest : public 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));
@@ -226,25 +250,32 @@ class EncryptedMediaTest : public MediaBrowserTest,
#endif // defined(ENABLE_PEPPER_CDMS)
};
-INSTANTIATE_TEST_CASE_P(ClearKey, EncryptedMediaTest,
- ::testing::Combine(
- ::testing::Values(kClearKeyKeySystem), ::testing::Values(SRC, MSE)));
+using Combine;
+using Values;
+
+#if !defined(OS_ANDROID)
+INSTANTIATE_TEST_CASE_P(SRC_ClearKey, EncryptedMediaTest,
+ Combine(Values(kClearKeyKeySystem), Values(SRC)));
+#endif // !defined(OS_ANDROID)
+
+INSTANTIATE_TEST_CASE_P(MSE_ClearKey, EncryptedMediaTest,
+ Combine(Values(kClearKeyKeySystem), Values(MSE)));
// External Clear Key is currently only used on platforms that use Pepper CDMs.
#if defined(ENABLE_PEPPER_CDMS)
-INSTANTIATE_TEST_CASE_P(ExternalClearKey, EncryptedMediaTest,
- ::testing::Combine(
- ::testing::Values(kExternalClearKeyKeySystem),
- ::testing::Values(SRC, MSE)));
+INSTANTIATE_TEST_CASE_P(SRC_ExternalClearKey, EncryptedMediaTest,
+ Combine(Values(kExternalClearKeyKeySystem), Values(SRC)));
+INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKey, EncryptedMediaTest,
+ Combine(Values(kExternalClearKeyKeySystem), Values(MSE)));
+#endif // defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE)
// This test doesn't fully test playback with Widevine. So we only run Widevine
-// test with MSE (no SRC) to reduce test time.
-INSTANTIATE_TEST_CASE_P(Widevine, EncryptedMediaTest,
- ::testing::Combine(
- ::testing::Values(kWidevineKeySystem), ::testing::Values(MSE)));
+// test with MSE (no SRC) to reduce test time. Also, on Android EME only works
+// with MSE and we cannot run this test with SRC.
+INSTANTIATE_TEST_CASE_P(MSE_Widevine, EncryptedMediaTest,
+ Combine(Values(kWidevineKeySystem), Values(MSE)));
#endif // defined(WIDEVINE_CDM_AVAILABLE)
-#endif // defined(ENABLE_PEPPER_CDMS)
IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) {
TestSimplePlayback("bear-a-enc_a.webm", kWebMAudioOnly);
« no previous file with comments | « no previous file | content/browser/media/encrypted_media_browsertest.cc » ('j') | content/child/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698