Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146168

[TEST_BUG] instability of java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java

XMLWordPrintable

    • b105

      RULE "java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java" Exception java.lang.RuntimeException: Maximized frame is smaller than non maximized

      This failure is intermittent, and for a good reason: there should be sync after setVisible(true) of the frame, and a small delay() wouldn't hurt, either.
      Without them, I have a consistent failure on my dual-monitor system which apparently has some performance penalty; with robot.waitForIdle() and a delay, test does pass consistently.

      --- a/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java Mon Dec 21 11:47:11 2015 -0400
      +++ b/test/java/awt/Frame/MaximizedToMaximized/MaximizedToMaximized.java Thu Dec 24 12:33:42 2015 +0300
      @@ -59,14 +59,17 @@
               availableScreenBounds.width -= (screenInsets.left + screenInsets.right);
               availableScreenBounds.height -= (screenInsets.top + screenInsets.bottom);
       
      + Robot robot = new Robot();
               frame.setBounds(availableScreenBounds.x, availableScreenBounds.y,
                       availableScreenBounds.width, availableScreenBounds.height);
               frame.setVisible(true);
      + robot.waitForIdle();
      + robot.delay(1000);
       
               Rectangle frameBounds = frame.getBounds();
               frame.setExtendedState(Frame.MAXIMIZED_BOTH);
      - Robot robot = new Robot();
               robot.waitForIdle();
      + robot.delay(1000);
       
               Rectangle maximizedFrameBounds = frame.getBounds();
               if (maximizedFrameBounds.width < frameBounds.width

            arapte Ambarish Rapte
            yan Yuri Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: