Skip to content

Commit 5392488

Browse files
author
Damon Nguyen
committed
8355332: Fix failing semi-manual test EDT issue
Reviewed-by: azvegint
1 parent b7e8952 commit 5392488

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

test/jdk/javax/swing/JScrollPane/AcceleratedWheelScrolling/HorizScrollers.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ private void showFinalReminderIfNeeded(boolean isFailure) {
161161
if (scrollAmount != 3) {
162162
JOptionPane.showMessageDialog(
163163
ConfigPanel.this.getTopLevelAncestor(),
164-
("Test %s. please make sure you have restored " +
165-
"the original speed value blah blah")
164+
("Test %s. Please make sure you have restored " +
165+
"the original scrolling speed in the " +
166+
"Mouse settings.")
166167
.formatted(isFailure
167168
? "failed"
168169
: "passed"),
@@ -231,4 +232,4 @@ public void mouseWheelMoved(MouseWheelEvent e) {
231232
}
232233
}
233234
}
234-
}
235+
}

test/jdk/javax/swing/JScrollPane/AcceleratedWheelScrolling/RTLScrollers.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,22 +265,21 @@ public static boolean runTest(int scrollAmount)
265265
}
266266
}
267267

268+
robot.delay(1000);
268269
SwingUtilities.invokeAndWait(() -> {
269270
rtl = new RTLScrollers(scrollAmount);
270271
rtl.setVisible(true);
271272
});
272273
robot.delay(100);
273274

274-
SwingUtilities.invokeAndWait(() -> {
275-
try {
276-
retVal = rtl.runTests(scrollAmount);
277-
} catch (Exception e) {
278-
e.printStackTrace();
279-
} finally {
275+
try {
276+
retVal = rtl.runTests(scrollAmount);
277+
} finally {
278+
SwingUtilities.invokeAndWait(() -> {
280279
rtl.setVisible(false);
281280
rtl.dispose();
282-
}
283-
});
281+
});
282+
}
284283

285284
robot.delay(100);
286285
System.out.println("RTLS.runTest(): " + retVal);
@@ -312,9 +311,8 @@ private boolean runTests(int scrollAmount)
312311
System.out.println("Testing List");
313312
testComp(list, scrollAmount);
314313

315-
SwingUtilities.invokeAndWait(() -> {
316-
applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
317-
});
314+
SwingUtilities.invokeAndWait(() ->
315+
applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT));
318316
robot.delay(100);
319317

320318
System.out.println("Testing RTL Table");
@@ -467,9 +465,7 @@ public boolean testComp(TestTools comp, int scrollAmount)
467465
// Test acceleration for max scrolling
468466
// (this part should still work for RTL JList)
469467
if (scrollAmount == 30) {
470-
SwingUtilities.invokeAndWait(() -> {
471-
hsb.setValue(hsb.getMinimum());
472-
});
468+
SwingUtilities.invokeAndWait(() -> hsb.setValue(hsb.getMinimum()));
473469
robot.delay(100);
474470
robot.mouseWheel(2);
475471
robot.mouseWheel(2);

0 commit comments

Comments
 (0)