diff options
author | Paul Pazderski | 2020-01-16 09:32:18 +0000 |
---|---|---|
committer | Paul Pazderski | 2020-01-16 09:34:16 +0000 |
commit | 70b6a21422b80c1d41223bcf7121ff95cb54e6e9 (patch) | |
tree | 2368c2f2aa5a77b6d5b56fc7ca05385f08b6b9ea /tests | |
parent | a9ab86f10f796039a3e57386f2454faf0b33e542 (diff) | |
download | eclipse.platform.swt-70b6a21422b80c1d41223bcf7121ff95cb54e6e9.tar.gz eclipse.platform.swt-70b6a21422b80c1d41223bcf7121ff95cb54e6e9.tar.xz eclipse.platform.swt-70b6a21422b80c1d41223bcf7121ff95cb54e6e9.zip |
Bug 559230 - [Regression] Opening a file is extremely slow
Revert "Bug 343086 - [StyledText] Horizontal scroll bar vanishes when
line gets shorter"
This reverts commit 218f92e3b9fda0f48cc2d06401f180d5098121e3.
Revert "Bug 553377 - StyledTextRenderer max width can be invalid"
This reverts commit 795aeac59686647adf9dd0ea194583482609ac01.
Change-Id: I67c865393678af4ff777e8b7724e24ed3dfa8703
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyledText.java | 59 |
1 files changed, 1 insertions, 58 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 72d7232728..b84c518ce2 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2020 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -17,7 +17,6 @@ package org.eclipse.swt.tests.junit; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; @@ -5802,60 +5801,4 @@ public void test_clipboardCarryover() { String clipboardText = (String) clipboard.getContents(rtfTranfer); assertTrue("RTF copy failed", clipboardText.length() > 0); } - -/** - * Test for: - * Bug 553377 - StyledTextRenderer max width can be invalid - * Bug 343086 - Horizontal scroll bar vanishes when line gets shorter - */ -@Test -public void test_claimRightFreeSpace() { - text.dispose(); - text = new StyledText(shell, SWT.H_SCROLL); - setWidget(text); - text.setAlwaysShowScrollBars(true); - text.setSize(200, 500); - String content = "######################################################"; - int n = content.length(); - text.setText(content); - text.setCaretOffset(n); - text.showSelection(); - shell.pack(); - shell.open(); - - int lastScrollIndex = text.getHorizontalIndex(); - assertNotEquals("Widget must be scrolled for test", 0, lastScrollIndex); - - // test if widget reclaims horizontal space when characters are removed - int cutLenght = 3; - text.getContent().replaceTextRange(n - cutLenght, cutLenght, ""); - assertTrue("Free horizontal space not reclaimed on character remove", - text.getHorizontalIndex() < lastScrollIndex && text.getHorizontalIndex() > 0); - n -= cutLenght; - - // test if widget reclaims horizontal space if longest line is shortened because line get split - int newlineOffset = n - 5; - text.setCaretOffset(newlineOffset - 2); - lastScrollIndex = text.getHorizontalIndex(); - text.getContent().replaceTextRange(newlineOffset, 0, "\n"); - assertTrue("Free horizontal space not reclaimed on splitting line", - text.getHorizontalIndex() < lastScrollIndex && text.getHorizontalIndex() > 0); - - // similar to previous test but this time the second half of the split is the new max length line - text.setCaretOffset(0); - text.setHorizontalIndex(100); - lastScrollIndex = text.getHorizontalIndex(); - assertNotEquals("Widget must be scrolled for test", 0, lastScrollIndex); - text.getContent().replaceTextRange(10, 5, "~~\n~~"); - assertTrue("Free horizontal space not reclaimed on splitting line", - text.getHorizontalIndex() < lastScrollIndex && text.getHorizontalIndex() > 0); - - text.setText(content); - text.setHorizontalIndex(content.length()); - lastScrollIndex = text.getHorizontalIndex(); - assertNotEquals("Widget must be scrolled for test", 0, lastScrollIndex); - text.getContent().replaceTextRange(0, content.length(), "\n" + content.substring(5)); - assertTrue("Free horizontal space not reclaimed replace", - text.getHorizontalIndex() < lastScrollIndex && text.getHorizontalIndex() > 0); -} } |