| OLD | NEW |
| 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" |
| 11 #include "media/media_features.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 13 |
| 13 namespace media { | 14 namespace media { |
| 14 | 15 |
| 15 TEST(MimeUtilTest, CommonMediaMimeType) { | 16 TEST(MimeUtilTest, CommonMediaMimeType) { |
| 16 EXPECT_TRUE(IsSupportedMediaMimeType("audio/webm")); | 17 EXPECT_TRUE(IsSupportedMediaMimeType("audio/webm")); |
| 17 EXPECT_TRUE(IsSupportedMediaMimeType("video/webm")); | 18 EXPECT_TRUE(IsSupportedMediaMimeType("video/webm")); |
| 18 | 19 |
| 19 EXPECT_TRUE(IsSupportedMediaMimeType("audio/wav")); | 20 EXPECT_TRUE(IsSupportedMediaMimeType("audio/wav")); |
| 20 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-wav")); | 21 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-wav")); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 44 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); | 45 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); |
| 45 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); | 46 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); |
| 46 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); | 47 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); |
| 47 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); | 48 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); |
| 48 | 49 |
| 49 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); | 50 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); |
| 50 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); | 51 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); |
| 51 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); | 52 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); |
| 52 EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac")); | 53 EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac")); |
| 53 | 54 |
| 54 #if defined(ENABLE_MPEG2TS_STREAM_PARSER) | 55 #if BUILDFLAG(ENABLE_MSE_MPEG2TS_STREAM_PARSER) |
| 55 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp2t")); | 56 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp2t")); |
| 56 #else | 57 #else |
| 57 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp2t")); | 58 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp2t")); |
| 58 #endif | 59 #endif |
| 59 #else | 60 #else |
| 60 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp4")); | 61 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp4")); |
| 61 EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-m4a")); | 62 EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-m4a")); |
| 62 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp4")); | 63 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp4")); |
| 63 EXPECT_FALSE(IsSupportedMediaMimeType("video/x-m4v")); | 64 EXPECT_FALSE(IsSupportedMediaMimeType("video/x-m4v")); |
| 64 | 65 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 105 |
| 105 // Test without stripping the codec type. | 106 // Test without stripping the codec type. |
| 106 std::vector<std::string> codecs_out; | 107 std::vector<std::string> codecs_out; |
| 107 ParseCodecString("avc1.42E01E, mp4a.40.2", &codecs_out, false); | 108 ParseCodecString("avc1.42E01E, mp4a.40.2", &codecs_out, false); |
| 108 ASSERT_EQ(2u, codecs_out.size()); | 109 ASSERT_EQ(2u, codecs_out.size()); |
| 109 EXPECT_EQ("avc1.42E01E", codecs_out[0]); | 110 EXPECT_EQ("avc1.42E01E", codecs_out[0]); |
| 110 EXPECT_EQ("mp4a.40.2", codecs_out[1]); | 111 EXPECT_EQ("mp4a.40.2", codecs_out[1]); |
| 111 } | 112 } |
| 112 | 113 |
| 113 } // namespace media | 114 } // namespace media |
| OLD | NEW |