summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-02-27 18:01:14 +0100
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-02-28 10:04:00 +0100
commit4a33c86a5b44184a3ed34398cd795a9d42ac1a72 (patch)
tree737c6512d526755f42adf986a97732b2fbc39832
parentf4873d0e7972ec3ee646aa0d847c626ebe7d857f (diff)
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@libreoffice.org>
-rw-r--r--sw/qa/extras/uiwriter/data3/tdf128739.docx (renamed from sw/qa/uitest/writer_tests7/data/tdf128739.docx)bin4375 -> 4375 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter3.cxx14
-rw-r--r--sw/qa/uitest/writer_tests7/tdf128739.py28
3 files changed, 14 insertions, 28 deletions
diff --git a/sw/qa/uitest/writer_tests7/data/tdf128739.docx b/sw/qa/extras/uiwriter/data3/tdf128739.docx
index cf5d00f91f28..cf5d00f91f28 100644
--- a/sw/qa/uitest/writer_tests7/data/tdf128739.docx
+++ b/sw/qa/extras/uiwriter/data3/tdf128739.docx
Binary files differ
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: