@@ -0,0 +1,75 @@
2+ * Copyright (C) 2013 Canonical, Ltd.
5+ * Daniel d'Andrada <daniel.dandrada@canonical.com>
7+ * This program is free software; you can redistribute it and/or modify
8+ * it under the terms of the GNU General Public License as published by
9+ * the Free Software Foundation; version 3.
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
22+import Unity.Test 0.1 as UT
32+ function initTestCase() {
33+ // swipe away the greeter/lockscreen
34+ var touchX = shell.width - (shell.edgeSize / 2);
35+ var touchY = shell.height / 2;
36+ touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY);
38+ var dash = findChild(shell, "dash");
39+ // wait until the animation has finished
40+ tryCompare(dash, "contentScale", 1.0);
41+ tryCompare(dash, "opacity", 1.0);
45+ Perform a right-edge drag when the Dash is being show and there are
46+ no running/minimized apps to be restored.
48+ The expected behavior is that an animation should be played to hint the
49+ user that his right-edge drag gesture has been successfully recognized
50+ but there is no application to be brought to foreground.
52+ function test_rightEdgeDragWithNoRunningApps() {
53+ var touchX = shell.width - (shell.edgeSize / 2);
54+ var touchY = shell.height / 2;
56+ var dash = findChild(shell, "dash");
57+ // check that dash has normal scale and opacity
58+ compare(dash.contentScale, 1.0);
59+ compare(dash.opacity, 1.0);
61+ touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
62+ true /* beginTouch */, false /* endTouch */);
64+ // check that Dash has been scaled down and had its opacity reduced
65+ tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
66+ tryCompareFunction(function() { return dash.opacity <= 0.5; }, true);
68+ touchRelease(shell, shell.width * 0.1, touchY);
70+ // and now everything should have gone back to normal
71+ tryCompare(dash, "contentScale", 1.0);
72+ tryCompare(dash, "opacity", 1.0);