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

Unified Diff: net/base/mime_util_unittest.cc

Issue 11266008: Fix certificate and keychain installation on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« net/base/mime_util.cc ('K') | « net/base/mime_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_util_unittest.cc
diff --git a/net/base/mime_util_unittest.cc b/net/base/mime_util_unittest.cc
index 635b517edaebf2e69a8853574aecefc56045381d..83d4fcf1877cba1c02bb1a595be022fa5dac2e33 100644
--- a/net/base/mime_util_unittest.cc
+++ b/net/base/mime_util_unittest.cc
@@ -69,6 +69,11 @@ TEST(MimeUtilTest, LookupTypes) {
EXPECT_TRUE(IsSupportedNonImageMimeType("text/banana"));
EXPECT_FALSE(IsSupportedNonImageMimeType("text/vcard"));
EXPECT_FALSE(IsSupportedNonImageMimeType("application/virus"));
+ EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-x509-user-cert"));
+#if defined(OS_ANDROID)
+ EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-x509-ca-cert"));
+ EXPECT_TRUE(IsSupportedNonImageMimeType("application/x-pkcs12"));
+#endif
EXPECT_TRUE(IsSupportedMimeType("image/jpeg"));
EXPECT_FALSE(IsSupportedMimeType("image/lolcat"));
@@ -226,4 +231,23 @@ TEST(MimeUtilTest, TestGetExtensionsForMimeType) {
}
}
+TEST(MimeUtilTest, TestGetCryptoFileTypeForMimeType) {
+ EXPECT_EQ(CRYPTO_FILE_TYPE_X509_USER_CERT,
+ GetCryptoFileTypeForMimeType("application/x-x509-user-cert"));
+#if defined(OS_ANDROID)
+ // Only Android supports CA Certs and PKCS12 keychains.
+ EXPECT_EQ(CRYPTO_FILE_TYPE_X509_CA_CERT,
+ GetCryptoFileTypeForMimeType("application/x-x509-ca-cert"));
+ EXPECT_EQ(CRYPTO_FILE_TYPE_PKCS12_KEYCHAIN,
+ GetCryptoFileTypeForMimeType("application/x-pkcs12"));
+#else
+ EXPECT_EQ(CRYPTO_FILE_TYPE_UNKNOWN,
+ GetCryptoFileTypeForMimeType("application/x-x509-ca-cert"));
+ EXPECT_EQ(CRYPTO_FILE_TYPE_UNKNOWN,
+ GetCryptoFileTypeForMimeType("application/x-pkcs12"));
+#endif
+ EXPECT_EQ(CRYPTO_FILE_TYPE_UNKNOWN,
+ GetCryptoFileTypeForMimeType("text/plain"));
+}
+
} // namespace net
« net/base/mime_util.cc ('K') | « net/base/mime_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698