robot.mouseMove(pt.x + label.getWidth()/2, pt.y + label.getHeight()/2);
robot.mousePress(MouseEvent.BUTTON2_MASK);
robot.mouseRelease(MouseEvent.BUTTON2_MASK);
Timer timer = new Timer();
while (!watcher.gotClick) {
if (timer.elapsed() > EVENT_GENERATION_DELAY)
fail("Never received button 2 click event");
robot.delay(200);
}
assertEquals("This platform has bad robot button 2 mask mapping",
MouseEvent.BUTTON2_MASK, watcher.modifiers);