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

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: separate android and openssl CertDatabase implementations Created 8 years 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
« no previous file with comments | « net/base/mime_util_certificate_type_list.h ('k') | net/net.gyp » ('j') | 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 f3d15d121c5a3766d571e325f351ef1464540f8c..be4d7ca380318aade1abda2bae327209ed4da4e2 100644
--- a/net/base/mime_util_unittest.cc
+++ b/net/base/mime_util_unittest.cc
@@ -70,6 +70,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"));
@@ -272,4 +277,23 @@ TEST(MimeUtilTest, TestGetExtensionsForMimeType) {
}
}
+TEST(MimeUtilTest, TestGetCertificateMimeTypeForMimeType) {
+ EXPECT_EQ(CERTIFICATE_MIME_TYPE_X509_USER_CERT,
+ GetCertificateMimeTypeForMimeType("application/x-x509-user-cert"));
+#if defined(OS_ANDROID)
+ // Only Android supports CA Certs and PKCS12 archives.
+ EXPECT_EQ(CERTIFICATE_MIME_TYPE_X509_CA_CERT,
+ GetCertificateMimeTypeForMimeType("application/x-x509-ca-cert"));
+ EXPECT_EQ(CERTIFICATE_MIME_TYPE_PKCS12_ARCHIVE,
+ GetCertificateMimeTypeForMimeType("application/x-pkcs12"));
+#else
+ EXPECT_EQ(CERTIFICATE_MIME_TYPE_UNKNOWN,
+ GetCertificateMimeTypeForMimeType("application/x-x509-ca-cert"));
+ EXPECT_EQ(CERTIFICATE_MIME_TYPE_UNKNOWN,
+ GetCertificateMimeTypeForMimeType("application/x-pkcs12"));
+#endif
+ EXPECT_EQ(CERTIFICATE_MIME_TYPE_UNKNOWN,
+ GetCertificateMimeTypeForMimeType("text/plain"));
+}
+
} // namespace net
« no previous file with comments | « net/base/mime_util_certificate_type_list.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698