| Index: chrome/browser/media/encrypted_media_browsertest.cc
|
| diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc
|
| index 738b6d85088225c80aedb3141f040068a0b8dd9a..b0db3a0af93562f8db7caa43cac6d724748b6778 100644
|
| --- a/chrome/browser/media/encrypted_media_browsertest.cc
|
| +++ b/chrome/browser/media/encrypted_media_browsertest.cc
|
| @@ -41,7 +41,6 @@ const char kClearKeyCdmPluginMimeType[] = "application/x-ppapi-clearkey-cdm";
|
|
|
| // Available key systems.
|
| const char kClearKeyKeySystem[] = "org.w3.clearkey";
|
| -const char kPrefixedClearKeyKeySystem[] = "webkit-org.w3.clearkey";
|
| const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey";
|
| const char kExternalClearKeyFileIOTestKeySystem[] =
|
| "org.chromium.externalclearkey.fileiotest";
|
| @@ -74,9 +73,6 @@ const char kEmeLoadFailed[] = "EME_LOAD_FAILED";
|
| const char kEmeUpdateFailed[] = "EME_UPDATE_FAILED";
|
| const char kEmeErrorEvent[] = "EME_ERROR_EVENT";
|
| const char kEmeMessageUnexpectedType[] = "EME_MESSAGE_UNEXPECTED_TYPE";
|
| -const char kPrefixedEmeRenewalMissingHeader[] =
|
| - "PREFIXED_EME_RENEWAL_MISSING_HEADER";
|
| -const char kPrefixedEmeErrorEvent[] = "PREFIXED_EME_ERROR_EVENT";
|
|
|
| const char kDefaultEmePlayer[] = "eme_player.html";
|
|
|
| @@ -86,6 +82,8 @@ enum SrcType {
|
| MSE
|
| };
|
|
|
| +// TODO(ddorwin): Remove this from the tests as well as PREFIXED_EME_ERROR_EVENT
|
| +// and PREFIXED_EME_RENEWAL_MISSING_HEADER from the tests.
|
| // Whether to use prefixed or unprefixed EME.
|
| enum EmeVersion {
|
| PREFIXED,
|
| @@ -193,9 +191,7 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
|
| EmeVersion eme_version) {
|
| std::string expected_title = kEnded;
|
| if (!IsPlayBackPossible(key_system)) {
|
| - expected_title = (eme_version == EmeVersion::UNPREFIXED)
|
| - ? kEmeUpdateFailed
|
| - : kPrefixedEmeErrorEvent;
|
| + expected_title = kEmeUpdateFailed;
|
| }
|
|
|
| RunEncryptedMediaTest(kDefaultEmePlayer, media_file, media_type, key_system,
|
| @@ -259,16 +255,11 @@ class EncryptedMediaTestBase : public MediaBrowserTest {
|
| title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeErrorEvent));
|
| title_watcher->AlsoWaitForTitle(
|
| base::ASCIIToUTF16(kEmeMessageUnexpectedType));
|
| - title_watcher->AlsoWaitForTitle(
|
| - base::ASCIIToUTF16(kPrefixedEmeRenewalMissingHeader));
|
| - title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kPrefixedEmeErrorEvent));
|
| }
|
|
|
| void SetUpCommandLine(base::CommandLine* command_line) override {
|
| command_line->AppendSwitch(
|
| switches::kDisableGestureRequirementForMediaPlayback);
|
| - // For simplicity with respect to parameterized tests, enable for all tests.
|
| - command_line->AppendSwitch(switches::kEnablePrefixedEncryptedMedia);
|
| }
|
|
|
| void SetUpCommandLineForKeySystem(const std::string& key_system,
|
| @@ -364,36 +355,6 @@ class ECKEncryptedMediaTest : public EncryptedMediaTestBase {
|
| }
|
| };
|
|
|
| -// Tests encrypted media playback using ExternalClearKey key system in
|
| -// decrypt-and-decode mode for prefixed EME.
|
| -class ECKPrefixedEncryptedMediaTest : public EncryptedMediaTestBase {
|
| - public:
|
| - // We use special |key_system| names to do non-playback related tests, e.g.
|
| - // kExternalClearKeyFileIOTestKeySystem is used to test file IO.
|
| - void TestNonPlaybackCases(const std::string& key_system,
|
| - const std::string& expected_title) {
|
| - // Since we do not test playback, arbitrarily choose a test file and source
|
| - // type.
|
| - RunEncryptedMediaTest(
|
| - kDefaultEmePlayer, "bear-a_enc-a.webm", kWebMAudioOnly, key_system, SRC,
|
| - PREFIXED, kNoSessionToLoad, false, PlayTwice::NO, expected_title);
|
| - }
|
| -
|
| - void TestPlaybackCase(const std::string& session_to_load,
|
| - const std::string& expected_title) {
|
| - RunEncryptedMediaTest(kDefaultEmePlayer, "bear-320x240-v_enc-v.webm",
|
| - kWebMVideoOnly, kExternalClearKeyKeySystem, SRC,
|
| - PREFIXED, session_to_load, false, PlayTwice::NO,
|
| - expected_title);
|
| - }
|
| -
|
| - protected:
|
| - void SetUpCommandLine(base::CommandLine* command_line) override {
|
| - EncryptedMediaTestBase::SetUpCommandLine(command_line);
|
| - SetUpCommandLineForKeySystem(kExternalClearKeyKeySystem, command_line);
|
| - }
|
| -};
|
| -
|
| #if defined(WIDEVINE_CDM_AVAILABLE)
|
| // Tests encrypted media playback using Widevine key system.
|
| class WVEncryptedMediaTest : public EncryptedMediaTestBase {
|
| @@ -451,14 +412,10 @@ class EncryptedMediaTest
|
| }
|
|
|
| void RunInvalidResponseTest() {
|
| - std::string expected_response =
|
| - (CurrentEmeVersion() == EmeVersion::UNPREFIXED)
|
| - ? kEmeUpdateFailed
|
| - : kPrefixedEmeErrorEvent;
|
| RunEncryptedMediaTest(
|
| kDefaultEmePlayer, "bear-320x240-av_enc-av.webm", kWebMAudioVideo,
|
| CurrentKeySystem(), CurrentSourceType(), CurrentEmeVersion(),
|
| - kNoSessionToLoad, true, PlayTwice::NO, expected_response);
|
| + kNoSessionToLoad, true, PlayTwice::NO, kEmeUpdateFailed);
|
| }
|
|
|
| void TestFrameSizeChange() {
|
| @@ -522,12 +479,6 @@ using ::testing::Combine;
|
| using ::testing::Values;
|
|
|
| #if !defined(OS_ANDROID)
|
| -INSTANTIATE_TEST_CASE_P(SRC_ClearKey_Prefixed,
|
| - EncryptedMediaTest,
|
| - Combine(Values(kPrefixedClearKeyKeySystem),
|
| - Values(SRC),
|
| - Values(PREFIXED)));
|
| -
|
| INSTANTIATE_TEST_CASE_P(SRC_ClearKey,
|
| EncryptedMediaTest,
|
| Combine(Values(kClearKeyKeySystem),
|
| @@ -535,11 +486,6 @@ INSTANTIATE_TEST_CASE_P(SRC_ClearKey,
|
| Values(UNPREFIXED)));
|
| #endif // !defined(OS_ANDROID)
|
|
|
| -INSTANTIATE_TEST_CASE_P(MSE_ClearKey_Prefixed,
|
| - EncryptedMediaTest,
|
| - Combine(Values(kPrefixedClearKeyKeySystem),
|
| - Values(MSE),
|
| - Values(PREFIXED)));
|
| INSTANTIATE_TEST_CASE_P(MSE_ClearKey,
|
| EncryptedMediaTest,
|
| Combine(Values(kClearKeyKeySystem),
|
| @@ -548,22 +494,12 @@ INSTANTIATE_TEST_CASE_P(MSE_ClearKey,
|
|
|
| // External Clear Key is currently only used on platforms that use Pepper CDMs.
|
| #if defined(ENABLE_PEPPER_CDMS)
|
| -INSTANTIATE_TEST_CASE_P(SRC_ExternalClearKey_Prefixed,
|
| - EncryptedMediaTest,
|
| - Combine(Values(kExternalClearKeyKeySystem),
|
| - Values(SRC),
|
| - Values(PREFIXED)));
|
| INSTANTIATE_TEST_CASE_P(SRC_ExternalClearKey,
|
| EncryptedMediaTest,
|
| Combine(Values(kExternalClearKeyKeySystem),
|
| Values(SRC),
|
| Values(UNPREFIXED)));
|
|
|
| -INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKey_Prefixed,
|
| - EncryptedMediaTest,
|
| - Combine(Values(kExternalClearKeyKeySystem),
|
| - Values(MSE),
|
| - Values(PREFIXED)));
|
| INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKey,
|
| EncryptedMediaTest,
|
| Combine(Values(kExternalClearKeyKeySystem),
|
| @@ -574,11 +510,6 @@ const char kExternalClearKeyDecryptOnlyKeySystem[] =
|
| "org.chromium.externalclearkey.decryptonly";
|
|
|
| // To reduce test time, only run ExternalClearKeyDecryptOnly with MSE.
|
| -INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly_Prefixed,
|
| - EncryptedMediaTest,
|
| - Combine(Values(kExternalClearKeyDecryptOnlyKeySystem),
|
| - Values(MSE),
|
| - Values(PREFIXED)));
|
| INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly,
|
| EncryptedMediaTest,
|
| Combine(Values(kExternalClearKeyDecryptOnlyKeySystem),
|
| @@ -587,22 +518,6 @@ INSTANTIATE_TEST_CASE_P(MSE_ExternalClearKeyDecryptOnly,
|
| #endif // defined(ENABLE_PEPPER_CDMS)
|
|
|
| #if defined(WIDEVINE_CDM_AVAILABLE)
|
| -
|
| -// Prefixed Widevine tests fail in Chrome OS official builds due to the request
|
| -// for permissions. Since prefixed EME is deprecated and will be removed soon,
|
| -// don't run these tests. http://crbug.com/430711
|
| -#if !(defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD))
|
| -
|
| -// This test doesn't fully test playback with Widevine. So we only run Widevine
|
| -// test with MSE (no SRC) to reduce test time. Also, on Android EME only works
|
| -// with MSE and we cannot run this test with SRC.
|
| -INSTANTIATE_TEST_CASE_P(MSE_Widevine_Prefixed,
|
| - EncryptedMediaTest,
|
| - Combine(Values(kWidevineKeySystem),
|
| - Values(MSE),
|
| - Values(PREFIXED)));
|
| -#endif // !(defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD))
|
| -
|
| #if !defined(OS_CHROMEOS)
|
| INSTANTIATE_TEST_CASE_P(MSE_Widevine,
|
| EncryptedMediaTest,
|
| @@ -763,13 +678,6 @@ IN_PROC_BROWSER_TEST_P(EncryptedMediaTest,
|
| #endif // defined(USE_PROPRIETARY_CODECS)
|
|
|
| #if defined(WIDEVINE_CDM_AVAILABLE)
|
| -// The parent key system cannot be used in generateKeyRequest.
|
| -IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException_Prefixed) {
|
| - RunEncryptedMediaTest(kDefaultEmePlayer, "bear-a_enc-a.webm", kWebMAudioOnly,
|
| - "com.widevine", MSE, PREFIXED, kNoSessionToLoad, false,
|
| - PlayTwice::NO, kEmeNotSupportedError);
|
| -}
|
| -
|
| // The parent key system cannot be used when creating MediaKeys.
|
| IN_PROC_BROWSER_TEST_F(WVEncryptedMediaTest, ParentThrowsException) {
|
| RunEncryptedMediaTest(kDefaultEmePlayer, "bear-a_enc-a.webm", kWebMAudioOnly,
|
| @@ -813,39 +721,4 @@ IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) {
|
| TestPlaybackCase(kUnknownSession, kEmeSessionNotFound);
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, InitializeCDMFail) {
|
| - TestNonPlaybackCases(kExternalClearKeyInitializeFailKeySystem,
|
| - kPrefixedEmeErrorEvent);
|
| -}
|
| -
|
| -// When CDM crashes, we should still get a decode error.
|
| -// crbug.com/386657
|
| -IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest,
|
| - DISABLED_CDMCrashDuringDecode) {
|
| - IgnorePluginCrash();
|
| - TestNonPlaybackCases(kExternalClearKeyCrashKeySystem, kError);
|
| -}
|
| -
|
| -// Testing that the media browser test does fail on plugin crash.
|
| -// crbug.com/386657
|
| -IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest,
|
| - DISABLED_CDMExpectedCrash) {
|
| - // Plugin crash is not ignored by default, the test is expected to fail.
|
| - EXPECT_NONFATAL_FAILURE(
|
| - TestNonPlaybackCases(kExternalClearKeyCrashKeySystem, kError),
|
| - "plugin crash");
|
| -}
|
| -
|
| -IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, FileIOTest) {
|
| - TestNonPlaybackCases(kExternalClearKeyFileIOTestKeySystem,
|
| - kFileIOTestSuccess);
|
| -}
|
| -
|
| -IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadLoadableSession) {
|
| - TestPlaybackCase(kLoadableSession, kEnded);
|
| -}
|
| -
|
| -IN_PROC_BROWSER_TEST_F(ECKPrefixedEncryptedMediaTest, LoadUnknownSession) {
|
| - TestPlaybackCase(kUnknownSession, kPrefixedEmeErrorEvent);
|
| -}
|
| #endif // defined(ENABLE_PEPPER_CDMS)
|
|
|