@@ -0,0 +1,99 @@
1+/*
2+ * Copyright 2013 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.0
18+import QtTest 1.0
19+import Unity.Test 0.1 as UT
20+import "../../../Components"
21+
22+Item {
23+ id: root
24+ width: 700
25+ height: 500
26+
27+ DemoOverlay {
28+ id: top
29+ edge: "top"
30+ title: "Top"
31+ text: "Displayed on top left"
32+ x: 0
33+ y: 0
34+ width: parent.width/2
35+ height: parent.height/2
36+ }
37+
38+ DemoOverlay {
39+ id: right
40+ edge: "right"
41+ title: "Right"
42+ text: "Displayed on top right"
43+ x: parent.width/2
44+ y: 0
45+ width: parent.width/2
46+ height: parent.height/2
47+ }
48+
49+ DemoOverlay {
50+ id: left
51+ edge: "left"
52+ title: "Left"
53+ text: "Displayed on bottom right"
54+ x: parent.width/2
55+ y: parent.height/2
56+ width: parent.width/2
57+ height: parent.height/2
58+ enabled: false
59+ }
60+
61+ DemoOverlay {
62+ id: bottom
63+ edge: "bottom"
64+ title: "Bottom"
65+ text: "Displayed on bottom left"
66+ x: 0
67+ y: parent.height/2
68+ width: parent.width/2
69+ height: parent.height/2
70+ }
71+
72+ SignalSpy {
73+ id: signalSpy
74+ target: bottom
75+ }
76+
77+ UT.UnityTestCase {
78+ name: "DemoOverlay"
79+ when: windowShown
80+
81+ function test_animations() {
82+ compare(right.__anim_running, 1)
83+
84+ compare(left.__anim_running, 0)
85+ left.enabled = true
86+ compare(left.__anim_running, 1)
87+ }
88+
89+ function test_skip() {
90+ signalSpy.signalName = "skip"
91+ signalSpy.clear()
92+ var bottomSkip = findChild(bottom, "skipLabel")
93+ mousePress(bottomSkip, 1, 1)
94+ mouseRelease(bottomSkip, 1, 1)
95+ signalSpy.wait()
96+ compare(bottom.enabled, false)
97+ }
98+ }
99+}