SystemSelectionAWTTest.java 文件源码

java
阅读 59 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
public void doTest() throws Exception {
    ExtendedRobot robot = new ExtendedRobot();

    frame.setLocation(100, 100);
    robot.waitForIdle(2000);

    Point tf1Location = tf1.getLocationOnScreen();
    Dimension tf1Size = tf1.getSize();
    checkSecurity();

    if (clip != null) {
        robot.mouseMove(tf1Location.x + 5, tf1Location.y + tf1Size.height / 2);
        robot.waitForIdle(2000);
        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(20);
        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(20);
        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(20);
        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(2000);

        getClipboardContent();
        compareText();

        robot.mouseMove(tf1Location.x + tf1Size.width / 2, tf1Location.y + tf1Size.height / 2);
        robot.waitForIdle(2000);
        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(20);
        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(20);
        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(20);
        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
        robot.waitForIdle(2000);

        getClipboardContent();
        compareText();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号