134
134
function test_clicking_data() {
136
{tag: "when Locked", status: BottomEdgeHint.Locked, xfail: false},
137
{tag: "when Active", status: BottomEdgeHint.Active, xfail: hasMouseAttached},
138
{tag: "when Inactive", status: BottomEdgeHint.Inactive, xfail: true},
139
{tag: "when Hidden", status: BottomEdgeHint.Hidden, xfail: true},
136
{tag: "when Locked", status: BottomEdgeHint.Locked, statusFail: false, xfail: false},
137
{tag: "when Active", status: BottomEdgeHint.Active, statusFail: hasMouseAttached, xfail: false},
138
{tag: "when Inactive", status: BottomEdgeHint.Inactive, statusFail: hasMouseAttached, xfail: !hasMouseAttached},
139
{tag: "when Hidden", status: BottomEdgeHint.Hidden, statusFail: hasMouseAttached, xfail: !hasMouseAttached},
142
142
function test_clicking(data) {
143
143
bottomEdgeHint.status = data.status;
144
compare(bottomEdgeHint.status, data.status);
144
// states cannot be set when mouse attached
145
if (!data.statusFail) {
146
compare(bottomEdgeHint.status, data.status);
145
148
mouseClick(bottomEdgeHint, centerOf(bottomEdgeHint).x, centerOf(bottomEdgeHint).y);
146
149
if (data.xfail) {
147
150
expectFailContinue(data.tag, "No click is expected");
152
155
function test_alter_deprecated_state_data() {
154
{tag: "Hidden", status: BottomEdgeHint.Hidden},
155
{tag: "Visible", status: BottomEdgeHint.Inactive},
157
{tag: "Hidden", status: hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Hidden},
158
{tag: "Visible", status: hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Inactive},
158
161
function test_alter_deprecated_state(data) {
206
209
// FIXME: must be executed before the test_hiding as flick with mouse affects
207
210
// the touch drag on ListView for some unknown reason
208
211
function test_0_touch_gesture() {
209
if (hasMouseAttached) {
210
skip("", "The test requires touch environment");
212
212
bottomEdgeHint.text = "Touch Activated";
213
213
var gestureStartPoint = Qt.point(centerOf(bottomEdgeHint).x, bottomEdgeHint.height - 1);
214
214
TestExtras.touchDrag(0, bottomEdgeHint, gestureStartPoint, Qt.point(0, -units.gu(8)), 6);
215
tryCompare(bottomEdgeHint, "status", BottomEdgeHint.Active, 400);
215
var expectedStatus = hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Active;
216
tryCompare(bottomEdgeHint, "status", expectedStatus, 400);
216
217
// then wait till we get back to Idle
217
tryCompare(bottomEdgeHint, "status", BottomEdgeHint.Inactive, 1000);
218
expectedStatus = hasMouseAttached ? BottomEdgeHint.Locked : BottomEdgeHint.Inactive;
219
tryCompare(bottomEdgeHint, "status", expectedStatus, 1000);
220
222
function test_custom_trigger_on_clicked() {