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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 EXPECT_TRUE(IsStrictMediaMimeType("video/webm")); | 98 EXPECT_TRUE(IsStrictMediaMimeType("video/webm")); |
99 EXPECT_TRUE(IsStrictMediaMimeType("audio/webm")); | 99 EXPECT_TRUE(IsStrictMediaMimeType("audio/webm")); |
100 | 100 |
101 EXPECT_TRUE(IsStrictMediaMimeType("audio/wav")); | 101 EXPECT_TRUE(IsStrictMediaMimeType("audio/wav")); |
102 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-wav")); | 102 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-wav")); |
103 | 103 |
104 EXPECT_TRUE(IsStrictMediaMimeType("video/ogg")); | 104 EXPECT_TRUE(IsStrictMediaMimeType("video/ogg")); |
105 EXPECT_TRUE(IsStrictMediaMimeType("audio/ogg")); | 105 EXPECT_TRUE(IsStrictMediaMimeType("audio/ogg")); |
106 EXPECT_TRUE(IsStrictMediaMimeType("application/ogg")); | 106 EXPECT_TRUE(IsStrictMediaMimeType("application/ogg")); |
107 | 107 |
108 // TODO(amogh.bihani): These formats should be in stict-format_map_. This will | 108 EXPECT_TRUE(IsStrictMediaMimeType("audio/mpeg")); |
109 // be fixed with bug 53193 (http://crbug.com/53193)--------------------------- | 109 EXPECT_TRUE(IsStrictMediaMimeType("audio/mp3")); |
110 EXPECT_FALSE(IsStrictMediaMimeType("audio/mpeg")); | 110 EXPECT_TRUE(IsStrictMediaMimeType("audio/x-mp3")); |
111 EXPECT_FALSE(IsStrictMediaMimeType("audio/mp3")); | |
112 EXPECT_FALSE(IsStrictMediaMimeType("audio/x-mp3")); | |
113 | 111 |
| 112 // TODO(amogh.bihani): These will be fixed http://crbug.com/53193 |
114 EXPECT_FALSE(IsStrictMediaMimeType("video/mp4")); | 113 EXPECT_FALSE(IsStrictMediaMimeType("video/mp4")); |
115 EXPECT_FALSE(IsStrictMediaMimeType("video/x-mp4v")); | 114 EXPECT_FALSE(IsStrictMediaMimeType("video/x-m4v")); |
116 EXPECT_FALSE(IsStrictMediaMimeType("audio/mp4")); | 115 EXPECT_FALSE(IsStrictMediaMimeType("audio/mp4")); |
117 EXPECT_FALSE(IsStrictMediaMimeType("audio/x-mp4a")); | 116 EXPECT_FALSE(IsStrictMediaMimeType("audio/x-m4a")); |
118 | 117 |
119 EXPECT_FALSE(IsStrictMediaMimeType("application/x-mpegurl")); | 118 EXPECT_FALSE(IsStrictMediaMimeType("application/x-mpegurl")); |
120 EXPECT_FALSE(IsStrictMediaMimeType("application/vnd.apple.mpegurl")); | 119 EXPECT_FALSE(IsStrictMediaMimeType("application/vnd.apple.mpegurl")); |
121 // --------------------------------------------------------------------------- | 120 // --------------------------------------------------------------------------- |
122 | 121 |
123 EXPECT_FALSE(IsStrictMediaMimeType("video/unknown")); | 122 EXPECT_FALSE(IsStrictMediaMimeType("video/unknown")); |
124 EXPECT_FALSE(IsStrictMediaMimeType("audio/unknown")); | 123 EXPECT_FALSE(IsStrictMediaMimeType("audio/unknown")); |
125 EXPECT_FALSE(IsStrictMediaMimeType("application/unknown")); | 124 EXPECT_FALSE(IsStrictMediaMimeType("application/unknown")); |
126 EXPECT_FALSE(IsStrictMediaMimeType("unknown/unknown")); | 125 EXPECT_FALSE(IsStrictMediaMimeType("unknown/unknown")); |
127 } | 126 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 std::string post_data; | 352 std::string post_data; |
354 AddMultipartValueForUpload("value name", "value", "boundary", | 353 AddMultipartValueForUpload("value name", "value", "boundary", |
355 "content type", &post_data); | 354 "content type", &post_data); |
356 AddMultipartValueForUpload("value name", "value", "boundary", | 355 AddMultipartValueForUpload("value name", "value", "boundary", |
357 "", &post_data); | 356 "", &post_data); |
358 AddMultipartFinalDelimiterForUpload("boundary", &post_data); | 357 AddMultipartFinalDelimiterForUpload("boundary", &post_data); |
359 EXPECT_STREQ(ref_output, post_data.c_str()); | 358 EXPECT_STREQ(ref_output, post_data.c_str()); |
360 } | 359 } |
361 | 360 |
362 } // namespace net | 361 } // namespace net |
OLD | NEW |