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/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "base/win/windows_version.h" | 8 #include "base/win/windows_version.h" |
9 #include "chrome/browser/media/media_browsertest.h" | 9 #include "chrome/browser/media/media_browsertest.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #endif | 29 #endif |
30 | 30 |
31 const char kClearKeyCdmPluginMimeType[] = "application/x-ppapi-clearkey-cdm"; | 31 const char kClearKeyCdmPluginMimeType[] = "application/x-ppapi-clearkey-cdm"; |
32 #endif // defined(ENABLE_PEPPER_CDMS) | 32 #endif // defined(ENABLE_PEPPER_CDMS) |
33 | 33 |
34 // Available key systems. | 34 // Available key systems. |
35 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; | 35 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; |
36 const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"; | 36 const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"; |
37 const char kExternalClearKeyDecryptOnlyKeySystem[] = | 37 const char kExternalClearKeyDecryptOnlyKeySystem[] = |
38 "org.chromium.externalclearkey.decryptonly"; | 38 "org.chromium.externalclearkey.decryptonly"; |
| 39 const char kExternalClearKeyFileIOTestKeySystem[] = |
| 40 "org.chromium.externalclearkey.fileiotest"; |
39 const char kExternalClearKeyInitializeFailKeySystem[] = | 41 const char kExternalClearKeyInitializeFailKeySystem[] = |
40 "org.chromium.externalclearkey.initializefail"; | 42 "org.chromium.externalclearkey.initializefail"; |
41 | 43 |
42 // Supported media types. | 44 // Supported media types. |
43 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 45 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
44 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 46 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
45 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 47 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
46 #if defined(USE_PROPRIETARY_CODECS) | 48 #if defined(USE_PROPRIETARY_CODECS) |
47 const char kMP4AudioOnly[] = "audio/mp4; codecs=\"mp4a.40.2\""; | 49 const char kMP4AudioOnly[] = "audio/mp4; codecs=\"mp4a.40.2\""; |
48 const char kMP4VideoOnly[] = "video/mp4; codecs=\"avc1.4D4041\""; | 50 const char kMP4VideoOnly[] = "video/mp4; codecs=\"avc1.4D4041\""; |
49 #endif // defined(USE_PROPRIETARY_CODECS) | 51 #endif // defined(USE_PROPRIETARY_CODECS) |
50 | 52 |
51 // EME-specific test results and errors. | 53 // EME-specific test results and errors. |
52 const char kEmeKeyError[] = "KEYERROR"; | 54 const char kEmeKeyError[] = "KEYERROR"; |
53 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; | 55 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; |
| 56 const char kFileIOTestSuccess[] = "FILEIOTESTSUCCESS"; |
54 | 57 |
55 // The type of video src used to load media. | 58 // The type of video src used to load media. |
56 enum SrcType { | 59 enum SrcType { |
57 SRC, | 60 SRC, |
58 MSE | 61 MSE |
59 }; | 62 }; |
60 | 63 |
61 // MSE is available on all desktop platforms and on Android 4.1 and later. | 64 // MSE is available on all desktop platforms and on Android 4.1 and later. |
62 static bool IsMSESupported() { | 65 static bool IsMSESupported() { |
63 #if defined(OS_ANDROID) | 66 #if defined(OS_ANDROID) |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 RunEncryptedMediaTest("encrypted_media_player.html", | 384 RunEncryptedMediaTest("encrypted_media_player.html", |
382 "bear-a-enc_a.webm", | 385 "bear-a-enc_a.webm", |
383 kWebMAudioOnly, | 386 kWebMAudioOnly, |
384 "com.widevine", | 387 "com.widevine", |
385 MSE, | 388 MSE, |
386 kEmeNotSupportedError); | 389 kEmeNotSupportedError); |
387 } | 390 } |
388 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 391 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
389 | 392 |
390 #if defined(ENABLE_PEPPER_CDMS) | 393 #if defined(ENABLE_PEPPER_CDMS) |
391 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, | 394 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, InitializeCDMFail) { |
392 ExternalClearKeyInitializeCDMFail) { | |
393 RunEncryptedMediaTest("encrypted_media_player.html", | 395 RunEncryptedMediaTest("encrypted_media_player.html", |
394 "bear-a-enc_a.webm", | 396 "bear-a-enc_a.webm", |
395 kWebMAudioOnly, | 397 kWebMAudioOnly, |
396 kExternalClearKeyInitializeFailKeySystem, | 398 kExternalClearKeyInitializeFailKeySystem, |
397 SRC, | 399 SRC, |
398 kEmeKeyError); | 400 kEmeKeyError); |
399 } | 401 } |
| 402 |
| 403 IN_PROC_BROWSER_TEST_F(ECKEncryptedMediaTest, FileIOTest) { |
| 404 RunEncryptedMediaTest("encrypted_media_player.html", |
| 405 "bear-a-enc_a.webm", |
| 406 kWebMAudioOnly, |
| 407 kExternalClearKeyFileIOTestKeySystem, |
| 408 SRC, |
| 409 kFileIOTestSuccess); |
| 410 } |
400 #endif // defined(ENABLE_PEPPER_CDMS) | 411 #endif // defined(ENABLE_PEPPER_CDMS) |
OLD | NEW |