@@ -0,0 +1,75 @@
1+/*
2+ * Copyright (C) 2013 Canonical, Ltd.
3+ *
4+ * Authors:
5+ * Daniel d'Andrada <daniel.dandrada@canonical.com>
6+ *
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.
10+ *
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.
15+ *
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/>.
18+ */
19+
20+import QtQuick 2.0
21+import QtTest 1.0
22+import Unity.Test 0.1 as UT
23+
24+import "../.."
25+
26+Shell {
27+ id: shell
28+ UT.UnityTestCase {
29+ name: "Shell"
30+ when: windowShown
31+
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);
37+
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);
42+ }
43+
44+ /*
45+ Perform a right-edge drag when the Dash is being show and there are
46+ no running/minimized apps to be restored.
47+
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.
51+ */
52+ function test_rightEdgeDragWithNoRunningApps() {
53+ var touchX = shell.width - (shell.edgeSize / 2);
54+ var touchY = shell.height / 2;
55+
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);
60+
61+ touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
62+ true /* beginTouch */, false /* endTouch */);
63+
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);
67+
68+ touchRelease(shell, shell.width * 0.1, touchY);
69+
70+ // and now everything should have gone back to normal
71+ tryCompare(dash, "contentScale", 1.0);
72+ tryCompare(dash, "opacity", 1.0);
73+ }
74+ }
75+}