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

Side by Side Diff: media/base/mime_util_unittest.cc

Issue 2572883002: Convert USE_PROPRIETARY_CODECS to a buildflag header. (Closed)
Patch Set: Merge 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 | « media/base/mime_util_internal.cc ('k') | media/blink/webcontentdecryptionmodulesession_impl.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/string_split.h" 8 #include "base/strings/string_split.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 EXPECT_TRUE(IsSupportedMediaMimeType("audio/flac")); 127 EXPECT_TRUE(IsSupportedMediaMimeType("audio/flac"));
128 128
129 EXPECT_TRUE(IsSupportedMediaMimeType("audio/ogg")); 129 EXPECT_TRUE(IsSupportedMediaMimeType("audio/ogg"));
130 EXPECT_TRUE(IsSupportedMediaMimeType("application/ogg")); 130 EXPECT_TRUE(IsSupportedMediaMimeType("application/ogg"));
131 #if defined(OS_ANDROID) 131 #if defined(OS_ANDROID)
132 EXPECT_FALSE(IsSupportedMediaMimeType("video/ogg")); 132 EXPECT_FALSE(IsSupportedMediaMimeType("video/ogg"));
133 #else 133 #else
134 EXPECT_TRUE(IsSupportedMediaMimeType("video/ogg")); 134 EXPECT_TRUE(IsSupportedMediaMimeType("video/ogg"));
135 #endif // OS_ANDROID 135 #endif // OS_ANDROID
136 136
137 #if defined(OS_ANDROID) && defined(USE_PROPRIETARY_CODECS) 137 #if defined(OS_ANDROID) && BUILDFLAG(USE_PROPRIETARY_CODECS)
138 // HLS is supported on Android API level 14 and higher and Chrome supports 138 // HLS is supported on Android API level 14 and higher and Chrome supports
139 // API levels 15 and higher, so these are expected to be supported. 139 // API levels 15 and higher, so these are expected to be supported.
140 bool kHlsSupported = true; 140 bool kHlsSupported = true;
141 #else 141 #else
142 bool kHlsSupported = false; 142 bool kHlsSupported = false;
143 #endif 143 #endif
144 144
145 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("application/x-mpegurl")); 145 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("application/x-mpegurl"));
146 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("Application/X-MPEGURL")); 146 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType("Application/X-MPEGURL"));
147 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType( 147 EXPECT_EQ(kHlsSupported, IsSupportedMediaMimeType(
148 "application/vnd.apple.mpegurl")); 148 "application/vnd.apple.mpegurl"));
149 149
150 #if defined(USE_PROPRIETARY_CODECS) 150 #if BUILDFLAG(USE_PROPRIETARY_CODECS)
151 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); 151 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4"));
152 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); 152 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a"));
153 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); 153 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4"));
154 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); 154 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v"));
155 155
156 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); 156 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3"));
157 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); 157 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3"));
158 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); 158 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg"));
159 EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac")); 159 EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac"));
160 160
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) { 426 [](const MimeUtil::PlatformInfo& info, MimeUtil::Codec codec) {
427 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( 427 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform(
428 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info)); 428 MimeUtil::MPEG2_AAC, "application/x-mpegurl", false, info));
429 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform( 429 EXPECT_FALSE(MimeUtil::IsCodecSupportedOnPlatform(
430 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info)); 430 MimeUtil::MPEG2_AAC, "application/vnd.apple.mpegurl", false, info));
431 }); 431 });
432 } 432 }
433 433
434 } // namespace internal 434 } // namespace internal
435 } // namespace media 435 } // namespace media
OLDNEW
« no previous file with comments | « media/base/mime_util_internal.cc ('k') | media/blink/webcontentdecryptionmodulesession_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698