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 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; | 13 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; |
14 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; | 14 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; |
15 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; | 15 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 // MSE is available on all desktop platforms and on Android 4.1 and later. | 19 // MSE is available on all desktop platforms and on Android 4.1 and later. |
20 static bool IsMSESupported() { | 20 static bool IsMSESupported() { |
21 #if defined(OS_ANDROID) | 21 #if defined(OS_ANDROID) |
22 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { | 22 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { |
23 LOG(INFO) << "MSE is only supported in Android 4.1 and later."; | 23 VLOG(0) << "MSE is only supported in Android 4.1 and later."; |
24 return false; | 24 return false; |
25 } | 25 } |
26 #endif // defined(OS_ANDROID) | 26 #endif // defined(OS_ANDROID) |
27 return true; | 27 return true; |
28 } | 28 } |
29 | 29 |
30 class MediaSourceTest : public content::MediaBrowserTest { | 30 class MediaSourceTest : public content::MediaBrowserTest { |
31 public: | 31 public: |
32 void TestSimplePlayback(const char* media_file, const char* media_type, | 32 void TestSimplePlayback(const char* media_file, const char* media_type, |
33 const char* expectation) { | 33 const char* expectation) { |
34 if (!IsMSESupported()) { | 34 if (!IsMSESupported()) { |
35 LOG(INFO) << "Skipping test - MSE not supported."; | 35 VLOG(0) << "Skipping test - MSE not supported."; |
36 return; | 36 return; |
37 } | 37 } |
38 | 38 |
39 std::vector<StringPair> query_params; | 39 std::vector<StringPair> query_params; |
40 query_params.push_back(std::make_pair("mediafile", media_file)); | 40 query_params.push_back(std::make_pair("mediafile", media_file)); |
41 query_params.push_back(std::make_pair("mediatype", media_type)); | 41 query_params.push_back(std::make_pair("mediatype", media_type)); |
42 RunMediaTestPage("media_source_player.html", &query_params, expectation, | 42 RunMediaTestPage("media_source_player.html", &query_params, expectation, |
43 true); | 43 true); |
44 } | 44 } |
45 | 45 |
(...skipping 18 matching lines...) Expand all Loading... |
64 } | 64 } |
65 | 65 |
66 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) { | 66 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) { |
67 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError); | 67 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError); |
68 } | 68 } |
69 | 69 |
70 // Flaky test crbug.com/246308 | 70 // Flaky test crbug.com/246308 |
71 // Test changed to skip checks resulting in flakiness. Proper fix still needed. | 71 // Test changed to skip checks resulting in flakiness. Proper fix still needed. |
72 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { | 72 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { |
73 if (!IsMSESupported()) { | 73 if (!IsMSESupported()) { |
74 LOG(INFO) << "Skipping test - MSE not supported."; | 74 VLOG(0) << "Skipping test - MSE not supported."; |
75 return; | 75 return; |
76 } | 76 } |
77 RunMediaTestPage("mse_config_change.html", NULL, kEnded, true); | 77 RunMediaTestPage("mse_config_change.html", NULL, kEnded, true); |
78 } | 78 } |
79 | 79 |
80 } // namespace content | 80 } // namespace content |
OLD | NEW |