| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 expected_title); | 325 expected_title); |
| 326 } | 326 } |
| 327 | 327 |
| 328 protected: | 328 protected: |
| 329 virtual void SetUpCommandLine(CommandLine* command_line) override { | 329 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 330 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 330 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
| 331 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); | 331 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); |
| 332 } | 332 } |
| 333 }; | 333 }; |
| 334 | 334 |
| 335 // Tests encrypted media playback using ExternalClearKey key system in |
| 336 // decrypt-and-decode mode for unprefixed EME. |
| 337 // TODO(jrummell): Merge with ECKEncryptedMediaTest once unprefixed is |
| 338 // enabled by default. |
| 339 class ECKUnprefixedEncryptedMediaTest : public EncryptedMediaTestBase { |
| 340 protected: |
| 341 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 342 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
| 343 command_line->AppendSwitch(switches::kEnableEncryptedMedia); |
| 344 SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line); |
| 345 } |
| 346 }; |
| 347 |
| 335 #if defined(WIDEVINE_CDM_AVAILABLE) | 348 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 336 // Tests encrypted media playback using Widevine key system. | 349 // Tests encrypted media playback using Widevine key system. |
| 337 class WVEncryptedMediaTest : public EncryptedMediaTestBase { | 350 class WVEncryptedMediaTest : public EncryptedMediaTestBase { |
| 338 protected: | 351 protected: |
| 339 virtual void SetUpCommandLine(CommandLine* command_line) override { | 352 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 340 EncryptedMediaTestBase::SetUpCommandLine(command_line); | 353 EncryptedMediaTestBase::SetUpCommandLine(command_line); |
| 341 command_line->AppendSwitch(switches::kEnableEncryptedMedia); | 354 command_line->AppendSwitch(switches::kEnableEncryptedMedia); |
| 342 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); | 355 SetUpCommandLineForKeySystem(kWidevineKeySystem, command_line); |
| 343 } | 356 } |
| 344 }; | 357 }; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 RunEncryptedMediaTest(kDefaultEmePlayer, | 672 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 660 "bear-320x240-v_enc-v.webm", | 673 "bear-320x240-v_enc-v.webm", |
| 661 kWebMVideoOnly, | 674 kWebMVideoOnly, |
| 662 kExternalClearKeyKeySystem, | 675 kExternalClearKeyKeySystem, |
| 663 SRC, | 676 SRC, |
| 664 PREFIXED, | 677 PREFIXED, |
| 665 kUnknownSession, | 678 kUnknownSession, |
| 666 false, | 679 false, |
| 667 kEmeKeyError); | 680 kEmeKeyError); |
| 668 } | 681 } |
| 682 |
| 683 IN_PROC_BROWSER_TEST_F(ECKUnprefixedEncryptedMediaTest, LoadLoadableSession) { |
| 684 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 685 "bear-320x240-v_enc-v.webm", |
| 686 kWebMVideoOnly, |
| 687 kExternalClearKeyKeySystem, |
| 688 SRC, |
| 689 UNPREFIXED, |
| 690 kLoadableSession, |
| 691 false, |
| 692 kEnded); |
| 693 } |
| 694 |
| 695 IN_PROC_BROWSER_TEST_F(ECKUnprefixedEncryptedMediaTest, LoadUnknownSession) { |
| 696 // TODO(xhwang): Add a specific error for this failure, e.g. kSessionNotFound. |
| 697 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 698 "bear-320x240-v_enc-v.webm", |
| 699 kWebMVideoOnly, |
| 700 kExternalClearKeyKeySystem, |
| 701 SRC, |
| 702 UNPREFIXED, |
| 703 kUnknownSession, |
| 704 false, |
| 705 kEmeKeyError); |
| 706 } |
| 669 #endif // defined(ENABLE_PEPPER_CDMS) | 707 #endif // defined(ENABLE_PEPPER_CDMS) |
| OLD | NEW |