on xenial help sign in
test the launcher teasing
e61f5f8Michael Zanetti
tests/qmltests/Launcher/tst_Launcher.qml+21
@@ -43,6 +43,18 @@ Item {
43 onDashItemSelected: {
43 onDashItemSelected: {
44 dashItemSelected_count++;
44 dashItemSelected_count++;
45 }
45 }
46+
47+ property int maxPanelX: 0
48+ }
49+
50+ Connections {
51+ target: testCase.findChild(launcher, "launcherPanel")
52+
53+ onXChanged: {
54+ if (target.x > launcher.maxPanelX) {
55+ launcher.maxPanelX = target.x;
56+ }
57+ }
46 }
58 }
47
59
48 UT.UnityTestCase {
60 UT.UnityTestCase {
@@ -126,5 +138,14 @@ Item {
126 var panel = findChild(launcher, "launcherPanel")
138 var panel = findChild(launcher, "launcherPanel")
127 tryCompare(panel, "x", -panel.width, 1000)
139 tryCompare(panel, "x", -panel.width, 1000)
128 }
140 }
141+
142+ function test_teaseLauncher() {
143+ launcher.maxPanelX = -99999999;
144+ launcher.tease();
145+ // Check if the launcher slides in for units.gu(2). However, as the animation is 200ms
146+ // and the teaseTimer's timeout too, give it a 2 pixels grace distance
147+ tryCompareFunction(function(){return launcher.maxPanelX >= -launcher.panelWidth + units.gu(2) - 2;}, true)
148+ waitUntilLauncherDisappears();
149+ }
129 }
150 }
130}
151}