< prev index next >

test/java/awt/event/MouseEvent/AltGraphModifierTest/AltGraphModifierTest.java

Print this page

        

*** 21,54 **** * questions. */ /* @test ! @bug 8041928 @summary Confirm that the Alt-Gr Modifier bit is set correctly. @run main/manual AltGraphModifierTest */ import java.awt.Button; import java.awt.Dialog; import java.awt.Frame; import java.awt.Panel; import java.awt.TextArea; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; public class AltGraphModifierTest { private static void init() throws Exception { String[] instructions = { "This test is for verifying Alt-Gr modifier of an event.", - "Windows :-", - "1. Click Pass.", - "2. Alt-Gr modifier is tested under Robot tests.", - " ", "Linux :-", "1. Please check if Alt-Gr key is present on keyboard.", "2. If present, press the Alt-Gr key and perform", " mouse click on the TestWindow.", "3. Navigate to System Settings-> Keyboard-> Shortcuts->", --- 21,53 ---- * questions. */ /* @test ! @bug 8041928 8158616 @summary Confirm that the Alt-Gr Modifier bit is set correctly. + @library ../../../../../lib/testlibrary @run main/manual AltGraphModifierTest */ + import java.awt.Button; import java.awt.Dialog; import java.awt.Frame; import java.awt.Panel; import java.awt.TextArea; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; + import jdk.testlibrary.OSInfo; public class AltGraphModifierTest { private static void init() throws Exception { String[] instructions = { "This test is for verifying Alt-Gr modifier of an event.", "Linux :-", "1. Please check if Alt-Gr key is present on keyboard.", "2. If present, press the Alt-Gr key and perform", " mouse click on the TestWindow.", "3. Navigate to System Settings-> Keyboard-> Shortcuts->",
*** 61,71 **** "7. Test will exit by itself with appropriate result.", " ", "Mac :-", "1. Press Right Option key on the keyboard and mouse click", " on the TestWindow", ! "3. Test will exit by itself with appropriate result.", }; Sysout.createDialog(); Sysout.printInstructions(instructions); } --- 60,70 ---- "7. Test will exit by itself with appropriate result.", " ", "Mac :-", "1. Press Right Option key on the keyboard and mouse click", " on the TestWindow", ! "2. Test will exit by itself with appropriate result.", }; Sysout.createDialog(); Sysout.printInstructions(instructions); }
*** 109,118 **** --- 108,121 ---- private static String failureMessage = ""; private static Thread mainThread = null; final private static int sleepTime = 300000; public static void main(String args[]) throws Exception { + if (OSInfo.getOSType() == OSInfo.OSType.WINDOWS) { + // For Windows: Alt-Gr modifier is tested under Robot tests. + return; + } mainThread = Thread.currentThread(); try { init(); initTestWindow(); } catch (Exception e) {
*** 207,217 **** // DO NOT call this directly, go through Sysout public TestDialog(Frame frame, String name) { super(frame, name); int scrollBoth = TextArea.SCROLLBARS_BOTH; ! instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); add("North", instructionsText); messageText = new TextArea("", 5, maxStringLength, scrollBoth); add("Center", messageText); --- 210,220 ---- // DO NOT call this directly, go through Sysout public TestDialog(Frame frame, String name) { super(frame, name); int scrollBoth = TextArea.SCROLLBARS_BOTH; ! instructionsText = new TextArea("", 20, maxStringLength, scrollBoth); add("North", instructionsText); messageText = new TextArea("", 5, maxStringLength, scrollBoth); add("Center", messageText);
< prev index next >