8028485: [macosx] java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java fails
authorpchelko
Fri, 22 Nov 2013 10:48:00 +0400
changeset 21788 38ffbbef9235
parent 21787 11c9c9dfa450
child 21789 ebce9726e754
8028485: [macosx] java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java fails Reviewed-by: anthony, serb
jdk/src/macosx/native/sun/awt/AWTWindow.m
jdk/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java
--- a/jdk/src/macosx/native/sun/awt/AWTWindow.m	Tue Nov 19 18:16:41 2013 +0400
+++ b/jdk/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/jdk/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java	Tue Nov 19 18:16:41 2013 +0400
+++ b/jdk/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);