8240202: A few client tests leave mouse buttons pressed

Reviewed-by: prr
This commit is contained in:
Sergey Bylokhov 2020-02-28 16:49:10 -08:00
parent 55768aa45d
commit 5e912fbec5
3 changed files with 9 additions and 6 deletions

View File

@ -155,7 +155,7 @@ java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java 8198626 macosx-
java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 8049405 macosx-all
java/awt/Mixing/AWT_Mixing/OpaqueOverlappingChoice.java 8048171 generic-all
java/awt/Mixing/AWT_Mixing/JMenuBarOverlapping.java 8159451 linux-all,windows-all,macosx-all
java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 8194765 generic-all
java/awt/Mixing/AWT_Mixing/JSplitPaneOverlapping.java 6986109 generic-all
java/awt/Mixing/AWT_Mixing/JInternalFrameMoveOverlapping.java 6986109 windows-all
java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java 8049405 generic-all
java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java 8049405 macosx-all

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 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
@ -119,12 +119,12 @@ public class JSplitPaneOverlapping extends OverlappingTestBase {
robot.mousePress(InputEvent.BUTTON1_MASK);
robot.mouseMove(splitterLoc.x - 50, splitterLoc.y);
Color c = robot.getPixelColor(splitterLoc.x - 50, splitterLoc.y);
robot.mouseRelease(InputEvent.BUTTON1_MASK);
System.out.println("Actual: "+c+", (not) expected: "+AWT_VERIFY_COLOR+" at "+(splitterLoc.x - 50)+", "+ splitterLoc.y);
if (!ignoreFail && c.equals(AWT_VERIFY_COLOR)) {
fail("The JSplitPane drag-n-drop image did not pass pixel color check and is overlapped");
}
robot.mouseRelease(InputEvent.BUTTON1_MASK);
clickAndBlink(robot, splitterLoc);
return clicked;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
@ -89,7 +89,9 @@ public class PressedButtonRightClickTest {
testRobot.delay(1000);
// Test whether the button is still pressed
if (myButton.getModel().isPressed() == false) {
boolean pressed = myButton.getModel().isPressed();
testRobot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
if (!pressed) {
disposeTestUI();
throw new RuntimeException("Test Failed!");
}
@ -107,6 +109,7 @@ public class PressedButtonRightClickTest {
myFrame.add(myButton, BorderLayout.CENTER);
myFrame.setSize(400, 300);
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setLocationRelativeTo(null);
myFrame.setVisible(true);
}
}