on xenial help sign in
test the launcher teasing
commite61f5f8e7c1718021036d744b9089f529a91022a authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 28 Jun 2013, 14:57 (13 years ago) parent90ada3c
1 file changed+21
tests/qmltests/Launcher/tst_Launcher.qml+21
tests/qmltests/Launcher/tst_Launcher.qml+21
@@ -43,6 +43,18 @@ Item {
4343 onDashItemSelected: {
4444 dashItemSelected_count++;
4545 }
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+ }
4658 }
4759
4860 UT.UnityTestCase {
@@ -126,5 +138,14 @@ Item {
126138 var panel = findChild(launcher, "launcherPanel")
127139 tryCompare(panel, "x", -panel.width, 1000)
128140 }
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+ }
129150 }
130151}