Chromium Code Reviews| 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 bf91942e96ddca25fcd7c1519a589dc940cfce94..068f63075920e6349b11abccb9898c2e7642aa0d 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 shell/ by using mojo CDM |
|
Peter Beverloo
2016/09/22 11:55:23
nit: consider using //content/shell/ instead of ju
xhwang
2016/09/22 16:54:58
Good to know. Done.
|
| +// 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 |