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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 28 09:04:33 UTC 2020


 sw/qa/extras/uiwriter/uiwriter3.cxx     |   14 ++++++++++++++
 sw/qa/uitest/writer_tests7/tdf128739.py |   28 ----------------------------
 2 files changed, 14 insertions(+), 28 deletions(-)

New commits:
commit 4a33c86a5b44184a3ed34398cd795a9d42ac1a72
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Feb 27 18:01:14 2020 +0100
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Fri Feb 28 10:04:00 2020 +0100

    tdf#128739: move UItest to CppunitTest
    
    Change-Id: I597576c46ea4387d55f9ef576d05a84c88af1776
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89646
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sw/qa/uitest/writer_tests7/data/tdf128739.docx b/sw/qa/extras/uiwriter/data3/tdf128739.docx
similarity index 100%
rename from sw/qa/uitest/writer_tests7/data/tdf128739.docx
rename to sw/qa/extras/uiwriter/data3/tdf128739.docx
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 5ca1eda7c42a..8e969a42f309 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -49,4 +49,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626)
     // without the fix, it crashes
     dispatchCommand(mxComponent, ".uno:Paste", {});
 }
+
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf128739)
+{
+    load(DATA_DIRECTORY, "tdf128739.docx");
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+
+    dispatchCommand(mxComponent, ".uno:SelectAll", {});
+    dispatchCommand(mxComponent, ".uno:Cut", {});
+    dispatchCommand(mxComponent, ".uno:Paste", {});
+    // without the fix, it crashes
+    dispatchCommand(mxComponent, ".uno:Undo", {});
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/uitest/writer_tests7/tdf128739.py b/sw/qa/uitest/writer_tests7/tdf128739.py
deleted file mode 100644
index 64a394a07a63..000000000000
--- a/sw/qa/uitest/writer_tests7/tdf128739.py
+++ /dev/null
@@ -1,28 +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 uitest.path import get_srcdir_url
-
-def get_url_for_data_file(file_name):
-   return get_srcdir_url() + "/sw/qa/uitest/writer_tests7/data/" + file_name
-
-class tdf128739 (UITestCase):
-
-    def test_mark_cut_paste_undo_with_markers_tdf128739 (self):
-
-        self.ui_test.load_file(get_url_for_data_file("tdf128739.docx"))
-        xWriterDoc = self.xUITest.getTopFocusWindow()
-        xWriterDoc.getChild("writer_edit")
-
-        self.xUITest.executeCommand(".uno:SelectAll")
-        self.xUITest.executeCommand(".uno:Cut")
-        self.xUITest.executeCommand(".uno:Paste")
-        self.xUITest.executeCommand(".uno:Undo")
-
-        self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list