OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "chrome/browser/media/media_browsertest.h" | 10 #include "chrome/browser/media/media_browsertest.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 protected: | 331 protected: |
332 void SetUpCommandLine(base::CommandLine* command_line) override { | 332 void SetUpCommandLine(base::CommandLine* command_line) override { |
333 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 333 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
334 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); | 334 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); |
335 } | 335 } |
336 }; | 336 }; |
337 | 337 |
338 // Tests encrypted media playback using ExternalClearKey key system in | 338 // Tests encrypted media playback using ExternalClearKey key system in |
339 // decrypt-and-decode mode for unprefixed EME. | 339 // decrypt-and-decode mode for unprefixed EME. |
340 // TODO(jrummell): Merge with ECKEncryptedMediaTest once unprefixed is | 340 // TODO(jrummell): Make ECKEncryptedMediaTest run the unprefixed tests and add |
341 // enabled by default. | 341 // a prefixed class to run the prefixed tests. (Once prefixed is disabled by |
| 342 // default, we will need a subclass to enable it from the command line.) |
342 class ECKUnprefixedEncryptedMediaTest : public EncryptedMediaTestBase { | 343 class ECKUnprefixedEncryptedMediaTest : public EncryptedMediaTestBase { |
343 protected: | 344 protected: |
344 void SetUpCommandLine(base::CommandLine* command_line) override { | 345 void SetUpCommandLine(base::CommandLine* command_line) override { |
345 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 346 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
346 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | |
347 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); | 347 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); |
348 } | 348 } |
349 }; | 349 }; |
350 | 350 |
351 #if defined(WIDEVINE_CDM_AVAILABLE) | 351 #if defined(WIDEVINE_CDM_AVAILABLE) |
352 // Tests encrypted media playback using Widevine key system. | 352 // Tests encrypted media playback using Widevine key system. |
353 class WVEncryptedMediaTest : public EncryptedMediaTestBase { | 353 class WVEncryptedMediaTest : public EncryptedMediaTestBase { |
354 protected: | 354 protected: |
355 void SetUpCommandLine(base::CommandLine* command_line) override { | 355 void SetUpCommandLine(base::CommandLine* command_line) override { |
356 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 356 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
357 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | |
358 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); | 357 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); |
359 } | 358 } |
360 }; | 359 }; |
361 | 360 |
362 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 361 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
363 #endif // defined(ENABLE_PEPPER_CDMS) | 362 #endif // defined(ENABLE_PEPPER_CDMS) |
364 | 363 |
365 // Tests encrypted media playback with a combination of parameters: | 364 // Tests encrypted media playback with a combination of parameters: |
366 // - char*: Key system name. | 365 // - char*: Key system name. |
367 // - bool: True to load media using MSE, otherwise use src. | 366 // - bool: True to load media using MSE, otherwise use src. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 RunEncryptedMediaTestPage("mse_config_change.html", | 429 RunEncryptedMediaTestPage("mse_config_change.html", |
431 CurrentKeySystem(), | 430 CurrentKeySystem(), |
432 query_params, | 431 query_params, |
433 kEnded); | 432 kEnded); |
434 } | 433 } |
435 | 434 |
436 protected: | 435 protected: |
437 void SetUpCommandLine(base::CommandLine* command_line) override { | 436 void SetUpCommandLine(base::CommandLine* command_line) override { |
438 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 437 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
439 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); | 438 SetUpCommandLineForKeySystem(CurrentKeySystem(), command_line); |
440 | |
441 if (CurrentEmeVersion() == UNPREFIXED) | |
442 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | |
443 } | 439 } |
444 }; | 440 }; |
445 | 441 |
446 using ::testing::Combine; | 442 using ::testing::Combine; |
447 using ::testing::Values; | 443 using ::testing::Values; |
448 | 444 |
449 #if !defined(OS_ANDROID) | 445 #if !defined(OS_ANDROID) |
450 INSTANTIATE_TEST_CASE_P(SRC_ClearKey_Prefixed, | 446 INSTANTIATE_TEST_CASE_P(SRC_ClearKey_Prefixed, |
451 EncryptedMediaTest, | 447 EncryptedMediaTest, |
452 Combine(Values(kPrefixedClearKeyKeySystem), | 448 Combine(Values(kPrefixedClearKeyKeySystem), |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 "bear-320x240-v_enc-v.webm", | 711 "bear-320x240-v_enc-v.webm", |
716 kWebMVideoOnly, | 712 kWebMVideoOnly, |
717 kExternalClearKeyKeySystem, | 713 kExternalClearKeyKeySystem, |
718 SRC, | 714 SRC, |
719 UNPREFIXED, | 715 UNPREFIXED, |
720 kUnknownSession, | 716 kUnknownSession, |
721 false, | 717 false, |
722 kEmeKeyError); | 718 kEmeKeyError); |
723 } | 719 } |
724 #endif // defined(ENABLE_PEPPER_CDMS) | 720 #endif // defined(ENABLE_PEPPER_CDMS) |
OLD | NEW |