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 |
(...skipping 14 matching lines...) Expand all Loading... |
25 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { | 25 if (base::android::BuildInfo::GetInstance()->sdk_int() < 16) { |
26 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."; |
27 return false; | 27 return false; |
28 } | 28 } |
29 #endif // defined(OS_ANDROID) | 29 #endif // defined(OS_ANDROID) |
30 return true; | 30 return true; |
31 } | 31 } |
32 | 32 |
33 class MediaSourceTest : public content::MediaBrowserTest { | 33 class MediaSourceTest : public content::MediaBrowserTest { |
34 public: | 34 public: |
35 void TestSimplePlayback(const char* media_file, const char* media_type, | 35 void TestSimplePlayback(const std::string& media_file, |
36 const char* expectation) { | 36 const std::string& media_type, |
| 37 const std::string& expectation) { |
37 if (!IsMSESupported()) { | 38 if (!IsMSESupported()) { |
38 VLOG(0) << "Skipping test - MSE not supported."; | 39 VLOG(0) << "Skipping test - MSE not supported."; |
39 return; | 40 return; |
40 } | 41 } |
41 | 42 |
42 std::vector<StringPair> query_params; | 43 media::QueryParams query_params; |
43 query_params.push_back(std::make_pair("mediafile", media_file)); | 44 query_params.push_back(std::make_pair("mediaFile", media_file)); |
44 query_params.push_back(std::make_pair("mediatype", media_type)); | 45 query_params.push_back(std::make_pair("mediaType", media_type)); |
45 RunMediaTestPage("media_source_player.html", &query_params, expectation, | 46 RunMediaTestPage("media_source_player.html", query_params, expectation, |
46 true); | 47 true); |
47 } | 48 } |
48 | 49 |
49 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) |
50 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 51 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
51 command_line->AppendSwitch( | 52 command_line->AppendSwitch( |
52 switches::kDisableGestureRequirementForMediaPlayback); | 53 switches::kDisableGestureRequirementForMediaPlayback); |
53 } | 54 } |
54 #endif | 55 #endif |
55 }; | 56 }; |
(...skipping 21 matching lines...) Expand all Loading... |
77 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError); | 78 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError); |
78 } | 79 } |
79 | 80 |
80 // Flaky test crbug.com/246308 | 81 // Flaky test crbug.com/246308 |
81 // Test changed to skip checks resulting in flakiness. Proper fix still needed. | 82 // Test changed to skip checks resulting in flakiness. Proper fix still needed. |
82 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { | 83 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { |
83 if (!IsMSESupported()) { | 84 if (!IsMSESupported()) { |
84 VLOG(0) << "Skipping test - MSE not supported."; | 85 VLOG(0) << "Skipping test - MSE not supported."; |
85 return; | 86 return; |
86 } | 87 } |
87 RunMediaTestPage("mse_config_change.html", NULL, kEnded, true); | 88 RunMediaTestPage("mse_config_change.html", |
| 89 media::QueryParams(), |
| 90 kEnded, |
| 91 true); |
88 } | 92 } |
89 | 93 |
90 } // namespace content | 94 } // namespace content |
OLD | NEW |