diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-04-29 07:48:43 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-04-29 03:52:51 +0200 |
commit | 920b347a088452e7220f0381bee114ec75bab241 (patch) | |
tree | 13103c1915c56b942623485c317ea98cc819deec /vcl/qa | |
parent | 654a7ad5420ca26f90f449122fa96ea2a53af0cf (diff) |
Add MetaActionWallpaper to the SVM test
Change-Id: Icce9c3c5fa826b6f5237d2d0e28fc51555a3e267
Reviewed-on: https://gerrit.libreoffice.org/71494
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/svm/svmtest.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
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<VirtualDevice> 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() |