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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 const char kExternalClearKeyFileIOTestKeySystem[] = | 52 const char kExternalClearKeyFileIOTestKeySystem[] = |
53 "org.chromium.externalclearkey.fileiotest"; | 53 "org.chromium.externalclearkey.fileiotest"; |
54 const char kExternalClearKeyInitializeFailKeySystem[] = | 54 const char kExternalClearKeyInitializeFailKeySystem[] = |
55 "org.chromium.externalclearkey.initializefail"; | 55 "org.chromium.externalclearkey.initializefail"; |
56 const char kExternalClearKeyOutputProtectionTestKeySystem[] = | 56 const char kExternalClearKeyOutputProtectionTestKeySystem[] = |
57 "org.chromium.externalclearkey.outputprotectiontest"; | 57 "org.chromium.externalclearkey.outputprotectiontest"; |
58 const char kExternalClearKeyPlatformVerificationTestKeySystem[] = | 58 const char kExternalClearKeyPlatformVerificationTestKeySystem[] = |
59 "org.chromium.externalclearkey.platformverificationtest"; | 59 "org.chromium.externalclearkey.platformverificationtest"; |
60 const char kExternalClearKeyCrashKeySystem[] = | 60 const char kExternalClearKeyCrashKeySystem[] = |
61 "org.chromium.externalclearkey.crash"; | 61 "org.chromium.externalclearkey.crash"; |
| 62 const char kExternalClearKeyVerifyCdmHostTestKeySystem[] = |
| 63 "org.chromium.externalclearkey.verifycdmhosttest"; |
62 | 64 |
63 // Supported media types. | 65 // Supported media types. |
64 const char kWebMVorbisAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 66 const char kWebMVorbisAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
65 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; | 67 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; |
66 const char kWebMVP8VideoOnly[] = "video/webm; codecs=\"vp8\""; | 68 const char kWebMVP8VideoOnly[] = "video/webm; codecs=\"vp8\""; |
67 const char kWebMVorbisAudioVP8Video[] = "video/webm; codecs=\"vorbis, vp8\""; | 69 const char kWebMVorbisAudioVP8Video[] = "video/webm; codecs=\"vorbis, vp8\""; |
68 const char kWebMOpusAudioVP9Video[] = "video/webm; codecs=\"opus, vp9\""; | 70 const char kWebMOpusAudioVP9Video[] = "video/webm; codecs=\"opus, vp9\""; |
69 const char kWebMVP9VideoOnly[] = "video/webm; codecs=\"vp9\""; | 71 const char kWebMVP9VideoOnly[] = "video/webm; codecs=\"vp9\""; |
70 #if defined(USE_PROPRIETARY_CODECS) | 72 #if defined(USE_PROPRIETARY_CODECS) |
71 const char kMP4AudioOnly[] = "audio/mp4; codecs=\"mp4a.40.2\""; | 73 const char kMP4AudioOnly[] = "audio/mp4; codecs=\"mp4a.40.2\""; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 // Since the web and license servers listen on different ports, we need to | 268 // Since the web and license servers listen on different ports, we need to |
267 // disable web-security to send license requests to the license server. | 269 // disable web-security to send license requests to the license server. |
268 // TODO(shadi): Add port forwarding to the test web server configuration. | 270 // TODO(shadi): Add port forwarding to the test web server configuration. |
269 command_line->AppendSwitch(switches::kDisableWebSecurity); | 271 command_line->AppendSwitch(switches::kDisableWebSecurity); |
270 | 272 |
271 #if BUILDFLAG(ENABLE_PEPPER_CDMS) | 273 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
272 if (IsExternalClearKey(key_system)) { | 274 if (IsExternalClearKey(key_system)) { |
273 RegisterPepperCdm(command_line, kClearKeyCdmBaseDirectory, | 275 RegisterPepperCdm(command_line, kClearKeyCdmBaseDirectory, |
274 kClearKeyCdmAdapterFileName, kClearKeyCdmDisplayName, | 276 kClearKeyCdmAdapterFileName, kClearKeyCdmDisplayName, |
275 kClearKeyCdmPepperMimeType); | 277 kClearKeyCdmPepperMimeType); |
| 278 // Need to tell CdmHostFile(s) to ignore missing CDM host files in tests. |
| 279 command_line->AppendSwitch(switches::kIgnoreMissingCdmHostFile); |
276 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 280 command_line->AppendSwitchASCII(switches::kEnableFeatures, |
277 media::kExternalClearKeyForTesting.name); | 281 media::kExternalClearKeyForTesting.name); |
278 } | 282 } |
279 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) | 283 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
280 } | 284 } |
281 }; | 285 }; |
282 | 286 |
283 #if BUILDFLAG(ENABLE_PEPPER_CDMS) | 287 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
284 // Tests encrypted media playback using ExternalClearKey key system in | 288 // Tests encrypted media playback using ExternalClearKey key system in |
285 // decrypt-and-decode mode. | 289 // decrypt-and-decode mode. |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 669 |
666 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { | 670 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadLoadableSession) { |
667 TestPlaybackCase(kExternalClearKeyKeySystem, kLoadableSession, kEnded); | 671 TestPlaybackCase(kExternalClearKeyKeySystem, kLoadableSession, kEnded); |
668 } | 672 } |
669 | 673 |
670 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { | 674 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, LoadUnknownSession) { |
671 TestPlaybackCase(kExternalClearKeyKeySystem, kUnknownSession, | 675 TestPlaybackCase(kExternalClearKeyKeySystem, kUnknownSession, |
672 kEmeSessionNotFound); | 676 kEmeSessionNotFound); |
673 } | 677 } |
674 | 678 |
| 679 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, VerifyCdmHostTest) { |
| 680 TestNonPlaybackCases(kExternalClearKeyVerifyCdmHostTestKeySystem, |
| 681 kUnitTestSuccess); |
| 682 } |
| 683 |
675 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) | 684 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) |
OLD | NEW |