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

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

Issue 2268283003: media: Add External Clear Key content browser test on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 3 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 | « components/cdm/renderer/external_clear_key_key_system_properties.cc ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 332fef625f8e6fbb9287b33534c9c48aedc80a9c..f18a2b853ce32feafa80977ba191b2a62c337676 100644
--- a/content/browser/media/encrypted_media_browsertest.cc
+++ b/content/browser/media/encrypted_media_browsertest.cc
@@ -10,9 +10,11 @@
#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"
#include "media/base/media.h"
+#include "media/base/media_switches.h"
#endif
#if defined(ENABLE_MOJO_RENDERER)
@@ -24,6 +26,10 @@
// Available key systems.
const char kClearKeyKeySystem[] = "org.w3.clearkey";
+#if defined(OS_ANDROID)
+const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey";
+#endif
+
// Supported media types.
const char kWebMVorbisAudioOnly[] = "audio/webm; codecs=\"vorbis\"";
#if !defined(DISABLE_ENCRYPTED_MEDIA_PLAYBACK_TESTS)
@@ -60,7 +66,9 @@ static bool IsMSESupported() {
// Tests encrypted media playback with a combination of parameters:
// - char*: Key system name.
-// - bool: True to load media using MSE, otherwise use src.
+// - SrcType: The type of video src used to load media, MSE or SRC.
+// It is okay to run this test as a non-parameterized test, in this case,
+// GetParam() should not be called.
class EncryptedMediaTest : public content::MediaBrowserTest,
public testing::WithParamInterface<std::tr1::tuple<const char*, SrcType> > {
public:
@@ -142,6 +150,10 @@ class EncryptedMediaTest : public content::MediaBrowserTest,
void SetUpCommandLine(base::CommandLine* command_line) override {
command_line->AppendSwitch(
switches::kDisableGestureRequirementForMediaPlayback);
+#if defined(OS_ANDROID)
+ command_line->AppendSwitchASCII(switches::kEnableFeatures,
+ media::kExternalClearKeyForTesting.name);
+#endif
}
};
@@ -215,4 +227,16 @@ IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) {
kEmeNotSupportedError);
}
+#if defined(OS_ANDROID)
+// On Android, External Clear Key is supported in //content/shell/ by using mojo
+// CDM with AesDecryptor running in the GPU process.
+// On other platforms, External Clear Key is supported in chrome/, so it is
+// tested in browser_tests.
+IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, ExternalClearKeyPlayback) {
+ RunSimpleEncryptedMediaTest("bear-320x240-av_enc-av.webm",
+ kWebMVorbisAudioVP8Video,
+ kExternalClearKeyKeySystem, MSE);
+}
+#endif
+
} // namespace content
« no previous file with comments | « components/cdm/renderer/external_clear_key_key_system_properties.cc ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698