summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-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());