< prev index next >

test/jdk/java/awt/Frame/MaximizedByPlatform/MaximizedByPlatform.java

Print this page
rev 51542 : 8210039: move OSInfo to top level testlibrary
Reviewed-by: duke


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @key headful
  27  * @bug 8026143
  28  * @summary [macosx] Maximized state could be inconsistent between peer and frame
  29  * @author Petr Pchelko
  30  * @library ../../../../lib/testlibrary
  31  * @build jdk.testlibrary.OSInfo
  32  * @run main MaximizedByPlatform
  33  */
  34 
  35 import jdk.testlibrary.OSInfo;
  36 
  37 import java.awt.*;
  38 
  39 public class MaximizedByPlatform {
  40     private static Frame frame;
  41     private static Rectangle availableScreenBounds;
  42 
  43     public static void main(String[] args) {
  44         if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
  45             // Test only for macosx. Pass
  46             return;
  47         }
  48 
  49         Robot robot;
  50         try {
  51             robot = new Robot();
  52         }catch(Exception ex) {
  53             ex.printStackTrace();
  54             throw new RuntimeException("Unexpected failure");
  55         }
  56         availableScreenBounds = getAvailableScreenBounds();
  57 
  58         // Test 1. The maximized state is set in setBounds
  59         try {
  60             frame = new Frame();
  61             frame.setBounds(100, 100, 100, 100);
  62             frame.setVisible(true);
  63 
  64             robot.waitForIdle();




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @key headful
  27  * @bug 8026143
  28  * @summary [macosx] Maximized state could be inconsistent between peer and frame
  29  * @author Petr Pchelko
  30  * @library /test/lib
  31  * @build jdk.test.lib.Platform
  32  * @run main MaximizedByPlatform
  33  */
  34 
  35 import jdk.test.lib.Platform;
  36 
  37 import java.awt.*;
  38 
  39 public class MaximizedByPlatform {
  40     private static Frame frame;
  41     private static Rectangle availableScreenBounds;
  42 
  43     public static void main(String[] args) {
  44         if (!Platform.isOSX()) {
  45             // Test only for macosx. Pass
  46             return;
  47         }
  48 
  49         Robot robot;
  50         try {
  51             robot = new Robot();
  52         }catch(Exception ex) {
  53             ex.printStackTrace();
  54             throw new RuntimeException("Unexpected failure");
  55         }
  56         availableScreenBounds = getAvailableScreenBounds();
  57 
  58         // Test 1. The maximized state is set in setBounds
  59         try {
  60             frame = new Frame();
  61             frame.setBounds(100, 100, 100, 100);
  62             frame.setVisible(true);
  63 
  64             robot.waitForIdle();


< prev index next >