changeset 8828:91279a4a41f3

8028485: [macosx] java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java fails Reviewed-by: anthony, serb
author pchelko
date Fri, 22 Nov 2013 10:48:00 +0400
parents 0e1e52166f70
children 876c81f7f44c
files src/macosx/native/sun/awt/AWTWindow.m test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/native/sun/awt/AWTWindow.m	Tue Nov 19 18:16:41 2013 +0400
+++ b/src/macosx/native/sun/awt/AWTWindow.m	Fri Nov 22 10:48:00 2013 +0400
@@ -468,8 +468,6 @@
         // TODO: create generic AWT assert
     }
 
-    [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
-
     NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]);
 
     static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V");
@@ -480,6 +478,8 @@
                       (jint)frame.size.height,
                       (jboolean)[self.nsWindow inLiveResize]);
     (*env)->DeleteLocalRef(env, platformWindow);
+
+    [AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows];
 }
 
 - (void)windowDidMove:(NSNotification *)notification {
--- a/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java	Tue Nov 19 18:16:41 2013 +0400
+++ b/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java	Fri Nov 22 10:48:00 2013 +0400
@@ -61,6 +61,12 @@
             return;
         }
 
+        //Move the mouse out, because it could interfere with the test.
+        Robot r = Util.createRobot();
+        Util.waitForIdle(r);
+        r.mouseMove(0, 0);
+        Util.waitForIdle(r);
+
         SwingUtilities.invokeAndWait(new Runnable() {
             @Override
             public void run() {
@@ -69,7 +75,6 @@
         });
 
         //Move the mouse away from the frame and check the View-base full screen mode
-        Robot r = Util.createRobot();
         Util.waitForIdle(r);
         r.mouseMove(500, 500);
         Util.waitForIdle(r);
@@ -92,6 +97,7 @@
         });
 
         //Test native full screen support
+        Util.waitForIdle(r);
         Point fullScreenButtonPos = frame.getLocation();
         fullScreenButtonPos.translate(frame.getWidth() - 10, 10);
         r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y);