Skip to content

Commit bdd5782

Browse files
committed
8253980: javax/swing/plaf/synth/7158712/bug7158712.java fails on windows
Reviewed-by: kizune, prr
1 parent 703b345 commit bdd5782

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

test/jdk/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,6 @@ javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.ja
833833
javax/swing/JMenuItem/6249972/bug6249972.java 8233640 macosx-all
834834
javax/swing/JMenuItem/4171437/bug4171437.java 8233641 macosx-all
835835
javax/swing/JMenu/4692443/bug4692443.java 8171998 macosx-all
836-
javax/swing/plaf/synth/7158712/bug7158712.java 8238720 windows-all
837836
javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8238720 windows-all
838837

839838
sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all

test/jdk/javax/swing/plaf/synth/7158712/bug7158712.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012,2020 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,13 +27,19 @@
2727
* @bug 7158712
2828
* @summary Synth Property "ComboBox.popupInsets" is ignored
2929
* @library ../../../regtesthelpers
30-
* @author Pavel Porvatov
30+
* @run main/othervm -Dsun.java2d.uiScale=1 bug7158712
3131
*/
3232

33-
import javax.swing.*;
33+
import javax.swing.JComboBox;
34+
import javax.swing.JFrame;
35+
import javax.swing.SwingUtilities;
3436
import javax.swing.plaf.basic.BasicComboPopup;
3537
import javax.swing.plaf.synth.SynthLookAndFeel;
36-
import java.awt.*;
38+
import javax.swing.UIManager;
39+
import java.awt.BorderLayout;
40+
import java.awt.Dimension;
41+
import java.awt.Robot;
42+
import java.awt.Point;
3743
import java.awt.event.InputEvent;
3844
import java.io.ByteArrayInputStream;
3945
import java.util.concurrent.Callable;
@@ -59,15 +65,15 @@ public class bug7158712 {
5965
public static void main(String[] args) throws Exception {
6066
Robot robot = new Robot();
6167

62-
robot.setAutoDelay(500);
68+
robot.setAutoDelay(100);
6369

6470
SynthLookAndFeel laf = new SynthLookAndFeel();
6571

6672
laf.load(new ByteArrayInputStream(SYNTH_XML.getBytes("UTF8")), bug7158712.class);
6773

6874
UIManager.setLookAndFeel(laf);
6975

70-
EventQueue.invokeAndWait(new Runnable() {
76+
SwingUtilities.invokeAndWait(new Runnable() {
7177
public void run() {
7278
comboBox = new JComboBox<>(
7379
new String[]{"Very Looooooooooooooooooooong Text Item 1", "Item 2"});
@@ -83,6 +89,7 @@ public void run() {
8389
});
8490

8591
robot.waitForIdle();
92+
robot.delay(1000);
8693

8794
Point comboBoxLocation = Util.invokeOnEDT(new Callable<Point>() {
8895
@Override

0 commit comments

Comments
 (0)