summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-11-10 16:32:32 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-11-10 20:39:03 +0100
commit7930ad202edb8e7af2946fc428268b000edae23e (patch)
tree4e2fb446a9ce7728028eb64b23d30730fa33801f /sc
parent4185c33788926efe5514cca3ce64a3a8a5d89eac (diff)
tdf#119155: sc: move UItest to CppUnittest
Change-Id: Id6d162d4348caf512e78eb957034e79f0c2dbc6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125002 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/textCase/textCase.py14
-rw-r--r--sc/qa/unit/uicalc/data/tdf119155.xlsx (renamed from sc/qa/uitest/data/tdf119155.xlsx)bin5944 -> 5944 bytes
-rw-r--r--sc/qa/unit/uicalc/uicalc.cxx18
3 files changed, 18 insertions, 14 deletions
diff --git a/sc/qa/uitest/textCase/textCase.py b/sc/qa/uitest/textCase/textCase.py
index fd208e67f607..7dbb6d2a41d5 100644
--- a/sc/qa/uitest/textCase/textCase.py
+++ b/sc/qa/uitest/textCase/textCase.py
@@ -123,20 +123,6 @@ class textCase(UITestCase):
self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite")
- def test_tdf119155_Capitalize_Every_Word(self):
- #Bug 119155 - Freeze after command format->text->Capitalize Every Word
- with self.ui_test.load_file(get_url_for_data_file("tdf119155.xlsx")) as calc_doc:
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- #1. Open attached file
- #2. Select cells from C2 to C14
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:C14"}))
- #3. Go to menu: Format->Text->Capitalize Every Word
- self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
- #Actual Results:Freezes LibreOffice
- self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getString(), "Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 13).getString(), "Vitamina Suractivee Hand Cream 400 Ml")
-
def test_tdf119162_Cycle_Case(self):
#Bug 119162 - Format > Text > Cycle Case on attached example file hangs Calc reproducibly
with self.ui_test.load_file(get_url_for_data_file("tdf119162.xls")) as calc_doc:
diff --git a/sc/qa/uitest/data/tdf119155.xlsx b/sc/qa/unit/uicalc/data/tdf119155.xlsx
index 8deb480f79e0..8deb480f79e0 100644
--- a/sc/qa/uitest/data/tdf119155.xlsx
+++ b/sc/qa/unit/uicalc/data/tdf119155.xlsx
Binary files differ
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index fbcfb2f59511..ef3b8dd24959 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -166,6 +166,24 @@ ScModelObj* ScUiCalcTest::saveAndReload(css::uno::Reference<css::lang::XComponen
return pModelObj;
}
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf119155)
+{
+ ScModelObj* pModelObj = createDoc("tdf119155.xlsx");
+ ScDocument* pDoc = pModelObj->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+
+ goToCell("C2:C14");
+
+ // Without the fix in place, this test would have hung here
+ dispatchCommand(mxComponent, ".uno:ChangeCaseToTitleCase", {});
+ Scheduler::ProcessEventsToIdle();
+
+ CPPUNIT_ASSERT_EQUAL(OUString("Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml"),
+ pDoc->GetString(ScAddress(2, 1, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("Vitamina Suractivee Hand Cream 400 Ml"),
+ pDoc->GetString(ScAddress(2, 13, 0)));
+}
+
CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf138432)
{
ScModelObj* pModelObj = createDoc("tdf138432.ods");