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 "content/browser/media/media_browsertest.h" | 5 #include "content/browser/media/media_browsertest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 std::string expected; | 94 std::string expected; |
95 expected += base::IntToString(width); | 95 expected += base::IntToString(width); |
96 expected += " "; | 96 expected += " "; |
97 expected += base::IntToString(height); | 97 expected += base::IntToString(height); |
98 base::StringPairs query_params; | 98 base::StringPairs query_params; |
99 query_params.push_back(std::make_pair("video", media_file)); | 99 query_params.push_back(std::make_pair("video", media_file)); |
100 RunMediaTestPage("player.html", query_params, expected, false); | 100 RunMediaTestPage("player.html", query_params, expected, false); |
101 } | 101 } |
102 }; | 102 }; |
103 | 103 |
| 104 // Android doesn't support Theora. |
| 105 #if !defined(OS_ANDROID) |
104 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearTheora) { | 106 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearTheora) { |
105 PlayVideo("bear.ogv", GetParam()); | 107 PlayVideo("bear.ogv", GetParam()); |
106 } | 108 } |
107 | 109 |
108 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentTheora) { | 110 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentTheora) { |
109 PlayVideo("bear_silent.ogv", GetParam()); | 111 PlayVideo("bear_silent.ogv", GetParam()); |
110 } | 112 } |
| 113 #endif // !defined(OS_ANDROID) |
111 | 114 |
112 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWebm) { | 115 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWebm) { |
113 PlayVideo("bear.webm", GetParam()); | 116 PlayVideo("bear.webm", GetParam()); |
114 } | 117 } |
115 | 118 |
116 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearOpusWebm) { | 119 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearOpusWebm) { |
117 PlayVideo("bear-opus.webm", GetParam()); | 120 PlayVideo("bear-opus.webm", GetParam()); |
118 } | 121 } |
119 | 122 |
120 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearOpusOgg) { | 123 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearOpusOgg) { |
121 PlayVideo("bear-opus.ogg", GetParam()); | 124 PlayVideo("bear-opus.ogg", GetParam()); |
122 } | 125 } |
123 | 126 |
124 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentWebm) { | 127 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentWebm) { |
125 PlayVideo("bear_silent.webm", GetParam()); | 128 PlayVideo("bear_silent.webm", GetParam()); |
126 } | 129 } |
127 | 130 |
128 #if defined(USE_PROPRIETARY_CODECS) | 131 #if defined(USE_PROPRIETARY_CODECS) |
129 // Crashes on Mac only. http://crbug.com/621857 | 132 // Crashes on Mac only. http://crbug.com/621857 |
130 #if defined(OS_MACOSX) | 133 #if defined(OS_MACOSX) |
131 #define MAYBE_VideoBearMp4 DISABLED_VideoBearMp4 | 134 #define MAYBE_VideoBearMp4 DISABLED_VideoBearMp4 |
132 #else | 135 #else |
133 #define MAYBE_VideoBearMp4 VideoBearMp4 | 136 #define MAYBE_VideoBearMp4 VideoBearMp4 |
134 #endif | 137 #endif |
135 IN_PROC_BROWSER_TEST_P(MediaTest, MAYBE_VideoBearMp4) { | 138 IN_PROC_BROWSER_TEST_P(MediaTest, MAYBE_VideoBearMp4) { |
136 PlayVideo("bear.mp4", GetParam()); | 139 PlayVideo("bear.mp4", GetParam()); |
137 } | 140 } |
138 | 141 |
| 142 // Android devices usually only support baseline, main and high. |
| 143 #if !defined(OS_ANDROID) |
139 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearHighBitDepthMp4) { | 144 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearHighBitDepthMp4) { |
140 PlayVideo("bear-320x180-hi10p.mp4", GetParam()); | 145 PlayVideo("bear-320x180-hi10p.mp4", GetParam()); |
141 } | 146 } |
| 147 #endif // !defined(OS_ANDROID) |
142 | 148 |
143 // Crashes on Mac only. http://crbug.com/621857 | 149 // Crashes on Mac only. http://crbug.com/621857 |
144 #if defined(OS_MACOSX) | 150 #if defined(OS_MACOSX) |
145 #define MAYBE_VideoBearSilentMp4 DISABLED_VideoBearSilentMp4 | 151 #define MAYBE_VideoBearSilentMp4 DISABLED_VideoBearSilentMp4 |
146 #else | 152 #else |
147 #define MAYBE_VideoBearSilentMp4 VideoBearSilentMp4 | 153 #define MAYBE_VideoBearSilentMp4 VideoBearSilentMp4 |
148 #endif | 154 #endif |
149 IN_PROC_BROWSER_TEST_P(MediaTest, MAYBE_VideoBearSilentMp4) { | 155 IN_PROC_BROWSER_TEST_P(MediaTest, MAYBE_VideoBearSilentMp4) { |
150 PlayVideo("bear_silent.mp4", GetParam()); | 156 PlayVideo("bear_silent.mp4", GetParam()); |
151 } | 157 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavPcm192kHz) { | 236 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavPcm192kHz) { |
231 PlayAudio("bear_192kHz.wav", GetParam()); | 237 PlayAudio("bear_192kHz.wav", GetParam()); |
232 } | 238 } |
233 | 239 |
234 IN_PROC_BROWSER_TEST_P(MediaTest, VideoTulipWebm) { | 240 IN_PROC_BROWSER_TEST_P(MediaTest, VideoTulipWebm) { |
235 PlayVideo("tulip2.webm", GetParam()); | 241 PlayVideo("tulip2.webm", GetParam()); |
236 } | 242 } |
237 | 243 |
238 // Covers tear-down when navigating away as opposed to browser exiting. | 244 // Covers tear-down when navigating away as opposed to browser exiting. |
239 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { | 245 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { |
240 PlayVideo("bear.ogv", false); | 246 PlayVideo("bear.webm", false); |
241 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | 247 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
242 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); | 248 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); |
243 } | 249 } |
244 | 250 |
245 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); | 251 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); |
246 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); | 252 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); |
247 | 253 |
248 } // namespace content | 254 } // namespace content |
OLD | NEW |