From 920b347a088452e7220f0381bee114ec75bab241 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 29 Apr 2019 07:48:43 +0900 Subject: Add MetaActionWallpaper to the SVM test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icce9c3c5fa826b6f5237d2d0e28fc51555a3e267 Reviewed-on: https://gerrit.libreoffice.org/71494 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/qa/cppunit/svm/svmtest.cxx | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 50aa78fcfc2f..d8d9adf7b72b 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -108,7 +108,7 @@ class SvmTest : public test::BootstrapFixture, public XmlTestTools void checkHatch(const GDIMetaFile& rMetaFile); void testHatch(); - //void checkWallpaper(const GDIMetaFile& rMetaFile); + void checkWallpaper(const GDIMetaFile& rMetaFile); void testWallpaper(); //void checkClipRegion(const GDIMetaFile& rMetaFile); @@ -1239,8 +1239,40 @@ void SvmTest::testHatch() checkHatch(writeAndRead(aGDIMetaFile, "hatch.svm")); } +void SvmTest::checkWallpaper(const GDIMetaFile& rMetaFile) +{ + xmlDocPtr pDoc = dumpMeta(rMetaFile); + + // Fuuny enough - we don't serialize the rectangle of the wallpaper so it's always EMPTY + assertXPathAttrs(pDoc, "/metafile/wallpaper[1]", + { + {"left", "0"}, + {"top", "0"}, + {"right", "-32767"}, + {"bottom", "-32767"}, + }); + + assertXPathAttrs(pDoc, "/metafile/wallpaper[1]/wallpaper", + { + {"color", "#00ff00"}, + {"style", "Tile"}, + {"fixed", "true"}, + {"scrollable", "true"}, + }); +} + void SvmTest::testWallpaper() -{} +{ + GDIMetaFile aGDIMetaFile; + ScopedVclPtrInstance pVirtualDev; + setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile); + + Wallpaper aWallpaper(COL_LIGHTGREEN); + pVirtualDev->DrawWallpaper(tools::Rectangle(Point(1, 1), Size(3, 3)), aWallpaper); + + checkWallpaper(writeAndRead(aGDIMetaFile, "wallpaper.svm")); +} + void SvmTest::testClipRegion() {} void SvmTest::testIntersectRectClipRegion() -- cgit v1.2.3