[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 27 16:49:46 UTC 2020


 sw/qa/extras/uiwriter/uiwriter3.cxx     |   16 +++++++++++
 sw/qa/uitest/writer_tests6/tdf126626.py |   43 --------------------------------
 2 files changed, 16 insertions(+), 43 deletions(-)

New commits:
commit ab623953b92d82d615bd2af6a9369915fe6fb7a8
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Feb 27 16:32:35 2020 +0100
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Thu Feb 27 17:49:13 2020 +0100

    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 at libreoffice.org>

diff --git a/sw/qa/uitest/writer_tests/data/tdf126626.docx b/sw/qa/extras/uiwriter/data3/tdf126626.docx
similarity index 100%
rename from sw/qa/uitest/writer_tests/data/tdf126626.docx
rename to sw/qa/extras/uiwriter/data3/tdf126626.docx
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:


More information about the Libreoffice-commits mailing list