diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-08 14:31:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-09 13:15:08 +0200 |
commit | dc78b82db539401cc7e63d96f4727e1e884b86cb (patch) | |
tree | 6421310e52bf4daa2719c6f16d107cfd3823f6d9 /cui/qa/unit | |
parent | 9bb0219e8284a99dd1caf6aa50cd9a5b85e8f7a3 (diff) |
Related: tdf#123765 fix up some screenshotting
and add in two special cases for the mentioned cui dialogs
Change-Id: Ibd2bf8e9e5bff131f2c009c784652f4500842326
Reviewed-on: https://gerrit.libreoffice.org/80488
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/qa/unit')
-rw-r--r-- | cui/qa/unit/cui-dialogs-test.cxx | 48 | ||||
-rw-r--r-- | cui/qa/unit/data/cui-dialogs-test.txt | 4 | ||||
-rw-r--r-- | cui/qa/unit/data/cui-dialogs-test_2.txt | 2 | ||||
-rw-r--r-- | cui/qa/unit/data/cui-dialogs-test_4.txt | 1 |
4 files changed, 48 insertions, 7 deletions
diff --git a/cui/qa/unit/cui-dialogs-test.cxx b/cui/qa/unit/cui-dialogs-test.cxx index 8a485cce9850..781dc364a960 100644 --- a/cui/qa/unit/cui-dialogs-test.cxx +++ b/cui/qa/unit/cui-dialogs-test.cxx @@ -12,6 +12,8 @@ #include <rtl/strbuf.hxx> #include <osl/file.hxx> #include <sfx2/app.hxx> +#include <svx/svdmodel.hxx> +#include <svx/svxdlg.hxx> #include <vcl/abstdlg.hxx> using namespace ::com::sun::star; @@ -20,6 +22,12 @@ using namespace ::com::sun::star; class CuiDialogsTest : public ScreenshotTest { private: + std::unique_ptr<SdrModel> mxModel; + std::unique_ptr<SfxItemSet> mxAttr; + SvxAbstractDialogFactory* mpFact; + + void initialize(); + /// helper method to populate KnownDialogs, called in setUp(). Needs to be /// written and has to add entries to KnownDialogs virtual void registerKnownDialogsByID(mapType& rKnownDialogs) override; @@ -43,18 +51,52 @@ CuiDialogsTest::CuiDialogsTest() { } -void CuiDialogsTest::registerKnownDialogsByID(mapType& /*rKnownDialogs*/) +void CuiDialogsTest::initialize() +{ + mpFact = SvxAbstractDialogFactory::Create(); + mxModel.reset(new SdrModel(nullptr, nullptr, true)); + mxModel->GetItemPool().FreezeIdRanges(); + mxAttr.reset(new SfxItemSet(mxModel->GetItemPool())); +} + +void CuiDialogsTest::registerKnownDialogsByID(mapType& rKnownDialogs) { // fill map of known dialogs + rKnownDialogs["cui/ui/formatcellsdialog.ui"] = 0; + rKnownDialogs["cui/ui/textdialog.ui"] = 1; } -VclPtr<VclAbstractDialog> CuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/) +VclPtr<VclAbstractDialog> CuiDialogsTest::createDialogByID(sal_uInt32 nID) { - return nullptr; + VclPtr<VclAbstractDialog> pReturnDialog; + + switch ( nID ) + { + case 0: // "cui/ui/formatcellsdialog.ui" + { + pReturnDialog = mpFact->CreateSvxFormatCellsDialog( + nullptr, mxAttr.get(), *mxModel, nullptr); + break; + } + + case 1: // "cui/ui/textdialog.ui" + { + pReturnDialog = mpFact->CreateTextTabDialog( + nullptr, mxAttr.get(), nullptr); + break; + } + + default: + break; + } + + return pReturnDialog; } void CuiDialogsTest::openAnyDialog() { + initialize(); + /// process input file containing the UXMLDescriptions of the dialogs to dump processDialogBatchFile("cui/qa/unit/data/cui-dialogs-test.txt"); } diff --git a/cui/qa/unit/data/cui-dialogs-test.txt b/cui/qa/unit/data/cui-dialogs-test.txt index 8bab3ce88f5f..b9f8f99813f6 100644 --- a/cui/qa/unit/data/cui-dialogs-test.txt +++ b/cui/qa/unit/data/cui-dialogs-test.txt @@ -23,7 +23,8 @@ # in registerKnownDialogsByID/createDialogByID # -# No known dialogs in cui for now +cui/ui/formatcellsdialog.ui +cui/ui/textdialog.ui # # Dialogs without a hard-coded representation. These will @@ -97,4 +98,3 @@ cui/ui/effectspage.ui cui/ui/embossdialog.ui cui/ui/eventassigndialog.ui cui/ui/eventassignpage.ui -cui/ui/eventsconfigpage.ui diff --git a/cui/qa/unit/data/cui-dialogs-test_2.txt b/cui/qa/unit/data/cui-dialogs-test_2.txt index 5d87d13ffb73..bccb005632fc 100644 --- a/cui/qa/unit/data/cui-dialogs-test_2.txt +++ b/cui/qa/unit/data/cui-dialogs-test_2.txt @@ -11,8 +11,8 @@ # covering f to n +cui/ui/eventsconfigpage.ui cui/ui/fmsearchdialog.ui -cui/ui/formatcellsdialog.ui cui/ui/galleryapplyprogress.ui cui/ui/galleryfilespage.ui cui/ui/gallerygeneralpage.ui diff --git a/cui/qa/unit/data/cui-dialogs-test_4.txt b/cui/qa/unit/data/cui-dialogs-test_4.txt index eaa3a6ce3dd8..a537b2b09d1e 100644 --- a/cui/qa/unit/data/cui-dialogs-test_4.txt +++ b/cui/qa/unit/data/cui-dialogs-test_4.txt @@ -63,7 +63,6 @@ cui/ui/storedwebconnectiondialog.ui cui/ui/swpossizepage.ui cui/ui/textanimtabpage.ui cui/ui/textattrtabpage.ui -cui/ui/textdialog.ui cui/ui/textflowpage.ui cui/ui/transparencytabpage.ui cui/ui/tsaurldialog.ui |