OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/logging.h" | 5 #include "base/logging.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/sha1.h" | 7 #include "base/sha1.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "media/base/audio_video_metadata_extractor.h" | 9 #include "media/base/audio_video_metadata_extractor.h" |
10 #include "media/base/test_data_util.h" | 10 #include "media/base/test_data_util.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 extractor->stream_infos()[0].tags.find("encoder")->second); | 181 extractor->stream_infos()[0].tags.find("encoder")->second); |
182 EXPECT_EQ("Alternative", | 182 EXPECT_EQ("Alternative", |
183 extractor->stream_infos()[0].tags.find("genre")->second); | 183 extractor->stream_infos()[0].tags.find("genre")->second); |
184 EXPECT_EQ("Airbag", extractor->stream_infos()[0].tags.find("title")->second); | 184 EXPECT_EQ("Airbag", extractor->stream_infos()[0].tags.find("title")->second); |
185 EXPECT_EQ("1", extractor->stream_infos()[0].tags.find("track")->second); | 185 EXPECT_EQ("1", extractor->stream_infos()[0].tags.find("track")->second); |
186 | 186 |
187 EXPECT_EQ("mp3", extractor->stream_infos()[1].type); | 187 EXPECT_EQ("mp3", extractor->stream_infos()[1].type); |
188 EXPECT_EQ(0u, extractor->stream_infos()[1].tags.size()); | 188 EXPECT_EQ(0u, extractor->stream_infos()[1].tags.size()); |
189 | 189 |
190 EXPECT_EQ("png", extractor->stream_infos()[2].type); | 190 EXPECT_EQ("png", extractor->stream_infos()[2].type); |
191 EXPECT_EQ(2u, extractor->stream_infos()[2].tags.size()); | 191 EXPECT_EQ(1u, extractor->stream_infos()[2].tags.size()); |
192 EXPECT_EQ("Other", extractor->stream_infos()[2].tags.find("comment")->second); | 192 EXPECT_EQ("Other", extractor->stream_infos()[2].tags.find("comment")->second); |
193 EXPECT_EQ("", extractor->stream_infos()[2].tags.find("title")->second); | |
194 | 193 |
195 EXPECT_EQ(1u, extractor->attached_images_bytes().size()); | 194 EXPECT_EQ(1u, extractor->attached_images_bytes().size()); |
196 EXPECT_EQ(155752u, extractor->attached_images_bytes()[0].size()); | 195 EXPECT_EQ(155752u, extractor->attached_images_bytes()[0].size()); |
197 | 196 |
198 EXPECT_EQ("\x89PNG\r\n\x1a\n", | 197 EXPECT_EQ("\x89PNG\r\n\x1a\n", |
199 extractor->attached_images_bytes()[0].substr(0, 8)); | 198 extractor->attached_images_bytes()[0].substr(0, 8)); |
200 EXPECT_EQ("IEND\xae\x42\x60\x82", | 199 EXPECT_EQ("IEND\xae\x42\x60\x82", |
201 extractor->attached_images_bytes()[0].substr( | 200 extractor->attached_images_bytes()[0].substr( |
202 extractor->attached_images_bytes()[0].size() - 8, 8)); | 201 extractor->attached_images_bytes()[0].size() - 8, 8)); |
203 EXPECT_EQ("\xF3\xED\x8F\xC7\xC7\x98\xB9V|p\xC0u!\xB5\x82\xCF\x95\xF0\xCD\xCE", | 202 EXPECT_EQ("\xF3\xED\x8F\xC7\xC7\x98\xB9V|p\xC0u!\xB5\x82\xCF\x95\xF0\xCD\xCE", |
204 base::SHA1HashString(extractor->attached_images_bytes()[0])); | 203 base::SHA1HashString(extractor->attached_images_bytes()[0])); |
205 } | 204 } |
206 #endif | 205 #endif |
207 | 206 |
208 } // namespace media | 207 } // namespace media |
OLD | NEW |