~ci-train-bot/unity8/unity8-ubuntu-zesty-2404

« back to all changes in this revision

Viewing changes to tests/qmltests/Launcher/tst_Launcher.qml

  • Committer: Nick Dedekind
  • Date: 2016-11-28 13:46:55 UTC
  • mfrom: (2704 unity8)
  • mto: This revision was merged to the branch mainline in revision 2752.
  • Revision ID: nick.dedekind@canonical.com-20161128134655-vd70a64pbci1b4oc
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
            }
114
114
            Label {
115
115
                text: "Launcher always visible"
 
116
                AbstractButton {
 
117
                    anchors.fill: parent
 
118
                    onClicked: lockedVisibleCheckBox.checked = !lockedVisibleCheckBox.checked
 
119
                }
116
120
            }
117
121
        }
118
122
 
261
265
            // iteration to do its work. So to ensure the reload, we will wait until the
262
266
            // Shell instance gets destroyed.
263
267
            tryCompare(launcherLoader, "itemDestroyed", true);
 
268
        }
 
269
 
 
270
        function initLauncher() {
264
271
            launcherLoader.active = true;
 
272
            tryCompare(launcherLoader, "itemDestroyed", false);
265
273
        }
 
274
 
266
275
        function init() {
 
276
            initLauncher();
267
277
            var panel = findChild(launcher, "launcherPanel");
268
278
            verify(!!panel);
269
279
 
279
289
            // growing while populating it with icons etc.
280
290
            tryCompare(listView, "flicking", false);
281
291
 
282
 
            compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded");
 
292
            tryCompare(listView, "contentY", -listView.topMargin, 5000, "Launcher did not start up with first item unfolded");
283
293
 
284
294
            // Now do check that snapping is in fact enabled
285
295
            compare(listView.snapMode, ListView.SnapToItem, "Snapping is not enabled");
287
297
            removeTimeConstraintsFromSwipeAreas(root);
288
298
        }
289
299
 
290
 
        function dragLauncherIntoView() {
 
300
        function dragLauncher() {
291
301
            var startX = launcher.dragAreaWidth/2;
292
302
            var startY = launcher.height/2;
293
303
            touchFlick(launcher,
294
304
                       startX, startY,
295
305
                       startX+units.gu(8), startY);
 
306
        }
 
307
 
 
308
        function dragLauncherIntoView() {
 
309
            dragLauncher();
296
310
 
297
311
            var panel = findChild(launcher, "launcherPanel");
298
312
            verify(!!panel);
534
548
        }
535
549
 
536
550
        function test_clickFlick_data() {
 
551
            initLauncher()
537
552
            var listView = findChild(launcher, "launcherListView");
538
553
            return [
539
554
                {tag: "unfolded top", positionViewAtBeginning: true,
1353
1368
            mouseWheel(launcherPanel, launcherPanel.width/2, launcherPanel.height/2, Qt.RightButton);
1354
1369
            tryCompare(clickThroughSpy, "count", 0);
1355
1370
        }
 
1371
 
 
1372
        function test_launcherEnabledSetting() {
 
1373
            launcher.available = true;
 
1374
 
 
1375
            dragLauncherIntoView();
 
1376
            var launcherPanel = findChild(launcher, "launcherPanel");
 
1377
            compare(launcherPanel.x, 0);
 
1378
 
 
1379
            launcher.available = true;
 
1380
        }
 
1381
 
 
1382
        function test_launcherDisabledSetting() {
 
1383
            launcher.available = false;
 
1384
 
 
1385
            //We don't actually care that it's visible, so juct use dragLauncher() rather than dragLauncherIntoView()
 
1386
            dragLauncher();
 
1387
            var launcherPanel = findChild(launcher, "launcherPanel");
 
1388
            compare(launcherPanel.x, -launcherPanel.width);
 
1389
 
 
1390
            launcher.available = true;
 
1391
        }
1356
1392
    }
1357
1393
}