Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSebastian Ratz2019-11-25 14:42:31 +0000
committerPaul Pazderski2019-11-25 15:39:00 +0000
commitafcabfabee4e29a0ea94f88a3c634a6ecf6313ef (patch)
tree97abf2c0a59b7d671962894a59c521ac6366e742 /tests
parenta8db2f5b9ac4f675f5ff909987d96e41f5ad6524 (diff)
downloadeclipse.platform.swt-afcabfabee4e29a0ea94f88a3c634a6ecf6313ef.tar.gz
eclipse.platform.swt-afcabfabee4e29a0ea94f88a3c634a6ecf6313ef.tar.xz
eclipse.platform.swt-afcabfabee4e29a0ea94f88a3c634a6ecf6313ef.zip
Bug 349112 - CCombo: allow setting alignment SWT.RIGHT - Focus fix
Style attributes of CCombo must not be passed along to Text(). Fixup for 7b627530c28727b3a02ceba26562f3002339ca13. Change-Id: I85f4ca7fa67b616f35fcdfb972d37439d0951988
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java
index c2e67a841d..effcbc13ec 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_CCombo.java
@@ -30,6 +30,8 @@ import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
import org.junit.Before;
import org.junit.Test;
@@ -194,6 +196,8 @@ public void test_setEnabledZ() {
@Test
public void test_setFocus() {
assertTrue(!ccombo.setFocus());
+ shell.open();
+ shell.setVisible(true);
boolean exceptionThrown = false;
try{
ccombo.setEnabled(false);
@@ -207,8 +211,18 @@ public void test_setFocus() {
assertFalse("Expect false wehn not visible and not enabled", ccombo.setFocus());
ccombo.setEnabled(true);
ccombo.setVisible(true);
+ processEvents(0, null);
if(ccombo.isFocusControl())
assertTrue("Set focus error", ccombo.setFocus());
+
+ ccombo.setEnabled(true);
+ ccombo.setVisible(true);
+ ccombo.setFocus();
+ processEvents(0, null);
+ assertTrue(ccombo.isFocusControl());
+ Control focusControl = ccombo.getDisplay().getFocusControl();
+ assertTrue(focusControl instanceof Text);
+ assertEquals(ccombo, focusControl.getParent());
}
catch (Exception e) {
exceptionThrown = true;

Back to the top