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 "content/browser/media/media_browsertest.h" | 8 #include "content/browser/media/media_browsertest.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
11 #include "content/shell/browser/shell.h" | 11 #include "content/shell/browser/shell.h" |
12 #if defined(OS_ANDROID) | 12 #if defined(OS_ANDROID) |
13 #include "base/android/build_info.h" | 13 #include "base/android/build_info.h" |
14 #endif | 14 #endif |
15 | 15 |
16 // Available key systems. | 16 // Available key systems. |
17 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; | 17 const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey"; |
18 | 18 |
19 // Supported media types. | 19 // Supported media types. |
20 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 20 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
21 #if !defined(THREAD_SANITIZER) | |
22 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 21 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
23 #endif // !defined(THREAD_SANITIZER) | |
24 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 22 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
25 | 23 |
26 // EME-specific test results and errors. | 24 // EME-specific test results and errors. |
27 const char kEmeKeyError[] = "KEYERROR"; | 25 const char kEmeKeyError[] = "KEYERROR"; |
28 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; | 26 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; |
29 | 27 |
30 const char kDefaultEmePlayer[] = "eme_player.html"; | 28 const char kDefaultEmePlayer[] = "eme_player.html"; |
31 | 29 |
32 // The type of video src used to load media. | 30 // The type of video src used to load media. |
33 enum SrcType { | 31 enum SrcType { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 139 |
142 #if !defined(OS_ANDROID) | 140 #if !defined(OS_ANDROID) |
143 // Encrypted media playback with SRC is not supported on Android. | 141 // Encrypted media playback with SRC is not supported on Android. |
144 INSTANTIATE_TEST_CASE_P(SRC_ClearKey, EncryptedMediaTest, | 142 INSTANTIATE_TEST_CASE_P(SRC_ClearKey, EncryptedMediaTest, |
145 Combine(Values(kClearKeyKeySystem), Values(SRC))); | 143 Combine(Values(kClearKeyKeySystem), Values(SRC))); |
146 #endif // !defined(OS_ANDROID) | 144 #endif // !defined(OS_ANDROID) |
147 | 145 |
148 INSTANTIATE_TEST_CASE_P(MSE_ClearKey, EncryptedMediaTest, | 146 INSTANTIATE_TEST_CASE_P(MSE_ClearKey, EncryptedMediaTest, |
149 Combine(Values(kClearKeyKeySystem), Values(MSE))); | 147 Combine(Values(kClearKeyKeySystem), Values(MSE))); |
150 | 148 |
151 // http://crbug.com/407452 | |
152 #if !defined(THREAD_SANITIZER) | |
153 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { | 149 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { |
154 TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly); | 150 TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly); |
155 } | 151 } |
156 | 152 |
157 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { | 153 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { |
158 TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo); | 154 TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo); |
159 } | 155 } |
160 | 156 |
161 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { | 157 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { |
162 TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMAudioVideo); | 158 TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMAudioVideo); |
163 } | 159 } |
164 | 160 |
165 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { | 161 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { |
166 TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVideoOnly); | 162 TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVideoOnly); |
167 } | 163 } |
168 | 164 |
169 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { | 165 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { |
170 TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMAudioVideo); | 166 TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMAudioVideo); |
171 } | 167 } |
172 | 168 |
173 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) { | 169 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) { |
174 TestConfigChange(); | 170 TestConfigChange(); |
175 } | 171 } |
176 #endif // !defined(THREAD_SANITIZER) | |
177 | 172 |
178 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, FrameSizeChangeVideo) { | 173 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, FrameSizeChangeVideo) { |
179 // Times out on Windows XP. http://crbug.com/171937 | 174 // Times out on Windows XP. http://crbug.com/171937 |
180 #if defined(OS_WIN) | 175 #if defined(OS_WIN) |
181 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 176 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
182 return; | 177 return; |
183 #elif defined(__aarch64__) | 178 #elif defined(__aarch64__) |
184 // Times out on arm64 currently due to http://crbug.com/403308 | 179 // Times out on arm64 currently due to http://crbug.com/403308 |
185 return; | 180 return; |
186 #endif | 181 #endif |
187 TestFrameSizeChange(); | 182 TestFrameSizeChange(); |
188 } | 183 } |
189 | 184 |
190 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { | 185 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { |
191 RunEncryptedMediaTest(kDefaultEmePlayer, | 186 RunEncryptedMediaTest(kDefaultEmePlayer, |
192 "bear-a_enc-a.webm", | 187 "bear-a_enc-a.webm", |
193 kWebMAudioOnly, | 188 kWebMAudioOnly, |
194 "com.example.foo", | 189 "com.example.foo", |
195 MSE, | 190 MSE, |
196 kEmeNotSupportedError); | 191 kEmeNotSupportedError); |
197 } | 192 } |
198 | 193 |
199 } // namespace content | 194 } // namespace content |
OLD | NEW |