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/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/test/browser_test_utils.h" | 10 #include "content/public/test/browser_test_utils.h" |
11 #include "content/shell/shell.h" | 11 #include "content/shell/shell.h" |
12 #include "content/test/content_browser_test_utils.h" | 12 #include "content/test/content_browser_test_utils.h" |
13 #include "content/test/layout_browsertest.h" | |
14 | 13 |
15 // TODO(wolenetz): Fix Media.YUV* tests on MSVS 2012 x64. crbug.com/180074 | 14 // 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 | 15 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) && _MSC_VER == 1700 |
17 #define MAYBE(x) DISABLED_##x | 16 #define MAYBE(x) DISABLED_##x |
18 #else | 17 #else |
19 #define MAYBE(x) x | 18 #define MAYBE(x) x |
20 #endif | 19 #endif |
21 | 20 |
22 namespace content { | 21 namespace content { |
23 | 22 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // Covers tear-down when navigating away as opposed to browser exiting. | 184 // Covers tear-down when navigating away as opposed to browser exiting. |
186 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { | 185 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { |
187 PlayVideo("bear.ogv", false); | 186 PlayVideo("bear.ogv", false); |
188 NavigateToURL(shell(), GURL("about:blank")); | 187 NavigateToURL(shell(), GURL("about:blank")); |
189 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); | 188 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); |
190 } | 189 } |
191 | 190 |
192 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); | 191 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); |
193 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); | 192 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); |
194 | 193 |
195 class MediaLayoutTest : public InProcessBrowserLayoutTest { | |
196 protected: | |
197 MediaLayoutTest() : InProcessBrowserLayoutTest( | |
198 base::FilePath(), base::FilePath().AppendASCII("media")) { | |
199 } | |
200 virtual ~MediaLayoutTest() {} | |
201 }; | |
202 | |
203 // Each browser test can only correspond to a single layout test, otherwise the | |
204 // 45 second timeout per test is not long enough for N tests on debug/asan/etc | |
205 // builds. | |
206 | |
207 IN_PROC_BROWSER_TEST_F(MediaLayoutTest, VideoAutoplayTest) { | |
208 RunLayoutTest("video-autoplay.html"); | |
209 } | |
210 | |
211 IN_PROC_BROWSER_TEST_F(MediaLayoutTest, VideoLoopTest) { | |
212 RunLayoutTest("video-loop.html"); | |
213 } | |
214 | |
215 IN_PROC_BROWSER_TEST_F(MediaLayoutTest, VideoNoAutoplayTest) { | |
216 RunLayoutTest("video-no-autoplay.html"); | |
217 } | |
218 | |
219 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv420pTheora)) { | 194 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv420pTheora)) { |
220 RunColorFormatTest("yuv420p.ogv", "ENDED"); | 195 RunColorFormatTest("yuv420p.ogv", "ENDED"); |
221 } | 196 } |
222 | 197 |
223 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv422pTheora)) { | 198 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv422pTheora)) { |
224 RunColorFormatTest("yuv422p.ogv", "ENDED"); | 199 RunColorFormatTest("yuv422p.ogv", "ENDED"); |
225 } | 200 } |
226 | 201 |
227 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv444pTheora)) { | 202 IN_PROC_BROWSER_TEST_F(MediaTest, MAYBE(Yuv444pTheora)) { |
228 // TODO(scherkus): Support YUV444 http://crbug.com/104711 | 203 // TODO(scherkus): Support YUV444 http://crbug.com/104711 |
(...skipping 23 matching lines...) Expand all Loading... |
252 } | 227 } |
253 | 228 |
254 #if defined(OS_CHROMEOS) | 229 #if defined(OS_CHROMEOS) |
255 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { | 230 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { |
256 RunColorFormatTest("yuv420p.avi", "ENDED"); | 231 RunColorFormatTest("yuv420p.avi", "ENDED"); |
257 } | 232 } |
258 #endif | 233 #endif |
259 #endif | 234 #endif |
260 | 235 |
261 } // namespace content | 236 } // namespace content |
OLD | NEW |