~zsombi/ubuntu-ui-toolkit/listitemSelectModeBugs

« back to all changes in this revision

Viewing changes to tests/unit_x11/tst_components/tst_bottomedgehint.qml

  • Committer: Zsombor Egri
  • Date: 2015-12-07 17:02:28 UTC
  • mfrom: (1662.2.80 staging)
  • Revision ID: zsombor.egri@canonical.com-20151207170228-coqv9fvqublui315
staging sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
 
134
134
        function test_clicking_data() {
135
135
            return [
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},
140
140
            ];
141
141
        }
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);
 
147
            }
145
148
            mouseClick(bottomEdgeHint, centerOf(bottomEdgeHint).x, centerOf(bottomEdgeHint).y);
146
149
            if (data.xfail) {
147
150
                expectFailContinue(data.tag, "No click is expected");
151
154
 
152
155
        function test_alter_deprecated_state_data() {
153
156
            return [
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},
156
159
            ];
157
160
        }
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");
211
 
            }
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);
218
220
        }
219
221
 
220
222
        function test_custom_trigger_on_clicked() {