--- old/test/java/awt/Window/ChangeWindowResizabilty/ChangeWindowResizabiltyTest.java 2016-10-18 16:06:44.829798816 +0300 +++ new/test/java/awt/Window/ChangeWindowResizabilty/ChangeWindowResizabiltyTest.java 2016-10-18 16:06:44.749798819 +0300 @@ -21,7 +21,9 @@ * questions. */ -/* @bug 8166897 +/* + @test + @bug 8166897 @summary Some font overlap in the Optionpane dialog. @run main ChangeWindowResizabiltyTest */ @@ -33,35 +35,68 @@ Robot robot = new Robot(); for(int i = 0; i < 10; i++) { Dialog dialog = new Dialog((Frame) null); + dialog.setLocation(100, 100); Component panel = new Panel(); panel.setPreferredSize(new Dimension(200, 100)); dialog.add(panel); dialog.pack(); dialog.setVisible(true); + robot.waitForIdle(); + robot.delay(200); + + Point frameLoc = dialog.getLocationOnScreen(); + Point contentLoc = panel.getLocationOnScreen(); + + System.out.println("Decor location " + frameLoc); + System.out.println("Content location " + contentLoc); dialog.setResizable(false); robot.waitForIdle(); robot.delay(200); - System.out.println(panel.getLocationOnScreen()); - System.out.println(dialog.getLocationOnScreen()); + Point l = dialog.getLocationOnScreen(); + if (!l.equals(frameLoc)) { + dialog.dispose(); + throw new RuntimeException("Decorated frame location moved " + + "after setResizable(false)" + l); + } + + l = panel.getLocationOnScreen(); + if (!l.equals(contentLoc)) { + dialog.dispose(); + throw new RuntimeException("Content location moved after " + + "setResizable(false)" + l); + } + if (panel.getLocationOnScreen().y < - dialog.getLocationOnScreen().y + dialog.getInsets().top) { + dialog.getLocationOnScreen().y + dialog.getInsets().top) { dialog.dispose(); throw new RuntimeException( - "Wrong content position after setResizable(false)"); + "Wrong content position after setResizable(false)"); } dialog.setResizable(true); robot.waitForIdle(); robot.delay(200); - System.out.println(panel.getLocationOnScreen()); - System.out.println(dialog.getLocationOnScreen()); + + l = dialog.getLocationOnScreen(); + if (!l.equals(frameLoc)) { + dialog.dispose(); + throw new RuntimeException("Decorated frame location moved " + + "after setResizable(true)" + l); + } + + l = panel.getLocationOnScreen(); + if (!l.equals(contentLoc)) { + dialog.dispose(); + throw new RuntimeException("Content location moved after " + + "setResizable(true)" + l); + } if (panel.getLocationOnScreen().y < - dialog.getLocationOnScreen().y + dialog.getInsets().top) { + dialog.getLocationOnScreen().y + dialog.getInsets().top) { dialog.dispose(); throw new RuntimeException( - "Wrong content position after setResizable(true)"); + "Wrong content position after setResizable(true)"); } dialog.dispose();