| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #endif | 22 #endif |
| 23 | 23 |
| 24 // Available key systems. | 24 // Available key systems. |
| 25 const char kClearKeyKeySystem[] = "org.w3.clearkey"; | 25 const char kClearKeyKeySystem[] = "org.w3.clearkey"; |
| 26 | 26 |
| 27 // Supported media types. | 27 // Supported media types. |
| 28 const char kWebMVorbisAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 28 const char kWebMVorbisAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
| 29 #if !defined(DISABLE_ENCRYPTED_MEDIA_PLAYBACK_TESTS) | 29 #if !defined(DISABLE_ENCRYPTED_MEDIA_PLAYBACK_TESTS) |
| 30 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; | 30 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; |
| 31 const char kWebMVP8VideoOnly[] = "video/webm; codecs=\"vp8\""; | 31 const char kWebMVP8VideoOnly[] = "video/webm; codecs=\"vp8\""; |
| 32 const char kWebMVP9VideoOnly[] = "video/webm; codecs=\"vp9\""; |
| 32 const char kWebMOpusAudioVP9Video[] = "video/webm; codecs=\"opus, vp9\""; | 33 const char kWebMOpusAudioVP9Video[] = "video/webm; codecs=\"opus, vp9\""; |
| 33 #endif | 34 #endif |
| 34 const char kWebMVorbisAudioVP8Video[] = "video/webm; codecs=\"vorbis, vp8\""; | 35 const char kWebMVorbisAudioVP8Video[] = "video/webm; codecs=\"vorbis, vp8\""; |
| 35 | 36 |
| 36 // EME-specific test results and errors. | 37 // EME-specific test results and errors. |
| 37 const char kEmeKeyError[] = "KEYERROR"; | 38 const char kEmeKeyError[] = "KEYERROR"; |
| 38 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; | 39 const char kEmeNotSupportedError[] = "NOTSUPPORTEDERROR"; |
| 39 | 40 |
| 40 const char kDefaultEmePlayer[] = "eme_player.html"; | 41 const char kDefaultEmePlayer[] = "eme_player.html"; |
| 41 | 42 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 165 } |
| 165 | 166 |
| 166 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { | 167 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoAudio_WebM) { |
| 167 TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVP8Video); | 168 TestSimplePlayback("bear-320x240-av_enc-av.webm", kWebMVorbisAudioVP8Video); |
| 168 } | 169 } |
| 169 | 170 |
| 170 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { | 171 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM) { |
| 171 TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVP8VideoOnly); | 172 TestSimplePlayback("bear-320x240-v_enc-v.webm", kWebMVP8VideoOnly); |
| 172 } | 173 } |
| 173 | 174 |
| 175 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_Fullsample) { |
| 176 TestSimplePlayback("bear-320x240-v-vp9_fullsample_enc-v.webm", |
| 177 kWebMVP9VideoOnly); |
| 178 } |
| 179 |
| 180 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_WebM_Subsample) { |
| 181 TestSimplePlayback("bear-320x240-v-vp9_subsample_enc-v.webm", |
| 182 kWebMVP9VideoOnly); |
| 183 } |
| 184 |
| 174 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { | 185 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoClearAudio_WebM) { |
| 175 TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMVorbisAudioVP8Video); | 186 TestSimplePlayback("bear-320x240-av_enc-v.webm", kWebMVorbisAudioVP8Video); |
| 176 } | 187 } |
| 177 | 188 |
| 178 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM_Opus) { | 189 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM_Opus) { |
| 179 #if defined(OS_ANDROID) | 190 #if defined(OS_ANDROID) |
| 180 if (!media::PlatformHasOpusSupport()) | 191 if (!media::PlatformHasOpusSupport()) |
| 181 return; | 192 return; |
| 182 #endif | 193 #endif |
| 183 TestSimplePlayback("bear-320x240-opus-a_enc-a.webm", kWebMOpusAudioOnly); | 194 TestSimplePlayback("bear-320x240-opus-a_enc-a.webm", kWebMOpusAudioOnly); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 209 } | 220 } |
| 210 #endif // !defined(DISABLE_ENCRYPTED_MEDIA_PLAYBACK_TESTS) | 221 #endif // !defined(DISABLE_ENCRYPTED_MEDIA_PLAYBACK_TESTS) |
| 211 | 222 |
| 212 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { | 223 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { |
| 213 RunEncryptedMediaTest(kDefaultEmePlayer, "bear-a_enc-a.webm", | 224 RunEncryptedMediaTest(kDefaultEmePlayer, "bear-a_enc-a.webm", |
| 214 kWebMVorbisAudioOnly, "com.example.foo", MSE, | 225 kWebMVorbisAudioOnly, "com.example.foo", MSE, |
| 215 kEmeNotSupportedError); | 226 kEmeNotSupportedError); |
| 216 } | 227 } |
| 217 | 228 |
| 218 } // namespace content | 229 } // namespace content |
| OLD | NEW |