781549f47d
Forward port from 7u4 Reviewed-by: art
27 lines
904 B
Java
27 lines
904 B
Java
/*
|
|
@test
|
|
@bug 7125044
|
|
@summary Tests defaut focus traversal policy in AWT & Swing toplevel windows.
|
|
@author anton.tarasov@sun.com: area=awt.focus
|
|
@run main InitialFTP_AWT
|
|
@run main InitialFTP_Swing
|
|
*/
|
|
|
|
import java.awt.FocusTraversalPolicy;
|
|
import java.awt.Window;
|
|
|
|
public class InitialFTP {
|
|
public static void test(Window win, Class<? extends FocusTraversalPolicy> expectedPolicy) {
|
|
FocusTraversalPolicy ftp = win.getFocusTraversalPolicy();
|
|
|
|
System.out.println("==============" + "\n" +
|
|
"Tested window: " + win + "\n" +
|
|
"Expected policy: " + expectedPolicy + "\n" +
|
|
"Effective policy: " + ftp.getClass());
|
|
|
|
if (!expectedPolicy.equals(ftp.getClass())) {
|
|
throw new RuntimeException("Test failed: wrong effective focus policy");
|
|
}
|
|
}
|
|
}
|