Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8225012: sanity/client/SwingSet/src/ToolTipDemoTest.java fails on Windows #1561

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
@@ -733,7 +733,7 @@ java/awt/Window/8159168/SetShapeTest.java 8274106 macosx-aarch64
java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java 8274106 macosx-aarch64
javax/swing/JFrame/8175301/ScaledFrameBackgroundTest.java 8274106 macosx-aarch64

sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all
sanity/client/SwingSet/src/ToolTipDemoTest.java 8293001 linux-all
sanity/client/SwingSet/src/ScrollPaneDemoTest.java 8225013 linux-all
sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java 8265770 macosx-all

18 changes: 12 additions & 6 deletions test/jdk/sanity/client/SwingSet/src/ToolTipDemoTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022 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
@@ -38,6 +38,7 @@

import org.jtregext.GuiTestListener;
import org.netbeans.jemmy.ClassReference;
import org.netbeans.jemmy.JemmyProperties;
import org.netbeans.jemmy.operators.JComponentOperator;
import org.netbeans.jemmy.operators.JFrameOperator;
import org.netbeans.jemmy.operators.JLabelOperator;
@@ -79,12 +80,20 @@ public class ToolTipDemoTest {
@Test(dataProvider = "availableLookAndFeels", dataProviderClass = TestHelpers.class)
public void test(String lookAndFeel) throws Exception {
UIManager.setLookAndFeel(lookAndFeel);

JemmyProperties.setCurrentDispatchingModel(JemmyProperties.ROBOT_MODEL_MASK |
JemmyProperties.SMOOTH_ROBOT_MODEL_MASK);

new ClassReference(ToolTipDemo.class.getCanonicalName()).startApplication();
JFrameOperator frameOperator = new JFrameOperator(DEMO_TITLE);
frameOperator.setComparator(EXACT_STRING_COMPARATOR);
// Setting the tooltip dismiss delay
ToolTipManager.sharedInstance().setDismissDelay(TOOLTIP_DISMISS_DELAY);

//activate window
frameOperator.clickMouse();
frameOperator.moveMouse(-1, -1);

// Verifying the plain tooltip properties
checkToolTip(frameOperator, PLAIN_TOOLTIP_COMP_TITLE,
PLAIN_TOOLTIP_TEXT);
@@ -116,18 +125,15 @@ public void test(String lookAndFeel) throws Exception {
*/
private void checkToolTip(JFrameOperator frameOperator, String compTitle,
String toolTipText) {

JLabelOperator toolTipHostComp =
new JLabelOperator(frameOperator, compTitle);
JToolTipOperator toolTipOperator =
new JToolTipOperator(toolTipHostComp.showToolTip());
toolTipOperator.waitTipText(toolTipText);
checkToolTipLocation(toolTipHostComp, toolTipOperator);

// Dismissing the tooltip by mouse click
toolTipHostComp.clickMouse();
// Dismissing the tooltip by moving the mouse out
toolTipHostComp.moveMouse(-1, -1);
toolTipOperator.waitComponentShowing(false);

}

private void checkToolTipLocation(JComponentOperator componentOpertor,