OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "base/win/windows_version.h" | 7 #include "base/win/windows_version.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/browser/media/media_browsertest.h" | 9 #include "content/browser/media/media_browsertest.h" |
10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
11 #include "content/public/test/browser_test_utils.h" | 11 #include "content/public/test/browser_test_utils.h" |
12 #include "content/shell/browser/shell.h" | 12 #include "content/shell/browser/shell.h" |
13 | |
13 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
14 #include "base/android/build_info.h" | 15 #include "base/android/build_info.h" |
15 #include "media/base/media.h" | 16 #include "media/base/media.h" |
16 #endif | 17 #endif |
17 | 18 |
18 // Available key systems. | 19 // Available key systems. |
19 const char kClearKeyKeySystem[] = "org.w3.clearkey"; | 20 const char kClearKeyKeySystem[] = "org.w3.clearkey"; |
20 | 21 |
22 #if defined(OS_ANDROID) | |
23 const char kExternalClearKeyKeySystem[] = "org.chromium.externalclearkey"; | |
24 #endif | |
25 | |
21 // Supported media types. | 26 // Supported media types. |
22 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 27 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
23 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 28 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
24 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 29 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
25 | 30 |
26 // EME-specific test results and errors. | 31 // EME-specific test results and errors. |
27 const char kEmeKeyError[] = "KEYERROR"; | 32 const char kEmeKeyError[] = "KEYERROR"; |
28 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; | 33 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; |
29 | 34 |
30 const char kDefaultEmePlayer[] = "eme_player.html"; | 35 const char kDefaultEmePlayer[] = "eme_player.html"; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 | 202 |
198 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { | 203 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { |
199 RunEncryptedMediaTest(kDefaultEmePlayer, | 204 RunEncryptedMediaTest(kDefaultEmePlayer, |
200 "bear-a_enc-a.webm", | 205 "bear-a_enc-a.webm", |
201 kWebMAudioOnly, | 206 kWebMAudioOnly, |
202 "com.example.foo", | 207 "com.example.foo", |
203 MSE, | 208 MSE, |
204 kEmeNotSupportedError); | 209 kEmeNotSupportedError); |
205 } | 210 } |
206 | 211 |
212 #if defined(OS_ANDROID) | |
213 // On Android, External Clear Key is supported in shell/ by using mojo CDM | |
214 // with AesDecryptor running in the GPU process. | |
215 // On other platforms, External Clear Key is supported in chrome/, so it is | |
ddorwin
2016/09/14 01:06:27
This difference and all the ifdefs are unfortunate
xhwang
2016/09/16 18:49:58
Acknowledged.
| |
216 // tested in browser_tests. | |
217 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, ExternalClearKeyPlayback) { | |
218 RunSimpleEncryptedMediaTest("bear-320x240-av_enc-av.webm", kWebMAudioVideo, | |
219 kExternalClearKeyKeySystem, MSE); | |
220 } | |
221 #endif | |
222 | |
207 } // namespace content | 223 } // namespace content |
OLD | NEW |