Skip to content

Commit

Permalink
8253980: javax/swing/plaf/synth/7158712/bug7158712.java fails on windows
Browse files Browse the repository at this point in the history
Reviewed-by: kizune, prr
  • Loading branch information
prsadhuk committed Oct 7, 2020
1 parent 703b345 commit bdd5782
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,6 @@ javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.ja
javax/swing/JMenuItem/6249972/bug6249972.java 8233640 macosx-all
javax/swing/JMenuItem/4171437/bug4171437.java 8233641 macosx-all
javax/swing/JMenu/4692443/bug4692443.java 8171998 macosx-all
javax/swing/plaf/synth/7158712/bug7158712.java 8238720 windows-all
javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8238720 windows-all

sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all
Expand Down
19 changes: 13 additions & 6 deletions test/jdk/javax/swing/plaf/synth/7158712/bug7158712.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,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
Expand Down Expand Up @@ -27,13 +27,19 @@
* @bug 7158712
* @summary Synth Property "ComboBox.popupInsets" is ignored
* @library ../../../regtesthelpers
* @author Pavel Porvatov
* @run main/othervm -Dsun.java2d.uiScale=1 bug7158712
*/

import javax.swing.*;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.plaf.basic.BasicComboPopup;
import javax.swing.plaf.synth.SynthLookAndFeel;
import java.awt.*;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Robot;
import java.awt.Point;
import java.awt.event.InputEvent;
import java.io.ByteArrayInputStream;
import java.util.concurrent.Callable;
Expand All @@ -59,15 +65,15 @@ public class bug7158712 {
public static void main(String[] args) throws Exception {
Robot robot = new Robot();

robot.setAutoDelay(500);
robot.setAutoDelay(100);

SynthLookAndFeel laf = new SynthLookAndFeel();

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

UIManager.setLookAndFeel(laf);

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

robot.waitForIdle();
robot.delay(1000);

Point comboBoxLocation = Util.invokeOnEDT(new Callable<Point>() {
@Override
Expand Down

1 comment on commit bdd5782

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on bdd5782 Oct 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.