diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2016-07-21 16:12:47 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-08-18 02:39:12 +0200 |
commit | dc1e30095fa02fa4116fa96783bd4d51fe912473 (patch) | |
tree | 8383d5253dda2c340b4de2ebf90969f907bf54e3 /include | |
parent | d098f0c957824bd5dec89a799398d587ce9fb96f (diff) |
screenshots: fallback screenshot to ui files
Besides the already existing methods to dump adapted dialogs
and create and dump fallback dialogs I added a possibility to
process a given input file which may contain a list of
UXMLDescription files (*.ui files), one per line. This file
is processed (empty lines and comment lines using '#' allowed)
and for each descriptor first tries to find a known, adapted
dialog. If found it gets used, else fallback is tried.
Added ui-definition files for sd and sc which contain all
ui-files from these dialogs. Adapted the test base class to
hold the needed functionality.
Change-Id: I1d4c64af8cd5d9c89a53b193951c3e49669f5852
Diffstat (limited to 'include')
-rw-r--r-- | include/test/screenshot_test.hxx | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx index a3b0b0e6eee7..443db3102bd5 100644 --- a/include/test/screenshot_test.hxx +++ b/include/test/screenshot_test.hxx @@ -16,18 +16,46 @@ #include <com/sun/star/lang/XComponent.hpp> #include <osl/file.hxx> #include <vcl/dialog.hxx> +#include <map> class VclAbstractDialog; - +typedef std::map< OString, sal_uInt32 > mapType; class OOO_DLLPUBLIC_TEST ScreenshotTest : public test::BootstrapFixture, public unotest::MacrosTest { +private: + /// the target directory for screenshots + OUString m_aScreenshotDirectory; + + /// the set of known dialogs and their ID for usage in createDialogByID + mapType maKnownDialogs; + +private: + /// helpers + void implSaveScreenshot(const Bitmap& rScreenshot, const OString& rScreenshotId); + void saveScreenshot(VclAbstractDialog& rDialog); + void saveScreenshot(Dialog& rDialog); + + /// helper method to populate maKnownDialogs, called in setUp(). Needs to be + /// written and has to add entries to maKnownDialogs + virtual void registerKnownDialogsByID(mapType& rKnownDialogs) = 0; + + /// dialog creation for known dialogs by ID. Has to be implemented for + /// each registered known dialog + virtual VclAbstractDialog* createDialogByID(sal_uInt32 nID) = 0; + public: ScreenshotTest(); + virtual ~ScreenshotTest(); virtual void setUp() override; virtual void tearDown() override; + /// Dialog creation for known dialogs by Name (path and UIXMLDescription, *.ui file). + /// This uses maKnownDialogs to check if known, and if so, calls createDialogByID + /// with the ID from the map + VclAbstractDialog* createDialogByName(const OString& rName); + /// version for AbstractDialogs, the ones created in AbstractDialogFactories void dumpDialogToPath(VclAbstractDialog& rDialog); @@ -40,12 +68,8 @@ public: /// compared to the active dialog (can be compared with dialog previewer) void dumpDialogToPath(const OString& rUIXMLDescription); -private: - void implSaveScreenshot(const Bitmap& rScreenshot, const OString& rScreenshotId); - void saveScreenshot(VclAbstractDialog& rDialog); - void saveScreenshot(Dialog& rDialog); - - OUString m_aScreenshotDirectory; + /// const access to known dialogs + const mapType& getKnownDialogs() const { return maKnownDialogs; } }; #endif // INCLUDED_TEST_SCREENSHOT_TEST_HXX |