Skip to content
Permalink
Browse files

8193544: Regression automated test '/open/test/jdk/javax/swing/JDialo…

…g/Transparency/TransparencyTest.java' fails

Reviewed-by: serb
  • Loading branch information
prsadhuk committed Nov 25, 2019
1 parent 51837b8 commit b690482e646f88027b576c862943f9ee168984f4
Showing with 11 additions and 3 deletions.
  1. +11 −3 test/jdk/javax/swing/JDialog/Transparency/TransparencyTest.java
@@ -59,6 +59,7 @@ public static void createAndShowGUI() {
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 @@ public static void main(String[] args) throws Exception {
boolean translucencyCheck = gd.isWindowTranslucencySupported(mode);
if(!translucencyCheck) {
return;
}
}

Robot robot = new Robot();
// create a GUI
@@ -87,7 +88,11 @@ public void run() {
}
});
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 @@ public void run() {
}
});
robot.waitForIdle();
robot.delay(200);

// iconify frame
SwingUtilities.invokeAndWait(new Runnable() {
@@ -108,6 +114,7 @@ public void run() {
}
});
robot.waitForIdle();
robot.delay(500);

// deiconify frame
SwingUtilities.invokeAndWait(new Runnable() {
@@ -118,8 +125,9 @@ public void run() {
}
});
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 "

0 comments on commit b690482

Please sign in to comment.
You can’t perform that action at this time.