Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Pazderski2020-05-24 18:37:05 -0400
committerNiraj Modi2020-05-26 09:11:07 -0400
commitd125f2576857587481e794299871af484812f593 (patch)
tree5cb3503efcd75b4e839475b516936a00f66f66b9
parentbafd10404c2982b2b5b5e75b583e4839b54288d6 (diff)
downloadeclipse.platform.swt-d125f2576857587481e794299871af484812f593.tar.gz
eclipse.platform.swt-d125f2576857587481e794299871af484812f593.tar.xz
eclipse.platform.swt-d125f2576857587481e794299871af484812f593.zip
Bug 563531 - [Tests][StyledText] Scrolling with arrow down key does not
update caret painting A test case for regression from 2abb22fa4db3f7c87fc38290f55d0d8c4d4a4465. Change-Id: I5622f35d8819866078f8f1376111b26803d14990 Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
index b84c518ce2..0c4f1853b7 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java
@@ -5801,4 +5801,37 @@ public void test_clipboardCarryover() {
String clipboardText = (String) clipboard.getContents(rtfTranfer);
assertTrue("RTF copy failed", clipboardText.length() > 0);
}
+
+/**
+ * Bug 563531 - [regression][StyledText] Scrolling with arrow down key does not update caret painting
+ */
+@Test
+public void test_caretLocationOnArrowMove() {
+ text.setText(
+ "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................\n"
+ + "............................................................");
+
+ shell.open();
+ text.setSize(10, 50);
+
+ for (int i = 0; i < 5; i++) {
+ text.invokeAction(ST.LINE_DOWN);
+ }
+
+ Point caretLocation = text.getCaret().getLocation();
+ int caretOffset = text.getCaretOffset();
+ text.setCaretOffset(0);
+ text.setCaretOffset(caretOffset);
+ assertEquals(text.getCaret().getLocation(), caretLocation);
+}
}

Back to the top