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

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

Issue 1624703002: Implement support for vp9 in ISO-BMFF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 "build/build_config.h" 9 #include "build/build_config.h"
10 #include "media/base/mime_util.h" 10 #include "media/base/mime_util.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 105
106 // Test without stripping the codec type. 106 // Test without stripping the codec type.
107 std::vector<std::string> codecs_out; 107 std::vector<std::string> codecs_out;
108 ParseCodecString("avc1.42E01E, mp4a.40.2", &codecs_out, false); 108 ParseCodecString("avc1.42E01E, mp4a.40.2", &codecs_out, false);
109 ASSERT_EQ(2u, codecs_out.size()); 109 ASSERT_EQ(2u, codecs_out.size());
110 EXPECT_EQ("avc1.42E01E", codecs_out[0]); 110 EXPECT_EQ("avc1.42E01E", codecs_out[0]);
111 EXPECT_EQ("mp4a.40.2", codecs_out[1]); 111 EXPECT_EQ("mp4a.40.2", codecs_out[1]);
112 } 112 }
113 113
114 TEST(MimeUtilTest, AreSupportedMediaCodecs) {
ddorwin 2016/01/27 01:39:15 These things are tested in content/browser/media/m
kqyang 2016/01/29 00:34:17 I think these things should really be tested here
115 #if defined(USE_PROPRIETARY_CODECS)
116 EXPECT_TRUE(AreSupportedMediaCodecs({"vp08"}));
ddorwin 2016/01/27 01:39:15 There are no extended tests for vp8.
kqyang 2016/01/29 00:34:17 Added.
117 EXPECT_TRUE(AreSupportedMediaCodecs({"vp09"}));
118 EXPECT_TRUE(AreSupportedMediaCodecs({"vp09.00.01.08"}));
119 EXPECT_FALSE(AreSupportedMediaCodecs({"vp09.0x.01.08"}));
120 EXPECT_FALSE(AreSupportedMediaCodecs({"vp09.00.-1.08"}));
121 EXPECT_TRUE(AreSupportedMediaCodecs({"vp09.01.01.08.02.01.01.00"}));
122 EXPECT_FALSE(AreSupportedMediaCodecs({"vp09.01.01.08.02.01.01.00.00"}));
123 #endif // USE_PROPRIETARY_CODECS
124 }
125
126 TEST(MimeUtilTest, IsSupportedStrictMediaMimeType) {
127 #if defined(USE_PROPRIETARY_CODECS)
128 EXPECT_EQ(MayBeSupported,
129 IsSupportedStrictMediaMimeType("video/mp4", {"vp08"}));
130 EXPECT_EQ(MayBeSupported,
131 IsSupportedStrictMediaMimeType("video/mp4", {"vp09"}));
132 EXPECT_EQ(MayBeSupported,
133 IsSupportedStrictMediaMimeType("video/mp4", {"vp09.00.01.08"}));
134 EXPECT_EQ(IsNotSupported,
135 IsSupportedStrictMediaMimeType("video/mp4", {"vp09.00.-1.08"}));
136 EXPECT_EQ(IsSupported, IsSupportedStrictMediaMimeType(
137 "video/mp4", {"vp09.01.01.08.02.01.01.00"}));
138 EXPECT_EQ(MayBeSupported, IsSupportedStrictMediaMimeType(
139 "video/mp4", {"vp09.01.01..02.01.01.00"}));
140 EXPECT_EQ(IsSupported, IsSupportedStrictMediaMimeType(
141 "video/mp4", {"vp09.01.01.08.04.03.00.00"}));
142 EXPECT_EQ(MayBeSupported,
143 IsSupportedStrictMediaMimeType("video/mp4", {"vp09.04"}));
144 EXPECT_EQ(MayBeSupported, IsSupportedStrictMediaMimeType(
145 "video/mp4", {"vp09.01.01.09.02.01.01.00"}));
146 EXPECT_EQ(MayBeSupported, IsSupportedStrictMediaMimeType(
147 "video/mp4", {"vp09.01.01.08.05.01.01"}));
148 EXPECT_EQ(MayBeSupported, IsSupportedStrictMediaMimeType(
149 "video/mp4", {"vp09.01.01.08.04.04.00.00"}));
150 EXPECT_EQ(MayBeSupported, IsSupportedStrictMediaMimeType(
151 "video/mp4", {"vp09.01.01.08.04.03.02.00"}));
152 #endif // USE_PROPRIETARY_CODECS
153 }
154
114 } // namespace media 155 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698