diff options
author | Steve Vaughan <[email protected]> | 2010-08-31 14:29:23 -0400 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-09-26 03:05:59 +0200 |
commit | 9a2034b4f493465f93386c6462cbd0e2b68db19d (patch) | |
tree | ebb3f62d79d18a26047ef2bbfd43b1d780272aeb /src | |
parent | 39276cb2bd3a6281c04be0a8bd457f9af914da1e (diff) |
Ensure that receiving focus is passed on to any NEWT child.
Diffstat (limited to 'src')
-rw-r--r-- | src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWT.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWT.java b/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWT.java index 1cf25bb6d..a0039106e 100644 --- a/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWT.java +++ b/src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWT.java @@ -78,25 +78,26 @@ public class TestFocus01SwingAWT { frame1.setSize(width, height); frame1.setVisible(true); + // Request the focus, which should automatically provide the window + // with focus. + newtCanvasAWT.requestFocus(); + Animator animator = new Animator(glWindow1); animator.start(); - Robot robot = new Robot(); - - // Wait for the window to initialize. + // Wait for the window to initialize and receive focus. // TODO Eliminate the need for this delay. while (glWindow1.getDuration() < durationPerTest) { Thread.sleep(100); } - // Request the focus, which should automatically provide the window - // with focus. - newtCanvasAWT.requestFocus(); + // Verify focus status. assertFalse("AWT parent canvas has focus", newtCanvasAWT.hasFocus()); // TODO No test for NEWT hasFocus. // assertTrue(newtCanvasAWT.getNEWTChild().hasFocus()); // Type two keys, which should be directed to the focused window. + Robot robot = new Robot(); robot.keyPress(java.awt.event.KeyEvent.VK_A); robot.keyRelease(java.awt.event.KeyEvent.VK_A); robot.keyPress(java.awt.event.KeyEvent.VK_B); |