void GTUtilsMSAEditorSequenceArea::checkSelection(HI::GUITestOpStatus &os, const QPoint &start, const QPoint &end, const QString &expected){
    GTWidget::click(os, GTUtilsMdi::activeWindow(os));
    selectArea(os, start, end);
    GTKeyboardDriver::keyClick( 'c', Qt::ControlModifier);
    GTGlobals::sleep(500);
    QString clipboardText = GTClipboard::text(os);
    GT_CHECK(clipboardText == expected, QString("unexpected selection:\n%1").arg(clipboardText));
}
Exemplo n.º 2
0
/**
 *
 * @param argc
 * @param argv
 * @return
 */
int
main(int argc, char *argv[]) {
    // result
    int ret = -1;

    // supress invalid option -- 'xyz' output
    int opterr = 0;

    Rect rect;
    rect.x = -1;
    rect.y = -1;
    rect.w = -1;
    rect.h = -1;

    // parse options
    int c = getopt(argc, argv, "dwm");
    switch (c) {
        case 'd': //
        case 'w': //
        case 'm': // desktop
        {
            // common stuff >>
            // get display + root window
            Display *disp = XOpenDisplay(NULL);
            if (disp != NULL) {
                Window root = XDefaultRootWindow(disp);
                switch (c) {
                    case 'd': // desktop
                        ret = getWindowGeometry(disp, &root, &rect);
                        break;
                    case 'w': // window
                        ret = selectWindow(disp, &root, &rect);
                        break;
                    case 'm': // mouse
                        ret = selectArea(disp, &root, &rect);
                        break;
                }

                // common stuff >>
                // close display
                XCloseDisplay(disp);
                // common stuff <<
            }
        }
            break;
    }

    if(rect.w % 2 != 0)
        rect.w++;
    if(rect.h % 2 != 0)
        rect.h++;
    //
    printf("%d %d %d %d %d\n", ret, rect.w, rect.h, rect.x, rect.y);
    return ret;
}
void GTUtilsMSAEditorSequenceArea::click(HI::GUITestOpStatus &os, QPoint p) {
    selectArea(os, p, p);
}