summaryrefslogtreecommitdiff
path: root/include/test/screenshot_test.hxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2016-07-15 15:25:59 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-08-18 02:39:11 +0200
commitd098f0c957824bd5dec89a799398d587ce9fb96f (patch)
treeca0f4ebf78b2a1bf2d6a3ee5e5c278738fc3b4e2 /include/test/screenshot_test.hxx
parent836a77e5d6fdad5b74d296d5b55a6b0c8f016ade (diff)
screenshots: Use UI string and fallback for UI-String only
Two changes in this commit: The Dialogs to be dumped are identified in their test files using their UXMLDescription to allow later to 'find' the known dialogs and use the specialized construction for these. Also added a fallback to construct a vcl Dialog based on only the UXMLDescription and the VclBuilder. This will be constructed without any active initialization/layouting, so should only be used for unknown Dialogs. Also added a dumpDialogToPath version to the tooling that can work directly with a vcl Dialog instead of a VclAbstractDialog. Change-Id: I90abb6f59c2fcc5d534907ae7e4b9a15edc2d694
Diffstat (limited to 'include/test/screenshot_test.hxx')
-rw-r--r--include/test/screenshot_test.hxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx
index f07c29a9e65b..a3b0b0e6eee7 100644
--- a/include/test/screenshot_test.hxx
+++ b/include/test/screenshot_test.hxx
@@ -15,6 +15,7 @@
#include <unotest/macros_test.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <osl/file.hxx>
+#include <vcl/dialog.hxx>
class VclAbstractDialog;
@@ -27,10 +28,23 @@ public:
virtual void setUp() override;
virtual void tearDown() override;
- void dumpDialogToPath( VclAbstractDialog& rDialog );
+ /// version for AbstractDialogs, the ones created in AbstractDialogFactories
+ void dumpDialogToPath(VclAbstractDialog& rDialog);
+
+ /// version for pure vcl-based dialogs
+ void dumpDialogToPath(Dialog& rDialog);
+
+ /// fallback version for dialogs for which only the UXMLDescription is known.
+ /// This should be used with care - no active layouting will be done, only the
+ /// VclBuilder will be activated for layouting. Result can thus vary drastically
+ /// compared to the active dialog (can be compared with dialog previewer)
+ void dumpDialogToPath(const OString& rUIXMLDescription);
private:
- void saveScreenshot( VclAbstractDialog& rDialog );
+ void implSaveScreenshot(const Bitmap& rScreenshot, const OString& rScreenshotId);
+ void saveScreenshot(VclAbstractDialog& rDialog);
+ void saveScreenshot(Dialog& rDialog);
+
OUString m_aScreenshotDirectory;
};