./test/java/awt/event/HierarchyEvent/AncestorResized/AncestorResized.java

Print this page
rev 296 : Ensure that ANCESTOR_RECEIVED event will be generated and then catched by the test.

@@ -117,21 +117,27 @@
             frame.add(components[i]);
         }
 
         // ... and start resizing
         robot.mousePress( InputEvent.BUTTON1_MASK );
-        robot.mouseMove(bounds.x + bounds.width + 20, bounds.y + bounds.height + 15);
+
+        for (int i = 0; i<20; i++)
+        {
+            robot.mouseMove(bounds.x + bounds.width + i, bounds.y + bounds.height + i);
         Util.waitForIdle(robot);
+        }
 
         if (ancestorResizedCounter == 0) {
             robot.mouseRelease( InputEvent.BUTTON1_MASK );
             AncestorResized.fail("No ANCESTOR_RESIZED events received.");
             return;
         }
 
         robot.mouseRelease( InputEvent.BUTTON1_MASK );
 
+        Sysout.println("ANCESTOR_RESIZED event received" + ancestorResizedCounter + " times");
+
         AncestorResized.pass();
     }//End  init()