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