Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: content/browser/media/media_source_browsertest.cc

Issue 27230004: Do not run MSE related tests when MSE is not available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check MediaCodecBridge Availability Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "media/base/android/media_codec_bridge.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 (!media::MediaCodecBridge::IsAvailable()) {
25 LOG(INFO) << "Could not run test - MSE not supported.";
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
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 (!media::MediaCodecBridge::IsAvailable()) {
66 LOG(INFO) << "Could not run test - MSE not supported.";
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698