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/strings/string_number_conversions.h" |
7 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
8 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
9 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
10 #include "content/public/test/content_browser_test_utils.h" | 11 #include "content/public/test/content_browser_test_utils.h" |
11 #include "content/shell/browser/shell.h" | 12 #include "content/shell/browser/shell.h" |
12 #include "media/base/test_data_util.h" | 13 #include "media/base/test_data_util.h" |
13 #include "net/test/spawned_test_server/spawned_test_server.h" | 14 #include "net/test/spawned_test_server/spawned_test_server.h" |
14 | 15 |
15 // TODO(wolenetz): Fix Media.YUV* tests on MSVS 2012 x64. crbug.com/180074 | 16 // TODO(wolenetz): Fix Media.YUV* tests on MSVS 2012 x64. crbug.com/180074 |
16 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) && _MSC_VER == 1700 | 17 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) && _MSC_VER == 1700 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 RunTest(GetFileUrlWithQuery(test_file_path, media_file), expected); | 91 RunTest(GetFileUrlWithQuery(test_file_path, media_file), expected); |
91 } | 92 } |
92 | 93 |
93 void PlayMedia(const std::string& tag, | 94 void PlayMedia(const std::string& tag, |
94 const std::string& media_file, | 95 const std::string& media_file, |
95 bool http) { | 96 bool http) { |
96 media::QueryParams query_params; | 97 media::QueryParams query_params; |
97 query_params.push_back(std::make_pair(tag, media_file)); | 98 query_params.push_back(std::make_pair(tag, media_file)); |
98 RunMediaTestPage("player.html", query_params, kEnded, http); | 99 RunMediaTestPage("player.html", query_params, kEnded, http); |
99 } | 100 } |
| 101 |
| 102 void RunVideoSizeTest(const char* media_file, int width, int height) { |
| 103 std::string expected; |
| 104 expected += base::IntToString(width); |
| 105 expected += " "; |
| 106 expected += base::IntToString(height); |
| 107 media::QueryParams query_params; |
| 108 query_params.push_back(std::make_pair("video", media_file)); |
| 109 RunMediaTestPage("player.html", query_params, expected, false); |
| 110 } |
100 }; | 111 }; |
101 | 112 |
102 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearTheora) { | 113 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearTheora) { |
103 PlayVideo("bear.ogv", GetParam()); | 114 PlayVideo("bear.ogv", GetParam()); |
104 } | 115 } |
105 | 116 |
106 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentTheora) { | 117 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentTheora) { |
107 PlayVideo("bear_silent.ogv", GetParam()); | 118 PlayVideo("bear_silent.ogv", GetParam()); |
108 } | 119 } |
109 | 120 |
(...skipping 25 matching lines...) Expand all Loading... |
135 // While we support the big endian (be) PCM codecs on Chromium, Quicktime seems | 146 // While we support the big endian (be) PCM codecs on Chromium, Quicktime seems |
136 // to be the only creator of this format and only for .mov files. | 147 // to be the only creator of this format and only for .mov files. |
137 // TODO(dalecurtis/ihf): Find or create some .wav test cases for "be" format. | 148 // TODO(dalecurtis/ihf): Find or create some .wav test cases for "be" format. |
138 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS16be) { | 149 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS16be) { |
139 PlayVideo("bear_pcm_s16be.mov", GetParam()); | 150 PlayVideo("bear_pcm_s16be.mov", GetParam()); |
140 } | 151 } |
141 | 152 |
142 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS24be) { | 153 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS24be) { |
143 PlayVideo("bear_pcm_s24be.mov", GetParam()); | 154 PlayVideo("bear_pcm_s24be.mov", GetParam()); |
144 } | 155 } |
| 156 |
| 157 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated0) { |
| 158 RunVideoSizeTest("bear_rotate_0.mp4", 1280, 720); |
| 159 } |
| 160 |
| 161 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated90) { |
| 162 RunVideoSizeTest("bear_rotate_90.mp4", 720, 1280); |
| 163 } |
| 164 |
| 165 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated180) { |
| 166 RunVideoSizeTest("bear_rotate_180.mp4", 1280, 720); |
| 167 } |
| 168 |
| 169 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated270) { |
| 170 RunVideoSizeTest("bear_rotate_270.mp4", 720, 1280); |
| 171 } |
145 #endif // defined(USE_PROPRIETARY_CODECS) | 172 #endif // defined(USE_PROPRIETARY_CODECS) |
146 | 173 |
147 #if defined(OS_CHROMEOS) | 174 #if defined(OS_CHROMEOS) |
148 #if defined(USE_PROPRIETARY_CODECS) | 175 #if defined(USE_PROPRIETARY_CODECS) |
149 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4) { | 176 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4) { |
150 PlayVideo("bear_mpeg4_mp3.avi", GetParam()); | 177 PlayVideo("bear_mpeg4_mp3.avi", GetParam()); |
151 } | 178 } |
152 | 179 |
153 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4Asp) { | 180 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4Asp) { |
154 PlayVideo("bear_mpeg4asp_mp3.avi", GetParam()); | 181 PlayVideo("bear_mpeg4asp_mp3.avi", GetParam()); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 276 } |
250 | 277 |
251 #if defined(OS_CHROMEOS) | 278 #if defined(OS_CHROMEOS) |
252 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { | 279 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { |
253 RunColorFormatTest("yuv420p.avi", kEnded); | 280 RunColorFormatTest("yuv420p.avi", kEnded); |
254 } | 281 } |
255 #endif // defined(OS_CHROMEOS) | 282 #endif // defined(OS_CHROMEOS) |
256 #endif // defined(USE_PROPRIETARY_CODECS) | 283 #endif // defined(USE_PROPRIETARY_CODECS) |
257 | 284 |
258 } // namespace content | 285 } // namespace content |
OLD | NEW |