2
* Copyright 2014 Canonical Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
import Ubuntu.Test 1.0
20
import Ubuntu.Components 1.3
32
property bool checkedNow: true
33
onClicked: checkedNow = checked
39
property bool checkedNow: true
40
onClicked: checkedNow = checked
55
clickedSpy.target = null;
58
function test_toggle_checked_delayed_bug1524234_data() {
60
{tag: "CheckBox", testItem: testCheck, mouse: true},
61
{tag: "Switch", testItem: testSwitch, mouse: true},
62
{tag: "CheckBox, space key", testItem: testCheck, key: Qt.Key_Space},
63
{tag: "Switch, space key", testItem: testSwitch, key: Qt.Key_Space},
66
function test_toggle_checked_delayed_bug1524234(data) {
67
data.testItem.checkedNow = data.testItem.checked;
68
data.testItem.forceActiveFocus();
69
clickedSpy.target = data.testItem;
73
mouseClick(data.testItem, centerOf(data.testItem).x, centerOf(data.testItem).y);
76
compare(data.testItem.checkedNow, data.testItem.checked);