Skip to content
Permalink
Browse files
8240202: A few client tests leave mouse buttons pressed
Reviewed-by: prr
  • Loading branch information
mrserb committed Feb 29, 2020
1 parent 55768aa commit 5e912fbec51d4863f9ef58befea2cc95fa7c0ea4
@@ -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
@@ -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 void run() {
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;
@@ -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 @@ private static void test() {
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 static void constructTestUI() {
myFrame.add(myButton, BorderLayout.CENTER);
myFrame.setSize(400, 300);
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myFrame.setLocationRelativeTo(null);
myFrame.setVisible(true);
}
}

0 comments on commit 5e912fb

Please sign in to comment.