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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 EXPECT_FALSE(IsSupportedNonImageMimeType("text/vcard")); | 73 EXPECT_FALSE(IsSupportedNonImageMimeType("text/vcard")); |
74 EXPECT_FALSE(IsSupportedNonImageMimeType("application/virus")); | 74 EXPECT_FALSE(IsSupportedNonImageMimeType("application/virus")); |
75 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-x509-user-cert")); | 75 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-x509-user-cert")); |
76 EXPECT_TRUE(IsSupportedNonImageMimeType("application/json")); | 76 EXPECT_TRUE(IsSupportedNonImageMimeType("application/json")); |
77 EXPECT_TRUE(IsSupportedNonImageMimeType("application/+json")); | 77 EXPECT_TRUE(IsSupportedNonImageMimeType("application/+json")); |
78 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-suggestions+json")); | 78 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-suggestions+json")); |
79 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-s+json;x=2")); | 79 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-s+json;x=2")); |
80 #if defined(OS_ANDROID) | 80 #if defined(OS_ANDROID) |
81 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-x509-ca-cert")); | 81 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-x509-ca-cert")); |
82 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-pkcs12")); | 82 EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-pkcs12")); |
| 83 EXPECT_TRUE(IsSupportedMediaMimeType("application/vnd.apple.mpegurl")); |
| 84 EXPECT_TRUE(IsSupportedMediaMimeType("application/x-mpegurl")); |
83 #endif | 85 #endif |
84 | 86 |
85 EXPECT_TRUE(IsSupportedMimeType("image/jpeg")); | 87 EXPECT_TRUE(IsSupportedMimeType("image/jpeg")); |
86 EXPECT_FALSE(IsSupportedMimeType("image/lolcat")); | 88 EXPECT_FALSE(IsSupportedMimeType("image/lolcat")); |
87 EXPECT_TRUE(IsSupportedMimeType("text/html")); | 89 EXPECT_TRUE(IsSupportedMimeType("text/html")); |
88 EXPECT_TRUE(IsSupportedMimeType("text/banana")); | 90 EXPECT_TRUE(IsSupportedMimeType("text/banana")); |
89 EXPECT_FALSE(IsSupportedMimeType("text/vcard")); | 91 EXPECT_FALSE(IsSupportedMimeType("text/vcard")); |
90 EXPECT_FALSE(IsSupportedMimeType("application/virus")); | 92 EXPECT_FALSE(IsSupportedMimeType("application/virus")); |
91 EXPECT_FALSE(IsSupportedMimeType("application/x-json")); | 93 EXPECT_FALSE(IsSupportedMimeType("application/x-json")); |
92 EXPECT_FALSE(IsSupportedNonImageMimeType("application/vnd.doc;x=y+json")); | 94 EXPECT_FALSE(IsSupportedNonImageMimeType("application/vnd.doc;x=y+json")); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 std::string post_data; | 321 std::string post_data; |
320 AddMultipartValueForUpload("value name", "value", "boundary", | 322 AddMultipartValueForUpload("value name", "value", "boundary", |
321 "content type", &post_data); | 323 "content type", &post_data); |
322 AddMultipartValueForUpload("value name", "value", "boundary", | 324 AddMultipartValueForUpload("value name", "value", "boundary", |
323 "", &post_data); | 325 "", &post_data); |
324 AddMultipartFinalDelimiterForUpload("boundary", &post_data); | 326 AddMultipartFinalDelimiterForUpload("boundary", &post_data); |
325 EXPECT_STREQ(ref_output, post_data.c_str()); | 327 EXPECT_STREQ(ref_output, post_data.c_str()); |
326 } | 328 } |
327 | 329 |
328 } // namespace net | 330 } // namespace net |
OLD | NEW |