summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit/GraphicDescriptorTest.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qa/cppunit/GraphicDescriptorTest.cxx')
-rw-r--r--vcl/qa/cppunit/GraphicDescriptorTest.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/GraphicDescriptorTest.cxx b/vcl/qa/cppunit/GraphicDescriptorTest.cxx
index cb6c6d25d80a..9bbe10a5cea7 100644
--- a/vcl/qa/cppunit/GraphicDescriptorTest.cxx
+++ b/vcl/qa/cppunit/GraphicDescriptorTest.cxx
@@ -33,12 +33,14 @@ class GraphicDescriptorTest : public test::BootstrapFixtureBase
void testDetectJPG();
void testDetectGIF();
void testDetectBMP();
+ void testDetectWEBP();
CPPUNIT_TEST_SUITE(GraphicDescriptorTest);
CPPUNIT_TEST(testDetectPNG);
CPPUNIT_TEST(testDetectJPG);
CPPUNIT_TEST(testDetectGIF);
CPPUNIT_TEST(testDetectBMP);
+ CPPUNIT_TEST(testDetectWEBP);
CPPUNIT_TEST_SUITE_END();
};
@@ -122,6 +124,20 @@ void GraphicDescriptorTest::testDetectBMP()
CPPUNIT_ASSERT_EQUAL(MapUnit::MapMM, aGraphic.GetPrefMapMode().GetMapUnit());
}
+void GraphicDescriptorTest::testDetectWEBP()
+{
+ SvMemoryStream aStream;
+ createBitmapAndExportForType(aStream, u"webp");
+
+ GraphicDescriptor aDescriptor(aStream, nullptr);
+ aDescriptor.Detect(true);
+
+ CPPUNIT_ASSERT_EQUAL(GraphicFileFormat::WEBP, aDescriptor.GetFileFormat());
+
+ CPPUNIT_ASSERT_EQUAL(tools::Long(100), aDescriptor.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(100), aDescriptor.GetSizePixel().Height());
+}
+
} // namespace
CPPUNIT_TEST_SUITE_REGISTRATION(GraphicDescriptorTest);