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, bool http, | |
scherkus (not reviewing)
2014/08/07 00:55:46
remove http param -- we always pass in true
also,
suderman
2014/08/07 00:58:40
Done.
| |
103 int width, int height) { | |
104 std::string expected; | |
105 expected += base::IntToString(width); | |
106 expected += " "; | |
107 expected += base::IntToString(height); | |
108 media::QueryParams query_params; | |
109 query_params.push_back(std::make_pair("video", media_file)); | |
110 RunMediaTestPage("player.html", query_params, expected, http); | |
111 } | |
100 }; | 112 }; |
101 | 113 |
102 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearTheora) { | 114 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearTheora) { |
103 PlayVideo("bear.ogv", GetParam()); | 115 PlayVideo("bear.ogv", GetParam()); |
104 } | 116 } |
105 | 117 |
106 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentTheora) { | 118 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearSilentTheora) { |
107 PlayVideo("bear_silent.ogv", GetParam()); | 119 PlayVideo("bear_silent.ogv", GetParam()); |
108 } | 120 } |
109 | 121 |
(...skipping 25 matching lines...) Expand all Loading... | |
135 // While we support the big endian (be) PCM codecs on Chromium, Quicktime seems | 147 // 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. | 148 // 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. | 149 // TODO(dalecurtis/ihf): Find or create some .wav test cases for "be" format. |
138 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS16be) { | 150 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS16be) { |
139 PlayVideo("bear_pcm_s16be.mov", GetParam()); | 151 PlayVideo("bear_pcm_s16be.mov", GetParam()); |
140 } | 152 } |
141 | 153 |
142 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS24be) { | 154 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearMovPcmS24be) { |
143 PlayVideo("bear_pcm_s24be.mov", GetParam()); | 155 PlayVideo("bear_pcm_s24be.mov", GetParam()); |
144 } | 156 } |
157 | |
158 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated0) { | |
159 RunVideoSizeTest("bear_rotate_0.mp4", true, 1280, 720); | |
160 } | |
161 | |
162 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated90) { | |
163 RunVideoSizeTest("bear_rotate_90.mp4", true, 720, 1280); | |
164 } | |
165 | |
166 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated180) { | |
167 RunVideoSizeTest("bear_rotate_180.mp4", true, 1280, 720); | |
168 } | |
169 | |
170 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated270) { | |
171 RunVideoSizeTest("bear_rotate_270.mp4", true, 720, 1280); | |
172 } | |
145 #endif // defined(USE_PROPRIETARY_CODECS) | 173 #endif // defined(USE_PROPRIETARY_CODECS) |
146 | 174 |
147 #if defined(OS_CHROMEOS) | 175 #if defined(OS_CHROMEOS) |
148 #if defined(USE_PROPRIETARY_CODECS) | 176 #if defined(USE_PROPRIETARY_CODECS) |
149 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4) { | 177 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4) { |
150 PlayVideo("bear_mpeg4_mp3.avi", GetParam()); | 178 PlayVideo("bear_mpeg4_mp3.avi", GetParam()); |
151 } | 179 } |
152 | 180 |
153 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4Asp) { | 181 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4Asp) { |
154 PlayVideo("bear_mpeg4asp_mp3.avi", GetParam()); | 182 PlayVideo("bear_mpeg4asp_mp3.avi", GetParam()); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
249 } | 277 } |
250 | 278 |
251 #if defined(OS_CHROMEOS) | 279 #if defined(OS_CHROMEOS) |
252 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { | 280 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { |
253 RunColorFormatTest("yuv420p.avi", kEnded); | 281 RunColorFormatTest("yuv420p.avi", kEnded); |
254 } | 282 } |
255 #endif // defined(OS_CHROMEOS) | 283 #endif // defined(OS_CHROMEOS) |
256 #endif // defined(USE_PROPRIETARY_CODECS) | 284 #endif // defined(USE_PROPRIETARY_CODECS) |
257 | 285 |
258 } // namespace content | 286 } // namespace content |
OLD | NEW |