Skip to content
Open
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
726a5ef
Returns false if component is null, in the case of embedded frame
kboulanou Jun 26, 2025
a0de4fe
Removes test from Problem List
kboulanou Jul 4, 2025
6220e8d
Checks if component is null for pixel color verification
kboulanou Aug 4, 2025
f828ede
Changes test timeout to 180 seconds
kboulanou Jun 26, 2025
861cbb3
Removes test from Problem List
kboulanou Jul 4, 2025
d59b4ed
Disables frame in ItemListener
kboulanou Jul 1, 2025
b54f41e
Removes test from Problem List
kboulanou Jul 4, 2025
aa6e3eb
Sets heavyweight background and foreground colors different than the …
kboulanou Jul 1, 2025
e8f7775
Updates copyright years
kboulanou Jul 24, 2025
4468267
Problem unlist test
kboulanou Aug 5, 2025
4faf168
Fixes color comparison on for MacOS X
kboulanou Jul 1, 2025
b1342ef
Removes test from Problem List
kboulanou Jul 4, 2025
e840a71
Adds more debugging for picked color
kboulanou Aug 5, 2025
ed3707a
Updates copyright years
kboulanou Aug 5, 2025
85f9321
Update test/jdk/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java
kboulanou Aug 12, 2025
689b213
Adds space around binary operators
kboulanou Aug 12, 2025
44db3ea
Uses simplified statement in method isAlmostEqualColor
kboulanou Aug 12, 2025
3140787
Renames color tolerance for macosx
kboulanou Aug 12, 2025
58636b6
Removes setOpqaue for swing buttons
kboulanou Aug 15, 2025
8d006b3
Changes the look and feel to the default Metal
kboulanou Aug 15, 2025
a98db3e
Accept color differences to less or equal to 15
kboulanou Aug 15, 2025
746cefa
Revert "Accept color differences to less or equal to 15"
kboulanou Aug 15, 2025
45ed29b
Merge branch 'openjdk:master' into jdk-8360498
kboulanou Aug 15, 2025
e8a3c47
Merge branch 'pr/25971' into jdk-8360498
kboulanou Aug 15, 2025
e2b13d6
Removes extra white lines
kboulanou Aug 15, 2025
ecf7d3c
Merge branch 'pr/25971' into jdk-8360498
kboulanou Aug 18, 2025
b83a9ed
Merge branch 'openjdk:master' into jdk-8360498
kboulanou Aug 22, 2025
ce0d352
Merge branch 'pr/25971' into jdk-8360498
kboulanou Aug 22, 2025
b2a35b8
Merge branch 'pr/25971' into jdk-8360498
kboulanou Aug 22, 2025
1080f8d
Removes extra white lines
kboulanou Aug 18, 2025
e76780d
Removes not needed changes
kboulanou Aug 22, 2025
dfbdd04
Revert "Removes not needed changes"
kboulanou Aug 22, 2025
2888ff3
Removes not needed changes
kboulanou Aug 22, 2025
e5753d1
Merge branch 'openjdk:master' into jdk-8360498
kboulanou Sep 25, 2025
8794db9
Resolves confict for when there is a merge with jdk-8158801
kboulanou Sep 25, 2025
69c087a
Merge branch 'openjdk:master' into jdk-8360498
kboulanou Sep 25, 2025
900a794
Merge branch 'pr/25971' into jdk-8360498
kboulanou Sep 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 52 additions & 19 deletions test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,24 @@
*/


import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Color;
import java.awt.Panel;
import java.awt.Point;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.InputEvent;
import javax.swing.*;
import java.io.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import test.java.awt.regtesthelpers.Util;

/**
Expand Down Expand Up @@ -63,17 +77,21 @@ public class MixingPanelsResizing {
private static int borderShift;

private static int frameBorderCounter() {

String JAVA_HOME = System.getProperty("java.home");
try {
Process p = Runtime.getRuntime().exec(JAVA_HOME + "/bin/java FrameBorderCounter");
Process p = Runtime.getRuntime()
.exec(JAVA_HOME + "/bin/java FrameBorderCounter");
try {
p.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
if (p.exitValue() != 0) {
throw new RuntimeException("FrameBorderCounter exited with not null code!\n" + readInputStream(p.getErrorStream()));
throw new RuntimeException(
"FrameBorderCounter exited with not null code!\n" +
readInputStream(p.getErrorStream()));
}
return Integer.parseInt(readInputStream(p.getInputStream()).trim());
} catch (IOException e) {
Expand All @@ -83,6 +101,7 @@ private static int frameBorderCounter() {
}

private static String readInputStream(InputStream is) throws IOException {

byte[] buffer = new byte[4096];
int len = 0;
StringBuilder sb = new StringBuilder();
Expand All @@ -98,7 +117,8 @@ private static void init() throws Exception {
//*** Create instructions for the user here ***

borderShift = frameBorderCounter();
borderShift = Math.abs(borderShift) == 1 ? borderShift : (borderShift / 2);
borderShift =
Math.abs(borderShift) == 1 ? borderShift : (borderShift / 2);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
// prepare controls
Expand Down Expand Up @@ -146,8 +166,10 @@ public void run() {

SwingUtilities.invokeAndWait(new Runnable() {
public void run() {

lLoc = frame.getLocationOnScreen();
lLoc.translate(frame.getWidth() + borderShift, frame.getHeight() + borderShift);
lLoc.translate(frame.getWidth() + borderShift,
frame.getHeight() + borderShift);
}
});

Expand All @@ -158,6 +180,7 @@ public void run() {
Runnable test = new Runnable() {

public void run() {

Point btnLoc = jbutton.getLocationOnScreen();
Color c = robot.getPixelColor(btnLoc.x + 5, btnLoc.y + 5);
System.out.println("Color picked for jbutton: " + c);
Expand Down Expand Up @@ -205,6 +228,7 @@ public void run() {

pass();
}//End init()

/*****************************************************
* Standard Test Machinery Section
* DO NOT modify anything in this section -- it's a
Expand All @@ -228,12 +252,12 @@ public void run() {
// static vars), it aint gonna work. Not worrying about
// it for now.
public static void main(String args[]) throws Exception {

try {
UIManager.setLookAndFeel(
UIManager.getCrossPlatformLookAndFeelClassName());
}
catch (Exception e) {
throw new RuntimeException(e);
} catch (Exception e) {
throw new RuntimeException(e);
}

if (!Toolkit.getDefaultToolkit().isDynamicLayoutActive()) {
Expand All @@ -257,7 +281,8 @@ public static void main(String args[]) throws Exception {
try {
Thread.sleep(sleepTime);
//Timed out, so fail the test
throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds");
throw new RuntimeException(
"Timed out after " + sleepTime / 1000 + " seconds");
} catch (InterruptedException e) {
//The test harness may have interrupted the test. If so, rethrow the exception
// so that the harness gets it and deals with it.
Expand All @@ -276,10 +301,12 @@ public static void main(String args[]) throws Exception {
}//main

public static synchronized void setTimeoutTo(int seconds) {

sleepTime = seconds * 1000;
}

public static synchronized void pass() {

System.out.println("The test passed.");
System.out.println("The test is over, hit Ctl-C to stop Java VM");
//first check if this is executing in main thread
Expand All @@ -301,6 +328,7 @@ public static synchronized void fail() {
}

public static synchronized void fail(String whyFailed) {

System.out.println("The test failed: " + whyFailed);
System.out.println("The test is over, hit Ctl-C to stop Java VM");
//check if this called from main thread
Expand All @@ -313,17 +341,22 @@ public static synchronized void fail(String whyFailed) {
failureMessage = whyFailed;
mainThread.interrupt();
}//fail()

private static boolean isAlmostEqualColor(Color color, Color refColor) {

System.out.println("Comparing color: " + color + " with reference " +
"color: " + refColor);
return color.equals(refColor) ||
Math.abs(color.getRed() - refColor.getRed()) <
TOLERANCE_MACOSX &&
Math.abs(color.getGreen() - refColor.getGreen()) <
TOLERANCE_MACOSX &&
Math.abs(color.getBlue() - refColor.getBlue()) <
TOLERANCE_MACOSX;
Math.abs(color.getRed() - refColor.getRed()) <
TOLERANCE_MACOSX &&
Math.abs(color.getGreen() - refColor.getGreen()) <
TOLERANCE_MACOSX &&
Math.abs(color.getBlue() - refColor.getBlue()) <
TOLERANCE_MACOSX;
}

static class TestPassedException extends RuntimeException {

}

}// class JButtonInGlassPane
class TestPassedException extends RuntimeException {
}