Chromium Code Reviews| 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 #if defined(OS_ANDROID) | 13 #if defined(OS_ANDROID) |
| 14 #include "base/android/build_info.h" | 14 #include "base/android/build_info.h" |
| 15 #include "media/base/media_switches.h" | |
| 15 #endif | 16 #endif |
| 16 | 17 |
| 17 // Available key systems. | 18 // Available key systems. |
| 18 const char kClearKeyKeySystem[] = "org.w3.clearkey"; | 19 const char kClearKeyKeySystem[] = "org.w3.clearkey"; |
| 19 | 20 |
| 20 // Supported media types. | 21 // Supported media types. |
| 21 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 22 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
| 22 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 23 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
| 23 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 24 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
| 24 | 25 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 // We want to fail quickly when a test fails because an error is encountered. | 124 // We want to fail quickly when a test fails because an error is encountered. |
| 124 void AddWaitForTitles(content::TitleWatcher* title_watcher) override { | 125 void AddWaitForTitles(content::TitleWatcher* title_watcher) override { |
| 125 MediaBrowserTest::AddWaitForTitles(title_watcher); | 126 MediaBrowserTest::AddWaitForTitles(title_watcher); |
| 126 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); | 127 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeNotSupportedError)); |
| 127 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeKeyError)); | 128 title_watcher->AlsoWaitForTitle(base::ASCIIToUTF16(kEmeKeyError)); |
| 128 } | 129 } |
| 129 | 130 |
| 130 void SetUpCommandLine(base::CommandLine* command_line) override { | 131 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 131 command_line->AppendSwitch( | 132 command_line->AppendSwitch( |
| 132 switches::kDisableGestureRequirementForMediaPlayback); | 133 switches::kDisableGestureRequirementForMediaPlayback); |
| 134 #if defined(OS_ANDROID) | |
| 135 command_line->AppendSwitch(switches::kEnableUnifiedMediaPipeline); | |
| 136 #endif | |
| 133 } | 137 } |
| 134 }; | 138 }; |
| 135 | 139 |
| 136 using ::testing::Combine; | 140 using ::testing::Combine; |
| 137 using ::testing::Values; | 141 using ::testing::Values; |
| 138 | 142 |
| 139 #if !defined(OS_ANDROID) | |
| 140 // Encrypted media playback with SRC is not supported on Android. | |
| 141 INSTANTIATE_TEST_CASE_P(SRC_ClearKey, EncryptedMediaTest, | 143 INSTANTIATE_TEST_CASE_P(SRC_ClearKey, EncryptedMediaTest, |
| 142 Combine(Values(kClearKeyKeySystem), Values(SRC))); | 144 Combine(Values(kClearKeyKeySystem), Values(SRC))); |
| 143 #endif // !defined(OS_ANDROID) | |
| 144 | 145 |
| 145 INSTANTIATE_TEST_CASE_P(MSE_ClearKey, EncryptedMediaTest, | 146 INSTANTIATE_TEST_CASE_P(MSE_ClearKey, EncryptedMediaTest, |
| 146 Combine(Values(kClearKeyKeySystem), Values(MSE))); | 147 Combine(Values(kClearKeyKeySystem), Values(MSE))); |
| 147 | 148 |
| 148 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { | 149 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioOnly_WebM) { |
| 149 TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly); | 150 TestSimplePlayback("bear-a_enc-a.webm", kWebMAudioOnly); |
| 150 } | 151 } |
| 151 | 152 |
| 152 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { | 153 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_AudioClearVideo_WebM) { |
| 153 TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo); | 154 TestSimplePlayback("bear-320x240-av_enc-a.webm", kWebMAudioVideo); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 #if defined(OS_ANDROID) | 187 #if defined(OS_ANDROID) |
| 187 return; | 188 return; |
| 188 #endif | 189 #endif |
| 189 TestSimplePlayback("bear-320x240-opus-av_enc-v.webm", kWebMAudioVideo); | 190 TestSimplePlayback("bear-320x240-opus-av_enc-v.webm", kWebMAudioVideo); |
| 190 } | 191 } |
| 191 | 192 |
| 192 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) { | 193 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, ConfigChangeVideo) { |
| 193 TestConfigChange(); | 194 TestConfigChange(); |
| 194 } | 195 } |
| 195 | 196 |
| 196 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, FrameSizeChangeVideo) { | 197 IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, FrameSizeChangeVideo) { |
|
DaleCurtis
2016/03/30 22:52:07
I believe this test will start failing if you do.
| |
| 197 TestFrameSizeChange(); | 198 TestFrameSizeChange(); |
| 198 } | 199 } |
| 199 | 200 |
| 200 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { | 201 IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { |
| 201 RunEncryptedMediaTest(kDefaultEmePlayer, | 202 RunEncryptedMediaTest(kDefaultEmePlayer, |
| 202 "bear-a_enc-a.webm", | 203 "bear-a_enc-a.webm", |
| 203 kWebMAudioOnly, | 204 kWebMAudioOnly, |
| 204 "com.example.foo", | 205 "com.example.foo", |
| 205 MSE, | 206 MSE, |
| 206 kEmeNotSupportedError); | 207 kEmeNotSupportedError); |
| 207 } | 208 } |
| 208 | 209 |
| 209 } // namespace content | 210 } // namespace content |
| OLD | NEW |