Added a method to detect all supported "image/*" MIME types
Since other methods separate supported binary image MIME types from SVG,
where SVG was detected as a "non image type" along with XML, and since I
needed a method to detect MIME types that can be displayed as an image,
I've added such a method.
BUG=398443
Review URL: https://codereview.chromium.org/471913002
Cr-Commit-Position: refs/heads/master@{#291750}
diff --git a/content/child/simple_webmimeregistry_impl_unittest.cc b/content/child/simple_webmimeregistry_impl_unittest.cc
new file mode 100644
index 0000000..40d3bd5f
--- /dev/null
+++ b/content/child/simple_webmimeregistry_impl_unittest.cc
@@ -0,0 +1,21 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Tests for SimpleWebMimeRegistryImpl.
+
+#include "content/child/simple_webmimeregistry_impl.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/WebKit/public/platform/WebString.h"
+
+TEST(SimpleWebMimeRegistryImpl, mimeTypeTest)
+{
+ content::SimpleWebMimeRegistryImpl registry;
+
+ EXPECT_TRUE(registry.supportsImagePrefixedMIMEType("image/gif"));
+ EXPECT_TRUE(registry.supportsImagePrefixedMIMEType("image/svg+xml"));
+ EXPECT_FALSE(registry.supportsImageMIMEType("image/svg+xml"));
+ EXPECT_TRUE(registry.supportsImageMIMEType("image/gif"));
+}
+