Comment 1 for bug 1420531

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

The following QML file should confirm that the mouse cursor has constantly moved for 10s:

import QtQuick 2.0
import Ubuntu.Components 0.1

Rectangle {
    width: 500
    height: 500

    MouseArea {
        anchors.fill: parent
        anchors.margins: 30
        onPositionChanged: {
            if (timer2.running) {
                timer2.restart();
            }
        }
        hoverEnabled: true
    }

    Button {
        id: control
        anchors.centerIn: parent
        text: "START"
        onClicked: {
            timer3.running = true
            text = "MOVE YOUR MOUSE"
        }
    }

    Timer {
        id: timer1
        interval: 1000
        running: true
        repeat: true
        property int timeout: 8
        onTriggered: {
            timeout = timeout - 1
            if (timeout <= 0) {
                running = false
                console.log("PASS")
                Qt.quit()
            }
        }
    }

    Timer {
        id: timer2
        interval: 200
        running: false
        repeat: true
        onTriggered: {
            running = false
            console.log("FAIL !!!!")
            Qt.quit()
        }
    }

    Timer {
        id: timer3
        interval: 2000
        running: false
        onTriggered: {
            timer2.running = true
        }
    }
}