diff options
author | Markus Keller | 2015-01-19 17:23:11 +0000 |
---|---|---|
committer | Markus Keller | 2015-01-19 17:57:39 +0000 |
commit | a28282ea118d93fd5d372ca612e28cbf4100b7f9 (patch) | |
tree | 0773341ed740833615b282be8f9381c95a8442a9 /tests | |
parent | 9d49fcd7ce31585c419869cfd3412b5567035b7c (diff) | |
download | eclipse.platform.swt-a28282ea118d93fd5d372ca612e28cbf4100b7f9.tar.gz eclipse.platform.swt-a28282ea118d93fd5d372ca612e28cbf4100b7f9.tar.xz eclipse.platform.swt-a28282ea118d93fd5d372ca612e28cbf4100b7f9.zip |
Bug 454590: Link widget should not scroll its contents
Diffstat (limited to 'tests')
-rw-r--r-- | tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java index 1e48ce0af2..6b37f56f4c 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java @@ -13,6 +13,8 @@ package org.eclipse.swt.tests.junit; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Link; @@ -142,4 +144,52 @@ public void test_setTextLjava_lang_String() { } catch (IllegalArgumentException e) { } } + +/* custom */ +@Override +public void test_setBoundsIIII() { + link.setBounds(10, 20, 30, 40); + // only check x, y, and width - you can't set the height of a link e.g. on Cocoa + assertTrue(link.getBounds().x == 10); + assertTrue(link.getBounds().y == 20); + assertTrue(link.getBounds().width == 30); +} + +@Override +public void test_setBoundsLorg_eclipse_swt_graphics_Rectangle() { + link.setBounds(new Rectangle(10, 20, 30, 40)); + // only check x, y, and width - you can't set the height of a link e.g. on Cocoa + assertTrue(link.getBounds().x == 10); + assertTrue(link.getBounds().y == 20); + assertTrue(link.getBounds().width == 30); +} + +@Override +public void test_setSizeII() { + link.setSize(30, 40); + // only check the width - you can't set the height of a link e.g. on Cocoa + assertTrue(link.getSize().x == 30); + + link.setSize(32, 43); + // only check the width - you can't set the height of a link e.g. on Cocoa + assertTrue(link.getSize().x == 32); +} + +@Override +public void test_setSizeLorg_eclipse_swt_graphics_Point() { + link.setSize(new Point(30, 40)); + // only check the width - you can't set the height of a link e.g. on Cocoa + assertTrue(link.getSize().x == 30); + + link.setBounds(32, 43, 33, 44); + // only check the width - you can't set the height of a link e.g. on Cocoa + assertTrue(link.getSize().x == 33); + + link.setBounds(32, 43, 30, 40); + link.setLocation(11, 22); + link.setSize(new Point(32, 43)); + // only check the width - you can't set the height of a link e.g. on Cocoa + assertTrue(link.getSize().x == 32); +} + } |