< prev index next >
test/java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -19,23 +19,28 @@
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
-import java.awt.*;
+import java.awt.EventQueue;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.SystemTray;
+import java.awt.TrayIcon;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
/*
* @test
+ * @bug 8161473
+ * @key headful
* @summary Check if MouseEvent has the proper modifiers when
* TrayIcon is clicked pressing the modifier keys
- * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
* @library /java/awt/patchlib
* @library ../../../../lib/testlibrary ../
* @build java.desktop/java.awt.Helper
* @build ExtendedRobot SystemTrayIconHelper
* @run main TrayIconEventModifiersTest
@@ -211,10 +216,11 @@
for (int i = 0; i < buttonTypes.length; i++) {
for (int j = 0; j < keyTypes.length; j++) {
mousePressed = false;
robot.keyPress(keyTypes[j]);
+ robot.waitForIdle();
robot.mousePress(buttonTypes[i]);
if (! mousePressed) {
synchronized (mouseLock) {
try {
< prev index next >