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

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

Issue 2580093002: Revert of Convert USE_PROPRIETARY_CODECS to a buildflag header. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « content/browser/media/media_redirect_browsertest.cc ('k') | media/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "build/build_config.h" 6 #include "build/build_config.h"
7 #include "content/browser/media/media_browsertest.h" 7 #include "content/browser/media/media_browsertest.h"
8 #include "content/public/common/content_switches.h" 8 #include "content/public/common/content_switches.h"
9 #include "media/media_features.h" 9 #include "media/media_features.h"
10
11 #if defined(OS_ANDROID) 10 #if defined(OS_ANDROID)
12 #include "base/android/build_info.h" 11 #include "base/android/build_info.h"
13 #endif 12 #endif
14 13
15 // Common media types. 14 // Common media types.
16 #if BUILDFLAG(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID) 15 #if defined(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID)
17 const char kAAC_ADTS_AudioOnly[] = "audio/aac"; 16 const char kAAC_ADTS_AudioOnly[] = "audio/aac";
18 #endif 17 #endif
19 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\""; 18 const char kWebMAudioOnly[] = "audio/webm; codecs=\"vorbis\"";
20 #if !defined(OS_ANDROID) 19 #if !defined(OS_ANDROID)
21 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\""; 20 const char kWebMOpusAudioOnly[] = "audio/webm; codecs=\"opus\"";
22 #endif 21 #endif
23 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\""; 22 const char kWebMVideoOnly[] = "video/webm; codecs=\"vp8\"";
24 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\""; 23 const char kWebMAudioVideo[] = "video/webm; codecs=\"vorbis, vp8\"";
25 24
26 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 25 #if defined(USE_PROPRIETARY_CODECS)
27 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) 26 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER)
28 const char kMp2tAudioVideo[] = "video/mp2t; codecs=\"mp4a.40.2, avc1.42E01E\""; 27 const char kMp2tAudioVideo[] = "video/mp2t; codecs=\"mp4a.40.2, avc1.42E01E\"";
29 #endif 28 #endif
30 #endif 29 #endif
31 30
32 namespace content { 31 namespace content {
33 32
34 class MediaSourceTest : public content::MediaBrowserTest { 33 class MediaSourceTest : public content::MediaBrowserTest {
35 public: 34 public:
36 void TestSimplePlayback(const std::string& media_file, 35 void TestSimplePlayback(const std::string& media_file,
(...skipping 16 matching lines...) Expand all
53 TestSimplePlayback("bear-320x240.webm", kWebMAudioVideo, kEnded); 52 TestSimplePlayback("bear-320x240.webm", kWebMAudioVideo, kEnded);
54 } 53 }
55 54
56 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoOnly_WebM) { 55 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_VideoOnly_WebM) {
57 TestSimplePlayback("bear-320x240-video-only.webm", kWebMVideoOnly, kEnded); 56 TestSimplePlayback("bear-320x240-video-only.webm", kWebMVideoOnly, kEnded);
58 } 57 }
59 58
60 // TODO(servolk): Android is supposed to support AAC in ADTS container with 59 // TODO(servolk): Android is supposed to support AAC in ADTS container with
61 // 'audio/aac' mime type, but for some reason playback fails on trybots due to 60 // 'audio/aac' mime type, but for some reason playback fails on trybots due to
62 // some issue in OMX AAC decoder (crbug.com/528361) 61 // some issue in OMX AAC decoder (crbug.com/528361)
63 #if BUILDFLAG(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID) 62 #if defined(USE_PROPRIETARY_CODECS) && !defined(OS_ANDROID)
64 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_AAC_ADTS) { 63 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_AAC_ADTS) {
65 TestSimplePlayback("sfx.adts", kAAC_ADTS_AudioOnly, kEnded); 64 TestSimplePlayback("sfx.adts", kAAC_ADTS_AudioOnly, kEnded);
66 } 65 }
67 #endif 66 #endif
68 67
69 // Opus is not supported in Android as of now. 68 // Opus is not supported in Android as of now.
70 #if !defined(OS_ANDROID) 69 #if !defined(OS_ANDROID)
71 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_Opus_WebM) { 70 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_Opus_WebM) {
72 TestSimplePlayback("bear-opus.webm", kWebMOpusAudioOnly, kEnded); 71 TestSimplePlayback("bear-opus.webm", kWebMOpusAudioOnly, kEnded);
73 } 72 }
74 #endif 73 #endif
75 74
76 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_WebM) { 75 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioOnly_WebM) {
77 TestSimplePlayback("bear-320x240-audio-only.webm", kWebMAudioOnly, kEnded); 76 TestSimplePlayback("bear-320x240-audio-only.webm", kWebMAudioOnly, kEnded);
78 } 77 }
79 78
80 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) { 79 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Type_Error) {
81 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError); 80 TestSimplePlayback("bear-320x240-video-only.webm", kWebMAudioOnly, kError);
82 } 81 }
83 82
84 // Flaky test crbug.com/246308 83 // Flaky test crbug.com/246308
85 // Test changed to skip checks resulting in flakiness. Proper fix still needed. 84 // Test changed to skip checks resulting in flakiness. Proper fix still needed.
86 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) { 85 IN_PROC_BROWSER_TEST_F(MediaSourceTest, ConfigChangeVideo) {
87 RunMediaTestPage("mse_config_change.html", base::StringPairs(), kEnded, true); 86 RunMediaTestPage("mse_config_change.html", base::StringPairs(), kEnded, true);
88 } 87 }
89 88
90 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 89 #if defined(USE_PROPRIETARY_CODECS)
91 90
92 // TODO(chcunningham): Figure out why this is flaky on android. crbug/607841 91 // TODO(chcunningham): Figure out why this is flaky on android. crbug/607841
93 #if !defined(OS_ANDROID) 92 #if !defined(OS_ANDROID)
94 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_MP4_Audio_WEBM) { 93 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_MP4_Audio_WEBM) {
95 base::StringPairs query_params; 94 base::StringPairs query_params;
96 query_params.push_back(std::make_pair("videoFormat", "CLEAR_MP4")); 95 query_params.push_back(std::make_pair("videoFormat", "CLEAR_MP4"));
97 query_params.push_back(std::make_pair("audioFormat", "CLEAR_WEBM")); 96 query_params.push_back(std::make_pair("audioFormat", "CLEAR_WEBM"));
98 RunMediaTestPage("mse_different_containers.html", query_params, kEnded, true); 97 RunMediaTestPage("mse_different_containers.html", query_params, kEnded, true);
99 } 98 }
100 #endif // !defined(OS_ANDROID) 99 #endif // !defined(OS_ANDROID)
101 100
102 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_WEBM_Audio_MP4) { 101 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_Video_WEBM_Audio_MP4) {
103 base::StringPairs query_params; 102 base::StringPairs query_params;
104 query_params.push_back(std::make_pair("videoFormat", "CLEAR_WEBM")); 103 query_params.push_back(std::make_pair("videoFormat", "CLEAR_WEBM"));
105 query_params.push_back(std::make_pair("audioFormat", "CLEAR_MP4")); 104 query_params.push_back(std::make_pair("audioFormat", "CLEAR_MP4"));
106 RunMediaTestPage("mse_different_containers.html", query_params, kEnded, true); 105 RunMediaTestPage("mse_different_containers.html", query_params, kEnded, true);
107 } 106 }
108 #endif 107 #endif
109 108
110 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 109 #if defined(USE_PROPRIETARY_CODECS)
111 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) 110 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER)
112 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioVideo_Mp2t) { 111 IN_PROC_BROWSER_TEST_F(MediaSourceTest, Playback_AudioVideo_Mp2t) {
113 TestSimplePlayback("bear-1280x720.ts", kMp2tAudioVideo, kEnded); 112 TestSimplePlayback("bear-1280x720.ts", kMp2tAudioVideo, kEnded);
114 } 113 }
115 #endif 114 #endif
116 #endif 115 #endif
117 } // namespace content 116 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/media_redirect_browsertest.cc ('k') | media/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698