jdk/test/java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java
changeset 45019 20ad074a423f
parent 39056 d99e63b6d962
child 47166 dd1972cc4cd4
equal deleted inserted replaced
45018:28b32b8d67b6 45019:20ad074a423f
     1 /*
     1 /*
     2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    74         robot.mouseMove(point.x, point.y);
    74         robot.mouseMove(point.x, point.y);
    75         robot.waitForIdle();
    75         robot.waitForIdle();
    76 
    76 
    77         mouseDragAndDrop(robot, point, getCenterPoint(targetFrame));
    77         mouseDragAndDrop(robot, point, getCenterPoint(targetFrame));
    78 
    78 
    79         long time = System.currentTimeMillis() + 200;
    79         long time = System.currentTimeMillis() + 1000;
    80 
    80 
    81         while (!passed) {
    81         while (!passed) {
    82             if (time < System.currentTimeMillis()) {
    82             if (time < System.currentTimeMillis()) {
    83                 sourceFrame.dispose();
    83                 sourceFrame.dispose();
    84                 targetFrame.dispose();
    84                 targetFrame.dispose();
   220                 if (time < System.currentTimeMillis()) {
   220                 if (time < System.currentTimeMillis()) {
   221                     throw new RuntimeException("Dialog is not visible!");
   221                     throw new RuntimeException("Dialog is not visible!");
   222                 }
   222                 }
   223                 Thread.sleep(10);
   223                 Thread.sleep(10);
   224             }
   224             }
   225 
       
   226             Point point = getCenterPoint(dialog);
       
   227             Robot robot = new Robot();
   225             Robot robot = new Robot();
   228             robot.setAutoDelay(50);
   226             robot.setAutoDelay(50);
       
   227             robot.waitForIdle();
       
   228             robot.delay(200);
       
   229 
       
   230             Point point = getCenterPoint(dialog);
   229 
   231 
   230             robot.mouseMove(point.x, point.y);
   232             robot.mouseMove(point.x, point.y);
   231             robot.mousePress(InputEvent.BUTTON1_MASK);
   233             robot.mousePress(InputEvent.BUTTON1_MASK);
   232             robot.mouseRelease(InputEvent.BUTTON1_MASK);
   234             robot.mouseRelease(InputEvent.BUTTON1_MASK);
   233 
   235