summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-02-27 16:32:35 +0100
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-02-27 17:49:13 +0100
commitab623953b92d82d615bd2af6a9369915fe6fb7a8 (patch)
tree4a57932bf4d30fddf1e7fa31aff01c3f75187536
parentdc5be8f6020dd812664af250d03d2a14b9e8a3cb (diff)
tdf#126626: move UItest to CppunitTest
Change-Id: I51a95a03e04682967bdab01062bec17039b609a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89641 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf126626.docx (renamed from sw/qa/uitest/writer_tests/data/tdf126626.docx)bin16513 -> 16513 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx16
-rw-r--r--sw/qa/uitest/writer_tests6/tdf126626.py43
3 files changed, 16 insertions, 43 deletions
diff --git a/sw/qa/uitest/writer_tests/data/tdf126626.docx b/sw/qa/extras/uiwriter/data3/tdf126626.docx
index a2a289c2daca..a2a289c2daca 100644
--- a/sw/qa/uitest/writer_tests/data/tdf126626.docx
+++ b/sw/qa/extras/uiwriter/data3/tdf126626.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 1d6e351b614a..5ca1eda7c42a 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -33,4 +33,20 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf129382)
// without the fix, it crashes
dispatchCommand(mxComponent, ".uno:Undo", {});
}
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626)
+{
+ load(DATA_DIRECTORY, "tdf126626.docx");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ dispatchCommand(mxComponent, ".uno:SelectAll", {});
+ dispatchCommand(mxComponent, ".uno:Copy", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+ dispatchCommand(mxComponent, ".uno:Undo", {});
+ // without the fix, it crashes
+ dispatchCommand(mxComponent, ".uno:Paste", {});
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/uitest/writer_tests6/tdf126626.py b/sw/qa/uitest/writer_tests6/tdf126626.py
deleted file mode 100644
index bd06951027ea..000000000000
--- a/sw/qa/uitest/writer_tests6/tdf126626.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_state_as_dict, type_text
-import time
-from uitest.debug import sleep
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import select_pos
-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 126626 - CRASH: pasting fly at-char selection
-
-class tdf126626(UITestCase):
- def test_tdf126626_crash_paste(self):
- writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf126626.docx"))
- document = self.ui_test.get_component()
- xWriterDoc = self.xUITest.getTopFocusWindow()
- xWriterEdit = xWriterDoc.getChild("writer_edit")
-
- # 2. Select all
- self.xUITest.executeCommand(".uno:SelectAll")
- # 3. Copy
- self.xUITest.executeCommand(".uno:Copy")
- # 4. Paste TWO TIMES
- self.xUITest.executeCommand(".uno:Paste")
- self.xUITest.executeCommand(".uno:Paste")
- # 5. Undo once
- self.xUITest.executeCommand(".uno:Undo")
- # 6. Paste
- self.xUITest.executeCommand(".uno:Paste")
- #-> Crash
- self.assertEqual(document.CurrentController.PageCount, 1)
-
- self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: