Update git submodules
[LibreOffice.git] / sc / qa / uitest / calc_tests8 / tdf54768.py
blobc72a0e02b8fca64f85ff2c8c5efbeaa38de2b998
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from uitest.framework import UITestCase
10 from libreoffice.uno.propertyvalue import mkPropertyValues
11 from uitest.uihelper.common import get_url_for_data_file
13 class tdf54768(UITestCase):
14 def test_tdf54768(self):
15 # This document contains an image with an original size of 7.99cm x 5.74cm.
16 # The image has been cropped 2.73cm at the top.
17 # Also, it has been resized to a width of 4.04cm.
18 with self.ui_test.load_file(get_url_for_data_file("tdf54768.ods")) as document:
19 xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
21 # select the image
22 xGridWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Image"}))
24 # click "Original Size"
25 self.xUITest.executeCommand(".uno:OriginalSize")
27 # tdf#155863: Without the fix in place, the image stays cropped,
28 # but stretches to the size of original image
29 self.assertEqual(7988, document.DrawPages[0][0].Size.Width)
30 self.assertEqual(3005, document.DrawPages[0][0].Size.Height)
32 # vim: set shiftwidth=4 softtabstop=4 expandtab: