OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/strings/string_split.h" | 6 #include "base/strings/string_split.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "net/base/mime_util.h" | 8 #include "net/base/mime_util.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 #if defined(USE_PROPRIETARY_CODECS) | 225 #if defined(USE_PROPRIETARY_CODECS) |
226 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); | 226 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp4")); |
227 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); | 227 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-m4a")); |
228 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); | 228 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp4")); |
229 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); | 229 EXPECT_TRUE(IsSupportedMediaMimeType("video/x-m4v")); |
230 | 230 |
231 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); | 231 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mp3")); |
232 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); | 232 EXPECT_TRUE(IsSupportedMediaMimeType("audio/x-mp3")); |
233 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); | 233 EXPECT_TRUE(IsSupportedMediaMimeType("audio/mpeg")); |
| 234 EXPECT_TRUE(IsSupportedMediaMimeType("audio/aac")); |
234 | 235 |
235 #if defined(ENABLE_MPEG2TS_STREAM_PARSER) | 236 #if defined(ENABLE_MPEG2TS_STREAM_PARSER) |
236 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp2t")); | 237 EXPECT_TRUE(IsSupportedMediaMimeType("video/mp2t")); |
237 #else | 238 #else |
238 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp2t")); | 239 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp2t")); |
239 #endif | 240 #endif |
240 #else | 241 #else |
241 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp4")); | 242 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp4")); |
242 EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-m4a")); | 243 EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-m4a")); |
243 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp4")); | 244 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp4")); |
244 EXPECT_FALSE(IsSupportedMediaMimeType("video/x-m4v")); | 245 EXPECT_FALSE(IsSupportedMediaMimeType("video/x-m4v")); |
245 | 246 |
246 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp3")); | 247 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mp3")); |
247 EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-mp3")); | 248 EXPECT_FALSE(IsSupportedMediaMimeType("audio/x-mp3")); |
248 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mpeg")); | 249 EXPECT_FALSE(IsSupportedMediaMimeType("audio/mpeg")); |
| 250 EXPECT_FALSE(IsSupportedMediaMimeType("audio/aac")); |
249 #endif // USE_PROPRIETARY_CODECS | 251 #endif // USE_PROPRIETARY_CODECS |
250 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp3")); | 252 EXPECT_FALSE(IsSupportedMediaMimeType("video/mp3")); |
251 | 253 |
252 EXPECT_FALSE(IsSupportedMediaMimeType("video/unknown")); | 254 EXPECT_FALSE(IsSupportedMediaMimeType("video/unknown")); |
253 EXPECT_FALSE(IsSupportedMediaMimeType("audio/unknown")); | 255 EXPECT_FALSE(IsSupportedMediaMimeType("audio/unknown")); |
254 EXPECT_FALSE(IsSupportedMediaMimeType("unknown/unknown")); | 256 EXPECT_FALSE(IsSupportedMediaMimeType("unknown/unknown")); |
255 } | 257 } |
256 | 258 |
257 // Note: codecs should only be a list of 2 or fewer; hence the restriction of | 259 // Note: codecs should only be a list of 2 or fewer; hence the restriction of |
258 // results' length to 2. | 260 // results' length to 2. |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 std::string post_data; | 439 std::string post_data; |
438 AddMultipartValueForUpload("value name", "value", "boundary", | 440 AddMultipartValueForUpload("value name", "value", "boundary", |
439 "content type", &post_data); | 441 "content type", &post_data); |
440 AddMultipartValueForUpload("value name", "value", "boundary", | 442 AddMultipartValueForUpload("value name", "value", "boundary", |
441 "", &post_data); | 443 "", &post_data); |
442 AddMultipartFinalDelimiterForUpload("boundary", &post_data); | 444 AddMultipartFinalDelimiterForUpload("boundary", &post_data); |
443 EXPECT_STREQ(ref_output, post_data.c_str()); | 445 EXPECT_STREQ(ref_output, post_data.c_str()); |
444 } | 446 } |
445 | 447 |
446 } // namespace net | 448 } // namespace net |
OLD | NEW |