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) |
| 9 #include "base/android/build_info.h" |
| 10 #endif |
8 | 11 |
9 // Common media types. | 12 // Common media types. |
10 static const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 13 static const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
11 static const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 14 static const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
12 static const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 15 static const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
13 | 16 |
14 namespace content { | 17 namespace content { |
15 | 18 |
16 class MediaSourceTest : public content::MediaBrowserTest { | 19 class MediaSourceTest : public content::MediaBrowserTest { |
17 public: | 20 public: |
18 void TestSimplePlayback(const char* media_file, const char* media_type, | 21 void TestSimplePlayback(const char* media_file, const char* media_type, |
19 const char* expectation) { | 22 const char* expectation) { |
| 23 #if defined(OS_ANDROID) |
| 24 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { |
| 25 LOG(INFO) << "Skipping test - MSE only supported in JellyBean and later."; |
| 26 return; |
| 27 } |
| 28 #endif // defined(OS_ANDROID) |
| 29 |
20 std::vector<StringPair> query_params; | 30 std::vector<StringPair> query_params; |
21 query_params.push_back(std::make_pair("mediafile", media_file)); | 31 query_params.push_back(std::make_pair("mediafile", media_file)); |
22 query_params.push_back(std::make_pair("mediatype", media_type)); | 32 query_params.push_back(std::make_pair("mediatype", media_type)); |
23 RunMediaTestPage("media_source_player.html", &query_params, expectation, | 33 RunMediaTestPage("media_source_player.html", &query_params, expectation, |
24 true); | 34 true); |
25 } | 35 } |
26 | 36 |
27 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
28 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 38 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
29 command_line->AppendSwitch( | 39 command_line->AppendSwitch( |
(...skipping 14 matching lines...) Expand all Loading... |
44 TestSimplePlayback("bear-320x240-audio-only.webm", kWebMAudioOnly, kEnded); | 54 TestSimplePlayback("bear-320x240-audio-only.webm", kWebMAudioOnly, kEnded); |
45 } | 55 } |
46 | 56 |
47 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) { | 57 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) { |
48 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError); | 58 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError); |
49 } | 59 } |
50 | 60 |
51 // Flaky test crbug.com/246308 | 61 // Flaky test crbug.com/246308 |
52 // Test changed to skip checks resulting in flakiness. Proper fix still needed. | 62 // Test changed to skip checks resulting in flakiness. Proper fix still needed. |
53 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { | 63 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { |
| 64 #if defined(OS_ANDROID) |
| 65 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { |
| 66 LOG(INFO) << "Skipping test - MSE only supported in JellyBean and later."; |
| 67 return; |
| 68 } |
| 69 #endif // defined(OS_ANDROID) |
54 RunMediaTestPage("mse_config_change.html", NULL, kEnded, true); | 70 RunMediaTestPage("mse_config_change.html", NULL, kEnded, true); |
55 } | 71 } |
56 | 72 |
57 } // namespace content | 73 } // namespace content |
OLD | NEW |