summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod
diff options
context:
space:
mode:
authorLuke Deller <luke@deller.id.au>2016-09-16 23:49:24 +1000
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-09-17 16:36:34 +0000
commite28d52387383d5b9b3554f364e885a20f4292d81 (patch)
treef363af3776dbde35bc84988e7bbb4ad0ed5a7a68 /qadevOOo/tests/java/mod
parent4d6a17c60b38d453b6444a59da31fb7378e7f3b1 (diff)
Fix JUnit test case for AccessibleFixedText
This test case was failing on platforms where the default font does not fit inside the default size of a fixed text control (hard coded to be 12px high in UnoFixedTextControl's constructor) - Adjust the test case to explicitly set the text control's size to its preferred size. - Re-enable this checking on Mac OS X, where it had been disabled in 2013 due to this issue Change-Id: I469a733f0a2719c60564d61c89bb64ab3ab622ba Reviewed-on: https://gerrit.libreoffice.org/28961 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'qadevOOo/tests/java/mod')
-rw-r--r--qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
index fc2aca6a36df..0fc71d679153 100644
--- a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
+++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java
@@ -26,6 +26,8 @@ import com.sun.star.awt.XControlContainer;
import com.sun.star.awt.XControlModel;
import com.sun.star.awt.XFixedText;
import com.sun.star.awt.XWindow;
+import com.sun.star.awt.XLayoutConstrains;
+import com.sun.star.awt.Size;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
@@ -109,6 +111,16 @@ public class AccessibleFixedText extends TestCase {
XFixedText.class, txtControl);
xFT.setText("FxedText");
+ /* Set the text control to its preferred size, otherwise it
+ * defaults to the size hard coded in its constructor (100 x 12) */
+ XLayoutConstrains xLCTxt = UnoRuntime.queryInterface(
+ XLayoutConstrains.class, txtControl);
+ Size textSize = xLCTxt.getPreferredSize();
+ XWindow xWinTxt = UnoRuntime.queryInterface(
+ XWindow.class, txtControl);
+ xWinTxt.setPosSize(0, 0, textSize.Width, textSize.Height,
+ PosSize.SIZE);
+
XControlContainer ctrlCont = UnoRuntime.queryInterface(
XControlContainer.class,
dlgControl);
@@ -173,4 +185,4 @@ public class AccessibleFixedText extends TestCase {
log.println(" Closing dialog ... ");
xWinDlg.dispose();
}
-} \ No newline at end of file
+}