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

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

Issue 254983006: Fix: Adding list of supported codecs for MP4 containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adding check for std::string::npos Created 6 years, 6 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
« no previous file with comments | « net/base/mime_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-wav")); 106 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-wav"));
107 107
108 EXPECT_TRUE(IsStrictMediaMimeType("video/ogg")); 108 EXPECT_TRUE(IsStrictMediaMimeType("video/ogg"));
109 EXPECT_TRUE(IsStrictMediaMimeType("audio/ogg")); 109 EXPECT_TRUE(IsStrictMediaMimeType("audio/ogg"));
110 EXPECT_TRUE(IsStrictMediaMimeType("application/ogg")); 110 EXPECT_TRUE(IsStrictMediaMimeType("application/ogg"));
111 111
112 EXPECT_TRUE(IsStrictMediaMimeType("audio/mpeg")); 112 EXPECT_TRUE(IsStrictMediaMimeType("audio/mpeg"));
113 EXPECT_TRUE(IsStrictMediaMimeType("audio/mp3")); 113 EXPECT_TRUE(IsStrictMediaMimeType("audio/mp3"));
114 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-mp3")); 114 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-mp3"));
115 115
116 // TODO(amogh.bihani): These will be fixed http://crbug.com/53193 116 EXPECT_TRUE(IsStrictMediaMimeType("video/mp4"));
117 EXPECT_FALSE(IsStrictMediaMimeType("video/mp4")); 117 EXPECT_TRUE(IsStrictMediaMimeType("video/x-m4v"));
118 EXPECT_FALSE(IsStrictMediaMimeType("video/x-m4v")); 118 EXPECT_TRUE(IsStrictMediaMimeType("audio/mp4"));
119 EXPECT_FALSE(IsStrictMediaMimeType("audio/mp4")); 119 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-m4a"));
120 EXPECT_FALSE(IsStrictMediaMimeType("audio/x-m4a"));
121 120
122 EXPECT_FALSE(IsStrictMediaMimeType("application/x-mpegurl")); 121 EXPECT_TRUE(IsStrictMediaMimeType("application/x-mpegurl"));
123 EXPECT_FALSE(IsStrictMediaMimeType("application/vnd.apple.mpegurl")); 122 EXPECT_TRUE(IsStrictMediaMimeType("application/vnd.apple.mpegurl"));
124 // ---------------------------------------------------------------------------
125 123
126 EXPECT_FALSE(IsStrictMediaMimeType("video/unknown")); 124 EXPECT_FALSE(IsStrictMediaMimeType("video/unknown"));
127 EXPECT_FALSE(IsStrictMediaMimeType("audio/unknown")); 125 EXPECT_FALSE(IsStrictMediaMimeType("audio/unknown"));
128 EXPECT_FALSE(IsStrictMediaMimeType("application/unknown")); 126 EXPECT_FALSE(IsStrictMediaMimeType("application/unknown"));
129 EXPECT_FALSE(IsStrictMediaMimeType("unknown/unknown")); 127 EXPECT_FALSE(IsStrictMediaMimeType("unknown/unknown"));
130 } 128 }
131 129
132 TEST(MimeUtilTest, MatchesMimeType) { 130 TEST(MimeUtilTest, MatchesMimeType) {
133 EXPECT_TRUE(MatchesMimeType("*", "video/x-mpeg")); 131 EXPECT_TRUE(MatchesMimeType("*", "video/x-mpeg"));
134 EXPECT_TRUE(MatchesMimeType("video/*", "video/x-mpeg")); 132 EXPECT_TRUE(MatchesMimeType("video/*", "video/x-mpeg"));
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 std::string post_data; 444 std::string post_data;
447 AddMultipartValueForUpload("value name", "value", "boundary", 445 AddMultipartValueForUpload("value name", "value", "boundary",
448 "content type", &post_data); 446 "content type", &post_data);
449 AddMultipartValueForUpload("value name", "value", "boundary", 447 AddMultipartValueForUpload("value name", "value", "boundary",
450 "", &post_data); 448 "", &post_data);
451 AddMultipartFinalDelimiterForUpload("boundary", &post_data); 449 AddMultipartFinalDelimiterForUpload("boundary", &post_data);
452 EXPECT_STREQ(ref_output, post_data.c_str()); 450 EXPECT_STREQ(ref_output, post_data.c_str());
453 } 451 }
454 452
455 } // namespace net 453 } // namespace net
OLDNEW
« no previous file with comments | « net/base/mime_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698