8196367: java/awt/List/SingleModeDeselect/SingleModeDeselect.java times out

Reviewed-by: prr
This commit is contained in:
Alexander Zuev 2022-04-26 20:54:53 +00:00
parent 14e7d91199
commit e574cc0e2b
2 changed files with 18 additions and 15 deletions

View File

@ -422,7 +422,6 @@ java/awt/Modal/ToBack/ToBackNonModal2Test.java 8196441 macosx-all,linux-all
java/awt/Modal/ToBack/ToBackNonModal3Test.java 8196441 macosx-all,linux-all
java/awt/Modal/ToBack/ToBackNonModal4Test.java 8196441 macosx-all,linux-all
java/awt/Modal/ToBack/ToBackNonModal5Test.java 8196441 macosx-all
java/awt/List/SingleModeDeselect/SingleModeDeselect.java 8196367 windows-all
java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java 8061235 macosx-all
javax/print/PrintSEUmlauts/PrintSEUmlauts.java 8135174 generic-all
java/awt/font/TextLayout/LigatureCaretTest.java 8266312 generic-all

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,16 +26,17 @@
@key headful
@bug 6248040
@summary List.deselect() de-selects the currently selected item regardless of the index, win32
@author Dmitry Cherepanov area=awt.list
@run main SingleModeDeselect
*/
import java.awt.*;
import java.awt.AWTException;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.List;
import java.awt.Robot;
public class SingleModeDeselect
{
public static final void main(String args[])
{
public class SingleModeDeselect {
public static final void main(String args[]) {
final Frame frame = new Frame();
final List list = new List();
@ -45,6 +46,7 @@ public class SingleModeDeselect
frame.add(list);
frame.setLayout(new FlowLayout());
frame.setBounds(100,100,300,300);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
list.select(0);
@ -53,14 +55,16 @@ public class SingleModeDeselect
try {
Robot robot = new Robot();
robot.waitForIdle();
}catch(Exception ex) {
if (list.getSelectedIndex() != 0) {
throw new RuntimeException("Test failed: List.getSelectedIndex() returns "
+ list.getSelectedIndex());
}
} catch(AWTException ex) {
ex.printStackTrace();
throw new RuntimeException("Unexpected failure");
} finally {
frame.setVisible(false);
frame.dispose();
}
if (list.getSelectedIndex() != 0){
throw new RuntimeException("Test failed: List.getSelectedIndex() returns "+list.getSelectedIndex());
}
}//End init()
}
}