summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorZdeněk Crhonek <zcrhonek@gmail.com>2019-01-03 16:23:13 +0100
committerZdenek Crhonek <zcrhonek@gmail.com>2019-01-03 18:32:52 +0100
commitdd2972d4c323afddc1eca90c88fe6240f40685dd (patch)
tree611399a2a8817e9fb741d4bda64c401611c84b95 /sc
parentAvoid getTokenCount (diff)
downloadcore-dd2972d4c323afddc1eca90c88fe6240f40685dd.tar.gz
core-dd2972d4c323afddc1eca90c88fe6240f40685dd.zip
uitest for bug tdf#99069
Change-Id: Ic117937629b465227c564158b7c24270997cce78 Reviewed-on: https://gerrit.libreoffice.org/65839 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/Module_sc.mk1
-rw-r--r--sc/UITest_chart.mk20
-rw-r--r--sc/qa/uitest/calc_tests/data/tdf99069.odsbin0 -> 15963 bytes
-rw-r--r--sc/qa/uitest/chart/tdf99069.py78
4 files changed, 99 insertions, 0 deletions
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index a80e9419b513..84ab0d759596 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -232,6 +232,7 @@ $(eval $(call gb_Module_add_uicheck_targets,sc,\
UITest_hideShowSheet \
UITest_calc_tests7 \
UITest_sort \
+ UITest_chart \
))
endif
diff --git a/sc/UITest_chart.mk b/sc/UITest_chart.mk
new file mode 100644
index 000000000000..3e380391924b
--- /dev/null
+++ b/sc/UITest_chart.mk
@@ -0,0 +1,20 @@
+# -*- 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,chart))
+
+$(eval $(call gb_UITest_add_modules,chart,$(SRCDIR)/sc/qa/uitest,\
+ chart/ \
+))
+
+$(eval $(call gb_UITest_set_defs,chart, \
+ TDOC="$(SRCDIR)/sc/qa/uitest/calc_tests/data" \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/qa/uitest/calc_tests/data/tdf99069.ods b/sc/qa/uitest/calc_tests/data/tdf99069.ods
new file mode 100644
index 000000000000..9c4fbda4a488
--- /dev/null
+++ b/sc/qa/uitest/calc_tests/data/tdf99069.ods
Binary files differ
diff --git a/sc/qa/uitest/chart/tdf99069.py b/sc/qa/uitest/chart/tdf99069.py
new file mode 100644
index 000000000000..e3530c8c1920
--- /dev/null
+++ b/sc/qa/uitest/chart/tdf99069.py
@@ -0,0 +1,78 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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 uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.debug import sleep
+import org.libreoffice.unotest
+import pathlib
+
+def get_url_for_data_file(file_name):
+ return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+
+#Bug 99069 - assertion "SolarMutex not locked" from <Cancel> Data Ranges dialog
+
+class tdf99069(UITestCase):
+ def test_tdf99069_chart_cancel_data_ranges_dialog(self):
+ calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99069.ods"))
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #(1) Download and open example.ods attached to tdf#97266 with cell B1 active.
+ #(2) In tool bar, click the chart icon. Program presents Chart Wizard.
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #(3) In Chart Wizard, click <Finish>. The program closes the wizard;
+ # the chart shows a border with handles on each side and at each corner.
+ xFinishBtn = xDialog.getChild("finish")
+ self.ui_test.close_dialog_through_button(xFinishBtn)
+ for _ in range(0,5):
+ #(4) Click outside the chart, for example in cell C23. The borders
+ #disappear from the chart and the program restores the menubar to
+ #the window. (Yes, this step is necessary to the crash.)
+ gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C23"}))
+ #(5) Double-click on the chart. The program shows a border around the
+ # chart. (It may be necessary to do this a second time before the
+ # pop-up menu will offer "Data Ranges...".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+
+ #(6) Right-click on the chart; from the pop-up menu select "Data
+ # Ranges...". The program presents dialog "Data Ranges", tab "Data Range".
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DataRanges"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ #(7) Click on tab "Data Series". (Actually, tab "Data Range" crashes,
+ # too. This step is just a remnant of what I was doing when I
+ # stumbled over the bug.)
+ notebook = xDialog.getChild("notebook")
+ select_pos(notebook, "0")
+ select_pos(notebook, "1")
+
+ #(8) Click <Cancel>. In the versions that I deemed bad while
+ # bibisecting, the program crashed here five times out of seven.
+ # The other two attempts, both on daily bibisect version 2016-02-18,
+ # crashed after I closed the Data Ranges dialog an additional three
+ # times, one of those times using by typing <Esc>.
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+
+ #verify - we didn't crash
+ gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 0.529084)
+
+ self.ui_test.close_doc()
+# vim: set shiftwidth=4 softtabstop=4 expandtab: