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