1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h"
7 #include "base/path_service.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/windows_version.h"
10 #include "chrome/browser/media/media_browsertest.h"
11 #include "chrome/browser/media/test_license_server.h"
12 #include "chrome/browser/media/wv_test_license_server_config.h"
13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
15 #include "chrome/common/chrome_switches.h"
16 #include "content/public/test/browser_test_utils.h"
17 #include "testing/gtest/include/gtest/gtest-spi.h"
18 #if defined(OS_ANDROID)
19 #include "base/android/build_info.h"
22 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
24 #if defined(ENABLE_PEPPER_CDMS)
25 // Platform-specific filename relative to the chrome executable.
26 const char kClearKeyCdmAdapterFileName
[] =
27 #if defined(OS_MACOSX)
28 "clearkeycdmadapter.plugin";
30 "clearkeycdmadapter.dll";
31 #elif defined(OS_POSIX)
32 "libclearkeycdmadapter.so";
35 const char kClearKeyCdmPluginMimeType
[] = "application/x-ppapi-clearkey-cdm";
36 #endif // defined(ENABLE_PEPPER_CDMS)
38 // Available key systems.
39 const char kClearKeyKeySystem
[] = "org.w3.clearkey";
40 const char kPrefixedClearKeyKeySystem
[] = "webkit-org.w3.clearkey";
41 const char kExternalClearKeyKeySystem
[] = "org.chromium.externalclearkey";
42 const char kExternalClearKeyDecryptOnlyKeySystem
[] =
43 "org.chromium.externalclearkey.decryptonly";
44 const char kExternalClearKeyFileIOTestKeySystem
[] =
45 "org.chromium.externalclearkey.fileiotest";
46 const char kExternalClearKeyInitializeFailKeySystem
[] =
47 "org.chromium.externalclearkey.initializefail";
48 const char kExternalClearKeyCrashKeySystem
[] =
49 "org.chromium.externalclearkey.crash";
51 // Supported media types.
52 const char kWebMAudioOnly
[] = "audio/webm; codecs=\"vorbis\"";
53 const char kWebMVideoOnly
[] = "video/webm; codecs=\"vp8\"";
54 const char kWebMVP9VideoOnly
[] = "video/webm; codecs=\"vp9\"";
55 const char kWebMAudioVideo
[] = "video/webm; codecs=\"vorbis, vp8\"";
56 #if defined(USE_PROPRIETARY_CODECS)
57 const char kMP4AudioOnly
[] = "audio/mp4; codecs=\"mp4a.40.2\"";
58 const char kMP4VideoOnly
[] = "video/mp4; codecs=\"avc1.4D4041\"";
59 #endif // defined(USE_PROPRIETARY_CODECS)
62 const char kNoSessionToLoad
[] = "";
63 const char kLoadableSession
[] = "LoadableSession";
64 const char kUnknownSession
[] = "UnknownSession";
66 // EME-specific test results and errors.
67 const char kEmeKeyError
[] = "KEY_ERROR";
68 const char kEmeNotSupportedError
[] = "NOTSUPPORTEDERROR";
69 const char kFileIOTestSuccess
[] = "FILE_IO_TEST_SUCCESS";
71 const char kDefaultEmePlayer
[] = "eme_player.html";
73 // The type of video src used to load media.
79 // Whether to use prefixed or unprefixed EME.
85 // MSE is available on all desktop platforms and on Android 4.1 and later.
86 static bool IsMSESupported() {
87 #if defined(OS_ANDROID)
88 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) {
89 VLOG(0) << "MSE is only supported in Android 4.1 and later.";
92 #endif // defined(OS_ANDROID)
96 static bool IsParentKeySystemOf(const std::string
& parent_key_system
,
97 const std::string
& key_system
) {
98 std::string prefix
= parent_key_system
+ '.';
99 return key_system
.substr(0, prefix
.size()) == prefix
;
102 // Base class for encrypted media tests.
103 class EncryptedMediaTestBase
: public MediaBrowserTest
{
105 EncryptedMediaTestBase() : is_pepper_cdm_registered_(false) {}
107 bool IsExternalClearKey(const std::string
& key_system
) {
108 return key_system
== kExternalClearKeyKeySystem
||
109 IsParentKeySystemOf(kExternalClearKeyKeySystem
, key_system
);
112 #if defined(WIDEVINE_CDM_AVAILABLE)
113 bool IsWidevine(const std::string
& key_system
) {
114 return key_system
== kWidevineKeySystem
;
116 #endif // defined(WIDEVINE_CDM_AVAILABLE)
118 void RunEncryptedMediaTestPage(
119 const std::string
& html_page
,
120 const std::string
& key_system
,
121 base::StringPairs
& query_params
,
122 const std::string
& expected_title
) {
123 base::StringPairs new_query_params
= query_params
;
124 StartLicenseServerIfNeeded(key_system
, &new_query_params
);
125 RunMediaTestPage(html_page
, new_query_params
, expected_title
, true);
128 // Tests |html_page| using |media_file| (with |media_type|) and |key_system|.
129 // When |session_to_load| is not empty, the test will try to load
130 // |session_to_load| with stored keys, instead of creating a new session
131 // and trying to update it with licenses.
132 // When |force_invalid_response| is true, the test will provide invalid
133 // responses, which should trigger errors.
134 // TODO(xhwang): Find an easier way to pass multiple configuration test
136 void RunEncryptedMediaTest(const std::string
& html_page
,
137 const std::string
& media_file
,
138 const std::string
& media_type
,
139 const std::string
& key_system
,
141 EmeVersion eme_version
,
142 const std::string
& session_to_load
,
143 bool force_invalid_response
,
144 const std::string
& expected_title
) {
145 if (src_type
== MSE
&& !IsMSESupported()) {
146 VLOG(0) << "Skipping test - MSE not supported.";
149 base::StringPairs query_params
;
150 query_params
.push_back(std::make_pair("mediaFile", media_file
));
151 query_params
.push_back(std::make_pair("mediaType", media_type
));
152 query_params
.push_back(std::make_pair("keySystem", key_system
));
154 query_params
.push_back(std::make_pair("useMSE", "1"));
155 if (eme_version
== PREFIXED
)
156 query_params
.push_back(std::make_pair("usePrefixedEME", "1"));
157 if (force_invalid_response
)
158 query_params
.push_back(std::make_pair("forceInvalidResponse", "1"));
159 if (!session_to_load
.empty())
160 query_params
.push_back(std::make_pair("sessionToLoad", session_to_load
));
161 RunEncryptedMediaTestPage(html_page
, key_system
, query_params
,
165 void RunSimpleEncryptedMediaTest(const std::string
& media_file
,
166 const std::string
& media_type
,
167 const std::string
& key_system
,
169 EmeVersion eme_version
) {
170 std::string expected_title
= kEnded
;
171 if (!IsPlayBackPossible(key_system
))
172 expected_title
= kEmeKeyError
;
174 RunEncryptedMediaTest(kDefaultEmePlayer
,
183 // Check KeyMessage received for all key systems.
184 bool receivedKeyMessage
= false;
185 EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
186 browser()->tab_strip_model()->GetActiveWebContents(),
187 "window.domAutomationController.send("
188 "document.querySelector('video').receivedKeyMessage);",
189 &receivedKeyMessage
));
190 EXPECT_TRUE(receivedKeyMessage
);
193 // Starts a license server if available for the |key_system| and adds a
194 // 'licenseServerURL' query parameter to |query_params|.
195 void StartLicenseServerIfNeeded(const std::string
& key_system
,
196 base::StringPairs
* query_params
) {
197 scoped_ptr
<TestLicenseServerConfig
> config
= GetServerConfig(key_system
);
200 license_server_
.reset(new TestLicenseServer(config
.Pass()));
201 EXPECT_TRUE(license_server_
->Start());
202 query_params
->push_back(
203 std::make_pair("licenseServerURL", license_server_
->GetServerURL()));
206 bool IsPlayBackPossible(const std::string
& key_system
) {
207 #if defined(WIDEVINE_CDM_AVAILABLE)
208 if (IsWidevine(key_system
) && !GetServerConfig(key_system
))
210 #endif // defined(WIDEVINE_CDM_AVAILABLE)
214 scoped_ptr
<TestLicenseServerConfig
> GetServerConfig(
215 const std::string
& key_system
) {
216 #if defined(WIDEVINE_CDM_AVAILABLE)
217 if (IsWidevine(key_system
)) {
218 scoped_ptr
<TestLicenseServerConfig
> config
=
219 scoped_ptr
<TestLicenseServerConfig
>(new WVTestLicenseServerConfig());
220 if (config
->IsPlatformSupported())
221 return config
.Pass();
223 #endif // defined(WIDEVINE_CDM_AVAILABLE)
224 return scoped_ptr
<TestLicenseServerConfig
>();
228 scoped_ptr
<TestLicenseServer
> license_server_
;
230 // We want to fail quickly when a test fails because an error is encountered.
231 virtual void AddWaitForTitles(content::TitleWatcher
* title_watcher
) override
{
232 MediaBrowserTest::AddWaitForTitles(title_watcher
);
233 title_watcher
->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError
));
234 title_watcher
->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeKeyError
));
237 virtual void SetUpCommandLine(CommandLine
* command_line
) override
{
238 #if defined(OS_ANDROID)
239 command_line
->AppendSwitch(
240 switches::kDisableGestureRequirementForMediaPlayback
);
241 #endif // defined(OS_ANDROID)
244 void SetUpCommandLineForKeySystem(const std::string
& key_system
,
245 CommandLine
* command_line
) {
246 if (GetServerConfig(key_system
))
247 // Since the web and license servers listen on different ports, we need to
248 // disable web-security to send license requests to the license server.
249 // TODO(shadi): Add port forwarding to the test web server configuration.
250 command_line
->AppendSwitch(switches::kDisableWebSecurity
);
252 #if defined(ENABLE_PEPPER_CDMS)
253 if (IsExternalClearKey(key_system
)) {
254 RegisterPepperCdm(command_line
, kClearKeyCdmAdapterFileName
, key_system
);
256 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
257 else if (IsWidevine(key_system
)) {
258 RegisterPepperCdm(command_line
, kWidevineCdmAdapterFileName
, key_system
);
260 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT)
261 #endif // defined(ENABLE_PEPPER_CDMS)
265 #if defined(ENABLE_PEPPER_CDMS)
266 void RegisterPepperCdm(CommandLine
* command_line
,
267 const std::string
& adapter_name
,
268 const std::string
& key_system
) {
269 DCHECK(!is_pepper_cdm_registered_
)
270 << "RegisterPepperCdm() can only be called once.";
271 is_pepper_cdm_registered_
= true;
273 // Append the switch to register the Clear Key CDM Adapter.
274 base::FilePath plugin_dir
;
275 EXPECT_TRUE(PathService::Get(base::DIR_MODULE
, &plugin_dir
));
276 base::FilePath plugin_lib
= plugin_dir
.AppendASCII(adapter_name
);
277 EXPECT_TRUE(base::PathExists(plugin_lib
)) << plugin_lib
.value();
278 base::FilePath::StringType pepper_plugin
= plugin_lib
.value();
279 pepper_plugin
.append(FILE_PATH_LITERAL("#CDM#0.1.0.0;"));
281 pepper_plugin
.append(base::ASCIIToWide(GetPepperType(key_system
)));
283 pepper_plugin
.append(GetPepperType(key_system
));
285 command_line
->AppendSwitchNative(switches::kRegisterPepperPlugins
,
289 // Adapted from key_systems.cc.
290 std::string
GetPepperType(const std::string
& key_system
) {
291 if (IsExternalClearKey(key_system
))
292 return kClearKeyCdmPluginMimeType
;
293 #if defined(WIDEVINE_CDM_AVAILABLE)
294 if (IsWidevine(key_system
))
295 return kWidevineCdmPluginMimeType
;
296 #endif // WIDEVINE_CDM_AVAILABLE
301 #endif // defined(ENABLE_PEPPER_CDMS)
303 bool is_pepper_cdm_registered_
;
306 #if defined(ENABLE_PEPPER_CDMS)
307 // Tests encrypted media playback using ExternalClearKey key system in
308 // decrypt-and-decode mode.
309 class ECKEncryptedMediaTest
: public EncryptedMediaTestBase
{
311 // We use special |key_system| names to do non-playback related tests, e.g.
312 // kExternalClearKeyFileIOTestKeySystem is used to test file IO.
313 void TestNonPlaybackCases(const std::string
& key_system
,
314 const std::string
& expected_title
) {
315 // Since we do not test playback, arbitrarily choose a test file and source
317 RunEncryptedMediaTest(kDefaultEmePlayer
,
329 virtual void SetUpCommandLine(CommandLine
* command_line
) override
{
330 EncryptedMediaTestBase::SetUpCommandLine(command_line
);
331 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem
, command_line
);
335 #if defined(WIDEVINE_CDM_AVAILABLE)
336 // Tests encrypted media playback using Widevine key system.
337 class WVEncryptedMediaTest
: public EncryptedMediaTestBase
{
339 virtual void SetUpCommandLine(CommandLine
* command_line
) override
{
340 EncryptedMediaTestBase::SetUpCommandLine(command_line
);
341 command_line
->AppendSwitch(switches::kEnableEncryptedMedia
);
342 SetUpCommandLineForKeySystem(kWidevineKeySystem
, command_line
);
346 #endif // defined(WIDEVINE_CDM_AVAILABLE)
347 #endif // defined(ENABLE_PEPPER_CDMS)
349 // Tests encrypted media playback with a combination of parameters:
350 // - char*: Key system name.
351 // - bool: True to load media using MSE, otherwise use src.
352 // - bool: True to use unprefixed EME, otherwise use prefixed EME.
354 // Note: Only parameterized (*_P) tests can be used. Non-parameterized (*_F)
355 // tests will crash at GetParam(). To add non-parameterized tests, use
356 // EncryptedMediaTestBase or one of its subclasses (e.g. WVEncryptedMediaTest).
357 class EncryptedMediaTest
358 : public EncryptedMediaTestBase
,
359 public testing::WithParamInterface
<
360 std::tr1::tuple
<const char*, SrcType
, EmeVersion
> > {
362 std::string
CurrentKeySystem() {
363 return std::tr1::get
<0>(GetParam());
366 SrcType
CurrentSourceType() {
367 return std::tr1::get
<1>(GetParam());
370 EmeVersion
CurrentEmeVersion() {
371 return std::tr1::get
<2>(GetParam());
374 void TestSimplePlayback(const std::string
& encrypted_media
,
375 const std::string
& media_type
) {
376 RunSimpleEncryptedMediaTest(encrypted_media
,
380 CurrentEmeVersion());
383 void RunInvalidResponseTest() {
384 RunEncryptedMediaTest(kDefaultEmePlayer
,
385 "bear-320x240-av_enc-av.webm",
395 void TestFrameSizeChange() {
396 RunEncryptedMediaTest("encrypted_frame_size_change.html",
397 "frame_size_change-av_enc-v.webm",
407 void TestConfigChange() {
408 DCHECK(IsMSESupported());
409 base::StringPairs query_params
;
410 query_params
.push_back(std::make_pair("keySystem", CurrentKeySystem()));
411 query_params
.push_back(std::make_pair("runEncrypted", "1"));
412 if (CurrentEmeVersion() == PREFIXED
)
413 query_params
.push_back(std::make_pair("usePrefixedEME", "1"));
414 RunEncryptedMediaTestPage("mse_config_change.html",
421 virtual void SetUpCommandLine(CommandLine
* command_line
) override
{
422 EncryptedMediaTestBase::SetUpCommandLine(command_line
);
423 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line
);
425 if (CurrentEmeVersion() == UNPREFIXED
)
426 command_line
->AppendSwitch(switches::kEnableEncryptedMedia
);
430 using ::testing::Combine
;
431 using ::testing::Values
;
433 #if !defined(OS_ANDROID)
434 INSTANTIATE_TEST_CASE_P(SRC_ClearKey_Prefixed
,
436 Combine(Values(kPrefixedClearKeyKeySystem
),
440 // TODO(jrummell): Enable unprefixed tests before shipping unprefixed EME.
441 // Disabled now as they don't provide much additional coverage, but do take a
442 // bit of time to execute.
443 INSTANTIATE_TEST_CASE_P(DISABLED_SRC_ClearKey
,
445 Combine(Values(kClearKeyKeySystem
),
447 Values(UNPREFIXED
)));
448 #endif // !defined(OS_ANDROID)
450 INSTANTIATE_TEST_CASE_P(MSE_ClearKey_Prefixed
,
452 Combine(Values(kPrefixedClearKeyKeySystem
),
455 // http://crbug.com/402766
456 INSTANTIATE_TEST_CASE_P(DISABLED_MSE_ClearKey
,
458 Combine(Values(kClearKeyKeySystem
),
460 Values(UNPREFIXED
)));
462 // External Clear Key is currently only used on platforms that use Pepper CDMs.
463 #if defined(ENABLE_PEPPER_CDMS)
464 INSTANTIATE_TEST_CASE_P(SRC_ExternalClearKey_Prefixed
,
466 Combine(Values(kExternalClearKeyKeySystem
),
469 INSTANTIATE_TEST_CASE_P(SRC_ExternalClearKey
,
471 Combine(Values(kExternalClearKeyKeySystem
),
473 Values(UNPREFIXED
)));
474 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKey_Prefixed
,
476 Combine(Values(kExternalClearKeyKeySystem
),
479 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKey
,
481 Combine(Values(kExternalClearKeyKeySystem
),
483 Values(UNPREFIXED
)));
484 // To reduce test time, only run ExternalClearKeyDecryptOnly with MSE.
485 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly_Prefixed
,
487 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem
),
490 INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly
,
492 Combine(Values(kExternalClearKeyDecryptOnlyKeySystem
),
494 Values(UNPREFIXED
)));
495 #endif // defined(ENABLE_PEPPER_CDMS)
497 #if defined(WIDEVINE_CDM_AVAILABLE)
498 // This test doesn't fully test playback with Widevine. So we only run Widevine
499 // test with MSE (no SRC) to reduce test time. Also, on Android EME only works
500 // with MSE and we cannot run this test with SRC.
501 INSTANTIATE_TEST_CASE_P(MSE_Widevine_Prefixed
,
503 Combine(Values(kWidevineKeySystem
),
507 // Following tests fail if Widevine is loaded as a component, crbug.com/356833.
508 #if !defined(WIDEVINE_CDM_IS_COMPONENT)
509 INSTANTIATE_TEST_CASE_P(MSE_Widevine
,
511 Combine(Values(kWidevineKeySystem
),
513 Values(UNPREFIXED
)));
514 #endif // !defined(WIDEVINE_CDM_IS_COMPONENT)
515 #endif // defined(WIDEVINE_CDM_AVAILABLE)
517 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_AudioOnly_WebM
) {
518 TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly
);
521 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_AudioClearVideo_WebM
) {
522 TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo
);
525 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_VideoAudio_WebM
) {
526 TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMAudioVideo
);
529 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_VideoOnly_WebM
) {
530 TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVideoOnly
);
533 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_VideoClearAudio_WebM
) {
534 TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMAudioVideo
);
537 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_VP9Video_WebM
) {
538 TestSimplePlayback("bear-320x240-v-vp9_enc-v.webm", kWebMVP9VideoOnly
);
541 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, InvalidResponseKeyError
) {
542 RunInvalidResponseTest();
545 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, ConfigChangeVideo
) {
546 if (CurrentSourceType() != MSE
|| !IsMSESupported()) {
547 VLOG(0) << "Skipping test - ConfigChange test requires MSE.";
550 if (!IsPlayBackPossible(CurrentKeySystem())) {
551 VLOG(0) << "Skipping test - ConfigChange test requires video playback.";
557 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, FrameSizeChangeVideo
) {
558 // Times out on Windows XP. http://crbug.com/171937
560 if (base::win::GetVersion() < base::win::VERSION_VISTA
)
563 if (!IsPlayBackPossible(CurrentKeySystem())) {
564 VLOG(0) << "Skipping test - FrameSizeChange test requires video playback.";
567 TestFrameSizeChange();
570 #if defined(USE_PROPRIETARY_CODECS)
571 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_VideoOnly_MP4
) {
572 // MP4 without MSE is not support yet, http://crbug.com/170793.
573 if (CurrentSourceType() != MSE
) {
574 VLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE.";
577 TestSimplePlayback("bear-640x360-v_frag-cenc.mp4", kMP4VideoOnly
);
580 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest
, Playback_AudioOnly_MP4
) {
581 // MP4 without MSE is not support yet, http://crbug.com/170793.
582 if (CurrentSourceType() != MSE
) {
583 VLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE.";
586 TestSimplePlayback("bear-640x360-a_frag-cenc.mp4", kMP4AudioOnly
);
588 #endif // defined(USE_PROPRIETARY_CODECS)
590 #if defined(WIDEVINE_CDM_AVAILABLE)
591 // The parent key system cannot be used in generateKeyRequest.
592 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest
, ParentThrowsException_Prefixed
) {
593 RunEncryptedMediaTest(kDefaultEmePlayer
,
601 kEmeNotSupportedError
);
604 // TODO(jrummell): http://crbug.com/349181
605 // The parent key system cannot be used when creating MediaKeys.
606 IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest
, ParentThrowsException
) {
607 RunEncryptedMediaTest(kDefaultEmePlayer
,
615 kEmeNotSupportedError
);
617 #endif // defined(WIDEVINE_CDM_AVAILABLE)
619 #if defined(ENABLE_PEPPER_CDMS)
620 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest
, InitializeCDMFail
) {
621 TestNonPlaybackCases(kExternalClearKeyInitializeFailKeySystem
, kEmeKeyError
);
624 // When CDM crashes, we should still get a decode error.
626 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest
, DISABLED_CDMCrashDuringDecode
) {
628 TestNonPlaybackCases(kExternalClearKeyCrashKeySystem
, kError
);
631 // Testing that the media browser test does fail on plugin crash.
633 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest
, DISABLED_CDMExpectedCrash
) {
634 // Plugin crash is not ignored by default, the test is expected to fail.
635 EXPECT_NONFATAL_FAILURE(
636 TestNonPlaybackCases(kExternalClearKeyCrashKeySystem
, kError
),
640 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest
, FileIOTest
) {
641 TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem
,
645 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest
, LoadLoadableSession
) {
646 RunEncryptedMediaTest(kDefaultEmePlayer
,
647 "bear-320x240-v_enc-v.webm",
649 kExternalClearKeyKeySystem
,
657 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest
, LoadUnknownSession
) {
658 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound.
659 RunEncryptedMediaTest(kDefaultEmePlayer
,
660 "bear-320x240-v_enc-v.webm",
662 kExternalClearKeyKeySystem
,
669 #endif // defined(ENABLE_PEPPER_CDMS)