summaryrefslogtreecommitdiff
path: root/test/source/screenshot_test.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2016-07-21 16:12:47 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-08-18 02:39:12 +0200
commitdc1e30095fa02fa4116fa96783bd4d51fe912473 (patch)
tree8383d5253dda2c340b4de2ebf90969f907bf54e3 /test/source/screenshot_test.cxx
parentd098f0c957824bd5dec89a799398d587ce9fb96f (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 'test/source/screenshot_test.cxx')
-rw-r--r--test/source/screenshot_test.cxx28
1 files changed, 26 insertions, 2 deletions
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index e33cf21b6545..92f48ee28823 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -33,7 +33,12 @@ using namespace css;
using namespace css::uno;
ScreenshotTest::ScreenshotTest()
- : m_aScreenshotDirectory("/workdir/screenshots/")
+: m_aScreenshotDirectory("/workdir/screenshots/"),
+ maKnownDialogs()
+{
+}
+
+ScreenshotTest::~ScreenshotTest()
{
}
@@ -46,6 +51,12 @@ void ScreenshotTest::setUp()
osl::FileBase::RC err = osl::Directory::create( m_directories.getURLFromSrc( m_aScreenshotDirectory ) );
CPPUNIT_ASSERT_MESSAGE( "Failed to create screenshot directory", (err == osl::FileBase::E_None || err == osl::FileBase::E_EXIST) );
+
+ // initialize maKnownDialogs
+ if (maKnownDialogs.empty())
+ {
+ registerKnownDialogsByID(maKnownDialogs);
+ }
}
void ScreenshotTest::tearDown()
@@ -101,6 +112,19 @@ void ScreenshotTest::saveScreenshot(Dialog& rDialog)
}
}
+VclAbstractDialog* ScreenshotTest::createDialogByName(const OString& rName)
+{
+ VclAbstractDialog* pRetval = nullptr;
+ const mapType::const_iterator aHit = maKnownDialogs.find(rName);
+
+ if (aHit != maKnownDialogs.end())
+ {
+ return createDialogByID((*aHit).second);
+ }
+
+ return pRetval;
+}
+
void ScreenshotTest::dumpDialogToPath(VclAbstractDialog& rDialog)
{
const std::vector<OString> aPageDescriptions(rDialog.getAllPageUIXMLDescriptions());