summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-21 18:16:46 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-21 22:22:39 +0200
commit9d98df77ec7b62e8847f5bad8c98983493018a4f (patch)
treeec3875effe6ba341293c7cce5506bf9f1d1b6444 /writerperfect
parent462454b7e0aea2d067352e33f320198a850e0127 (diff)
writerperfect: add initial UITest_writerperfect_epubexport
Fails when EPUBExportDialog::VersionSelectHdl() does not take the version from the VCL widget. Change-Id: I8f77643ffbd7766ecec7bc2e148259765ab635b8 Reviewed-on: https://gerrit.libreoffice.org/42600 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/Module_writerperfect.mk4
-rw-r--r--writerperfect/UITest_writerperfect_epubexport.mk16
-rw-r--r--writerperfect/qa/uitest/epubexport/epubexport.py30
-rw-r--r--writerperfect/source/writer/EPUBExportUIComponent.cxx2
4 files changed, 52 insertions, 0 deletions
diff --git a/writerperfect/Module_writerperfect.mk b/writerperfect/Module_writerperfect.mk
index 015c3fdda44b..01f8a0dc5e59 100644
--- a/writerperfect/Module_writerperfect.mk
+++ b/writerperfect/Module_writerperfect.mk
@@ -47,4 +47,8 @@ $(eval $(call gb_Module_add_slowcheck_targets,writerperfect,\
Library_wpftqahelper \
))
+$(eval $(call gb_Module_add_uicheck_targets,writerperfect,\
+ UITest_writerperfect_epubexport \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/UITest_writerperfect_epubexport.mk b/writerperfect/UITest_writerperfect_epubexport.mk
new file mode 100644
index 000000000000..ebec0bf7613d
--- /dev/null
+++ b/writerperfect/UITest_writerperfect_epubexport.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UITest_UITest,writerperfect_epubexport))
+
+$(eval $(call gb_UITest_add_modules,writerperfect_epubexport,$(SRCDIR)/writerperfect/qa/uitest,\
+ epubexport/ \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/writerperfect/qa/uitest/epubexport/epubexport.py b/writerperfect/qa/uitest/epubexport/epubexport.py
new file mode 100644
index 000000000000..67437b48f827
--- /dev/null
+++ b/writerperfect/qa/uitest/epubexport/epubexport.py
@@ -0,0 +1,30 @@
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.framework import UITestCase
+
+
+def handleDialog(dialog):
+ # Select the second entry to request EPUB2, not EPUB3.
+ dialog.getChild("versionlb").executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+ dialog.getChild("ok").executeAction("CLICK", tuple())
+
+
+# Test for EPUBExportDialog and EPUBExportUIComponent.
+class EPUBExportTest(UITestCase):
+
+ def testUIComponent(self):
+
+ uiComponent = self.ui_test._xContext.ServiceManager.createInstanceWithContext("com.sun.star.comp.Writer.EPUBExportUIComponent", self.ui_test._xContext)
+ self.ui_test.execute_blocking_action(action=uiComponent.execute, dialog_handler=handleDialog)
+ propertyValues = uiComponent.getPropertyValues()
+ filterData = [i.Value for i in propertyValues if i.Name == "FilterData"][0]
+ epubVersion = [i.Value for i in filterData if i.Name == "EPUBVersion"][0]
+ # This was 30, EPUBExportDialog::VersionSelectHdl() did not set the version.
+ self.assertEqual(20, epubVersion)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/writerperfect/source/writer/EPUBExportUIComponent.cxx b/writerperfect/source/writer/EPUBExportUIComponent.cxx
index 0be6aacc1ca8..b38ebf799859 100644
--- a/writerperfect/source/writer/EPUBExportUIComponent.cxx
+++ b/writerperfect/source/writer/EPUBExportUIComponent.cxx
@@ -74,6 +74,8 @@ void EPUBExportUIComponent::setTitle(const OUString &/*rTitle*/)
sal_Int16 EPUBExportUIComponent::execute()
{
+ SolarMutexGuard aGuard;
+
ScopedVclPtrInstance<EPUBExportDialog> pDialog(Application::GetDefDialogParent(), maFilterData);
if (pDialog->Execute() == RET_OK)
return ui::dialogs::ExecutableDialogResults::OK;