tdf#139974: sc: fix test

See https://gerrit.libreoffice.org/c/core/+/128651

Change-Id: Ib38890351d7fb83ab4bffebfa9564427c16b6bcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128874
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sc/qa/uitest/inputLine/tdf139974.py b/sc/qa/uitest/calc_tests3/tdf139974.py
similarity index 65%
rename from sc/qa/uitest/inputLine/tdf139974.py
rename to sc/qa/uitest/calc_tests3/tdf139974.py
index 25f57b3..1e7009b 100644
--- a/sc/qa/uitest/inputLine/tdf139974.py
+++ b/sc/qa/uitest/calc_tests3/tdf139974.py
@@ -17,38 +17,32 @@ class tdf139974(UITestCase):

        with self.ui_test.load_file(get_url_for_data_file("tdf139974.ods")) as document:

            self.assertEqual(1929753068859.0, get_cell_by_position(document, 0, 0, 0).getValue())
            self.assertEqual(1930864179960.0, get_cell_by_position(document, 0, 0, 0).getValue())
            self.assertEqual(17204.0, get_cell_by_position(document, 0, 1, 0).getValue())

            xCalcDoc = self.xUITest.getTopFocusWindow()
            gridwin = xCalcDoc.getChild("grid_window")
            gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))

            # Move focus to the input line
            gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+SHIFT+F2"}))

            xInputWin = xCalcDoc.getChild("sc_input_window")
            self.assertEqual('true', get_state_as_dict(xInputWin)["HasFocus"])
            self.assertEqual(17204, len(get_state_as_dict(xInputWin)["Text"]))
            gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F2"}))

            self.xUITest.executeCommand(".uno:SelectAll")
            self.xUITest.executeCommand(".uno:Copy")

            gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"}))

            gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))

            # Move focus to the input line
            gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+SHIFT+F2"}))

            xInputWin = xCalcDoc.getChild("sc_input_window")
            self.assertEqual('true', get_state_as_dict(xInputWin)["HasFocus"])
            gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F2"}))

            self.xUITest.executeCommand(".uno:Paste")

            gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))

            # Without the fix in place, this test would have failed with
            # AssertionError: 17205 != 17204
            self.assertEqual(17205, len(get_state_as_dict(xInputWin)["Text"]))
            self.assertEqual(17205.0, get_cell_by_position(document, 0, 1, 1).getValue())

            xInputWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))

            self.assertEqual(1929753068859.0, get_cell_by_position(document, 0, 0, 1).getValue())
            self.assertEqual(1930864179960.0, get_cell_by_position(document, 0, 0, 1).getValue())

# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf139974.ods b/sc/qa/uitest/data/tdf139974.ods
index bc89066..77ec252 100644
--- a/sc/qa/uitest/data/tdf139974.ods
+++ b/sc/qa/uitest/data/tdf139974.ods
Binary files differ