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..28271922bffa12bae2e11568f21c4af9bd8ec085 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, TestGetCertificateTypeForMimeType) { |
+ EXPECT_EQ(CERTIFICATE_TYPE_X509_USER_CERT, |
+ GetCertificateTypeForMimeType("application/x-x509-user-cert")); |
+#if defined(OS_ANDROID) |
+ // Only Android supports CA Certs and PKCS12 keychains. |
+ EXPECT_EQ(CERTIFICATE_TYPE_X509_CA_CERT, |
+ GetCertificateTypeForMimeType("application/x-x509-ca-cert")); |
+ EXPECT_EQ(CERTIFICATE_TYPE_PKCS12_KEYCHAIN, |
+ GetCertificateTypeForMimeType("application/x-pkcs12")); |
+#else |
+ EXPECT_EQ(CERTIFICATE_TYPE_UNKNOWN, |
+ GetCertificateTypeForMimeType("application/x-x509-ca-cert")); |
+ EXPECT_EQ(CERTIFICATE_TYPE_UNKNOWN, |
+ GetCertificateTypeForMimeType("application/x-pkcs12")); |
+#endif |
+ EXPECT_EQ(CERTIFICATE_TYPE_UNKNOWN, |
+ GetCertificateTypeForMimeType("text/plain")); |
+} |
+ |
} // namespace net |