--- old/jdk/test/java/awt/Choice/UnfocusableToplevel/UnfocusableToplevel.java 2015-09-09 14:47:53.645247015 +0530 +++ new/jdk/test/java/awt/Choice/UnfocusableToplevel/UnfocusableToplevel.java 2015-09-09 14:47:53.449246991 +0530 @@ -63,6 +63,14 @@ w.setLayout(new FlowLayout()); w.setSize(200, 200); + // fix for 8039467 : [TEST_BUG] Test java/awt/Choice/UnfocusableToplevel/UnfocusableToplevel.java - + // - lefts keystrokes in a keyboard buffer on Windows + // FIX: As Window w is non focusable, key press events will not be consumed by w. + // So creating tempFrameToHoldFocus frame, to consume key press events + Frame tempFrameToHoldFocus = new Frame(); + tempFrameToHoldFocus.setVisible(true); + tempFrameToHoldFocus.requestFocus(); + ch.addKeyListener(new KeyAdapter(){ public void keyTyped(KeyEvent e){ traceEvent("keytyped", e); @@ -94,6 +102,10 @@ testKeys(); Util.waitForIdle(robot); + + tempFrameToHoldFocus.dispose(); + w.dispose(); + f.dispose(); } private static void testKeys(){