changeset 57180:b256c7afe8cc

8193544: Regression automated test '/open/test/jdk/javax/swing/JDialog/Transparency/TransparencyTest.java' fails Reviewed-by: serb
author psadhukhan
date Mon, 25 Nov 2019 11:20:14 +0530
parents 5602e016309b
children aa3918700fea
files test/jdk/javax/swing/JDialog/Transparency/TransparencyTest.java
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/javax/swing/JDialog/Transparency/TransparencyTest.java	Fri Nov 22 11:35:26 2019 +0530
+++ b/test/jdk/javax/swing/JDialog/Transparency/TransparencyTest.java	Mon Nov 25 11:20:14 2019 +0530
@@ -59,6 +59,7 @@
         dlgPos = dialog.getLocation();
         backgroundDialog = new JDialog(frame, false);
         backgroundDialog.setSize(250, 250);
+        backgroundDialog.setUndecorated(true);
         backgroundDialog.getContentPane().setBackground(Color.red);
         backgroundDialog.setLocation(dlgPos.x, dlgPos.y);
 
@@ -75,7 +76,7 @@
         boolean translucencyCheck = gd.isWindowTranslucencySupported(mode);
         if(!translucencyCheck) {
             return;
-    }
+        }
 
         Robot robot = new Robot();
         // create a GUI
@@ -87,7 +88,11 @@
             }
         });
         robot.waitForIdle();
-        Color opaque = robot.getPixelColor(dlgPos.x + 100, dlgPos.y + 100);
+        robot.delay(200);
+
+        int x = dlgPos.x + 100;
+        int y = dlgPos.y + 100;
+        Color opaque = robot.getPixelColor(x, y);
 
         // set Dialog Opacity
         SwingUtilities.invokeAndWait(new Runnable() {
@@ -98,6 +103,7 @@
             }
         });
         robot.waitForIdle();
+        robot.delay(200);
 
         // iconify frame
         SwingUtilities.invokeAndWait(new Runnable() {
@@ -108,6 +114,7 @@
             }
         });
         robot.waitForIdle();
+        robot.delay(500);
 
         // deiconify frame
         SwingUtilities.invokeAndWait(new Runnable() {
@@ -118,8 +125,9 @@
             }
         });
         robot.waitForIdle();
+        robot.delay(500);
 
-        Color transparent = robot.getPixelColor(dlgPos.x + 100, dlgPos.y + 100);
+        Color transparent = robot.getPixelColor(x, y);
         if (transparent.equals(opaque)) {
             frame.dispose();
             throw new RuntimeException("JDialog transparency lost "