Skip to content
Permalink
Browse files

8028281: [TEST_BUG] [macosx] javax/swing/JTabbedPane/7024235/Test7024…

…235.java fails

Reviewed-by: psadhukhan, prr
  • Loading branch information
mrserb committed Oct 26, 2020
1 parent 83a91bf commit 2b47a58dd7007d780f0d5d88577a5520a4341317
Showing with 13 additions and 12 deletions.
  1. +0 −1 test/jdk/ProblemList.txt
  2. +13 −11 test/jdk/javax/swing/JTabbedPane/7024235/Test7024235.java
@@ -759,7 +759,6 @@ javax/swing/JPopupMenu/6800513/bug6800513.java 7184956 macosx-all
javax/swing/JPopupMenu/6675802/bug6675802.java 8196097 windows-all
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
javax/swing/JTabbedPane/4624207/bug4624207.java 8064922 macosx-all
javax/swing/JTabbedPane/7024235/Test7024235.java 8028281 macosx-all
javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all
javax/swing/plaf/basic/Test6984643.java 8198340 windows-all
javax/swing/text/CSSBorder/6796710/bug6796710.java 8196099 windows-all
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -22,16 +22,14 @@
*/

import java.awt.BorderLayout;

import java.awt.Container;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.Robot;

import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JTabbedPane;

import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
@@ -41,9 +39,6 @@
* @key headful
* @bug 7024235
* @summary Tests JFrame.pack() with the JTabbedPane
* @library /lib/client/
* @build ExtendedRobot
* @author Sergey Malenkov
* @run main Test7024235
*/

@@ -54,12 +49,15 @@
public static void main(String[] args) throws Exception {
Test7024235 test = new Test7024235();
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
UIManager.setLookAndFeel(info.getClassName());
String className = info.getClassName();
System.out.println("className = " + className);
UIManager.setLookAndFeel(className);

test.test();
try {
ExtendedRobot robot = new ExtendedRobot();
robot.waitForIdle(1000);
Robot robot = new Robot();
robot.waitForIdle();
robot.delay(1000);
}catch(Exception ex) {
ex.printStackTrace();
throw new Error("Unexpected Failure");
@@ -81,6 +79,7 @@ public void run() {
JFrame frame = new JFrame();
frame.add(BorderLayout.WEST, this.pane);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);

test("first");
@@ -105,6 +104,9 @@ private void test(String step) {
this.passed = true;
for (int index = 0; index < this.pane.getTabCount(); index++) {
Rectangle bounds = this.pane.getBoundsAt(index);
if (bounds == null) {
continue;
}
int centerX = bounds.x + bounds.width / 2;
int centerY = bounds.y + bounds.height / 2;
int actual = this.pane.indexAtLocation(centerX, centerY);

1 comment on commit 2b47a58

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on 2b47a58 Oct 26, 2020

Please sign in to comment.