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 "content/browser/media/media_browsertest.h" | 6 #include "content/browser/media/media_browsertest.h" |
7 #include "content/public/common/content_switches.h" | 7 #include "content/public/common/content_switches.h" |
8 #if defined(OS_ANDROID) | 8 #if defined(OS_ANDROID) |
9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #endif | 10 #endif |
11 | 11 |
12 // Common media types. | 12 // Common media types. |
13 #if !defined(THREAD_SANITIZER) | |
14 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 13 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
15 #if !defined(OS_ANDROID) | 14 #if !defined(OS_ANDROID) |
16 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; | 15 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; |
17 #endif | 16 #endif |
18 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 17 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
19 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 18 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
20 #endif // !defined(THREAD_SANITIZER) | |
21 | 19 |
22 namespace content { | 20 namespace content { |
23 | 21 |
24 // MSE is available on all desktop platforms and on Android 4.1 and later. | 22 // MSE is available on all desktop platforms and on Android 4.1 and later. |
25 static bool IsMSESupported() { | 23 static bool IsMSESupported() { |
26 #if defined(OS_ANDROID) | 24 #if defined(OS_ANDROID) |
27 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { | 25 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { |
28 VLOG(0) << "MSE is only supported in Android 4.1 and later."; | 26 VLOG(0) << "MSE is only supported in Android 4.1 and later."; |
29 return false; | 27 return false; |
30 } | 28 } |
(...skipping 19 matching lines...) Expand all Loading... |
50 } | 48 } |
51 | 49 |
52 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) |
53 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 51 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
54 command_line->AppendSwitch( | 52 command_line->AppendSwitch( |
55 switches::kDisableGestureRequirementForMediaPlayback); | 53 switches::kDisableGestureRequirementForMediaPlayback); |
56 } | 54 } |
57 #endif | 55 #endif |
58 }; | 56 }; |
59 | 57 |
60 // http://crbug.com/407452 | |
61 #if !defined(THREAD_SANITIZER) | |
62 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoAudio_WebM) { | 58 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoAudio_WebM) { |
63 TestSimplePlayback("bear-320x240.webm", kWebMAudioVideo, kEnded); | 59 TestSimplePlayback("bear-320x240.webm", kWebMAudioVideo, kEnded); |
64 } | 60 } |
65 | 61 |
66 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoOnly_WebM) { | 62 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoOnly_WebM) { |
67 TestSimplePlayback("bear-320x240-video-only.webm", kWebMVideoOnly, kEnded); | 63 TestSimplePlayback("bear-320x240-video-only.webm", kWebMVideoOnly, kEnded); |
68 } | 64 } |
69 | 65 |
70 // Opus is not supported in Android as of now. | 66 // Opus is not supported in Android as of now. |
71 #if !defined(OS_ANDROID) | 67 #if !defined(OS_ANDROID) |
(...skipping 15 matching lines...) Expand all Loading... |
87 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { | 83 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { |
88 if (!IsMSESupported()) { | 84 if (!IsMSESupported()) { |
89 VLOG(0) << "Skipping test - MSE not supported."; | 85 VLOG(0) << "Skipping test - MSE not supported."; |
90 return; | 86 return; |
91 } | 87 } |
92 RunMediaTestPage("mse_config_change.html", | 88 RunMediaTestPage("mse_config_change.html", |
93 media::QueryParams(), | 89 media::QueryParams(), |
94 kEnded, | 90 kEnded, |
95 true); | 91 true); |
96 } | 92 } |
97 #endif // !defined(THREAD_SANITIZER) | |
98 | 93 |
99 } // namespace content | 94 } // namespace content |
OLD | NEW |