@@ -78,92 +78,56 @@ Item {
7878 return panel.mapFromItem(indicator_item, indicator_item.width/2, indicator_item.height/2);
7979 }
8080
81− function test_hint_data() { return get_window_data() }
82−
8381 // Pressing on the indicator panel should activate the indicator hints
8482 // and expose a portion of the conent.
85− function test_hint(data) {
86− panel.fullscreenMode = data.fullscreenFlag;
87−
88− var indicator_item_coord = get_indicator_item_position(0);
89− var indicator_revealer = findChild(panel, "indicatorRevealer");
90− verify(indicator_revealer != undefined)
91−
92− mousePress(panel,
93− indicator_item_coord.x, panel.panelHeight/2,
94− Qt.LeftButton, Qt.NoModifier , 0);
95−
96− if (!panel.fullscreenMode)
97− {
98− compare(indicator_revealer.hintingAnimation.running, true, "Indicator revealer hint animation should be running after mouse press on indicator panel in pinned mode");
99− tryCompare(indicator_revealer.hintingAnimation, "running", false);
100− tryCompare(panel.indicators, "partiallyOpened", true);
101− }
102− else
103− {
104− // nothing should happen
105− compare(indicator_revealer.hintingAnimation.running, false, "Indicator revealer hint animation should not be running after mouse press on indicator panel in fullscreen mode");
106− compare(panel.indicators.partiallyOpened, false, "Indicator should not be partially opened when panel is pressed in fullscreenmode");
107− compare(panel.indicators.fullyOpened, false, "Indicator should not be partially opened when panel is pressed in fullscreenmode");
108− }
109−
110− mouseRelease(panel,
111− indicator_item_coord.x, panel.panelHeight/2,
112− Qt.LeftButton, Qt.NoModifier , 0);
113− }
114−
115− function test_show_click_data() { return get_window_data() }
116−
117− // Clicking the indicator panel should fully open the inidicators
118− function test_show_click(data) {
119− panel.fullscreenMode = data.fullscreenFlag;
83+ function test_hint() {
84+ panel.fullscreenMode = false;
85+ // Wait for the indicators to get into position.
86+ // (switches between normal and fullscreen modes are animated)
87+ tryCompare(panel.indicators, "y", 0)
12088
12189 var indicator_item_coord = get_indicator_item_position(0);
12290
123− mouseClick(panel,
124− indicator_item_coord.x, panel.panelHeight/2,
125− Qt.LeftButton, Qt.NoModifier , 0);
91+ touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2)
12692
127− if (!panel.fullscreenMode)
128− {
129− compare(panel.indicators.showAnimation.running, true, "Show animation should run after panel is clicked in pinned mode.");
130− tryCompare(panel.indicators, "fullyOpened", true);
93+ // hint animation should be run, meaning that indicators will move downwards
94+ // by hintValue pixels without any drag taking place
95+ tryCompare(panel.indicators, "height",
96+ panel.indicators.panelHeight + panel.indicators.hintValue);
97+ tryCompare(panel.indicators, "partiallyOpened", true);
98+ tryCompare(panel.indicators, "fullyOpened", false);
13199
132− // click will activate device overview.
133− compare(findChild(panel.indicators, "indicatorRow").overviewActive, true, "Overview indicator should be avtive when indicators clicked.")
134− }
135− else
136− {
137− compare(panel.indicators.showAnimation.running, false, "Indicators should not open when panel is clicked in pinned mode.");
138− }
100+ touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2)
139101 }
140102
141− function test_show_press_release_data() { return get_window_data() }
142−
143− // Pressing and releasing on the indicator panel will fully open the indicators
144− function test_show_press_release(data) {
145− panel.fullscreenMode = data.fullscreenFlag;
103+ // Pressing on the top edge of the screen should have no effect if the panel
104+ // is hidden (!pinned), which is the case when a fullscreen app is being shown
105+ function test_noHintOnFullscreenMode() {
106+ panel.fullscreenMode = true;
107+ // Wait for the indicators to get into position.
108+ // (switches between normal and fullscreen modes are animated)
109+ tryCompare(panel.indicators, "y", -panel.panelHeight)
146110
147111 var indicator_item_coord = get_indicator_item_position(0);
148112
149− mousePress(panel,
150− indicator_item_coord.x, panel.panelHeight/2,
151− Qt.LeftButton, Qt.NoModifier , 0);
113+ touchPress(panel, indicator_item_coord.x, panel.panelHeight / 2)
152114
153− mouseRelease(panel,
154− indicator_item_coord.x, panel.panelHeight/2,
155− Qt.LeftButton, Qt.NoModifier , 0);
115+ // Give some time for a hint animation to change things, if any
116+ wait(500)
156117
157− if (!panel.fullscreenMode)
158− {
159− compare(panel.indicators.showAnimation.running, true, "Show animation should run after panel is clicked in pinned mode.");
160− tryCompare(panel.indicators, "fullyOpened", true);
161− }
162− else
163− {
164− // nothing should happen.
165− compare(panel.indicators.showAnimation.running, false, "Indicators should not open when panel is clicked in pinned mode.");
166− }
118+ // no hint animation when fullscreen
119+ compare(panel.indicators.y, -panel.panelHeight)
120+ var indicatorRow = findChild(panel.indicators, "indicatorRow");
121+ verify(indicatorRow != undefined)
122+ compare(indicatorRow.y, 0)
123+ compare(panel.indicators.height, panel.indicators.panelHeight)
124+ compare(panel.indicators.partiallyOpened, false,
125+ "Indicator should not be partially opened when panel is pressed in" +
126+ " fullscreenmode")
127+ compare(panel.indicators.fullyOpened, false, "Indicator should not be partially" +
128+ " opened when panel is pressed in fullscreenmode")
129+
130+ touchRelease(panel, indicator_item_coord.x, panel.panelHeight/2)
167131 }
168132
169133 function test_drag_show_data() { return get_window_data() }
@@ -174,9 +138,6 @@ Item {
174138 function test_drag_show(data) {
175139 panel.fullscreenMode = data.fullscreenFlag;
176140
177− var indicator_revealer = findChild(panel, "indicatorRevealer");
178− verify(indicator_revealer != undefined)
179−
180141 var indicator_row = findChild(panel.indicators, "indicatorRow");
181142 verify(indicator_row != undefined)
182143
@@ -186,6 +147,14 @@ Item {
186147 var menu_content = findChild(panel.indicators, "menuContent");
187148 verify(indicator_row != undefined)
188149
150+ // Wait for the indicators to get into position.
151+ // (switches between normal and fullscreen modes are animated)
152+ if (data.fullscreenFlag) {
153+ tryCompare(panel.indicators, "y", -panel.panelHeight)
154+ } else {
155+ tryCompare(panel.indicators, "y", 0)
156+ }
157+
189158 // do this for each indicator item
190159 for (var i = 0; i < row_repeater.count; i++) {
191160
@@ -194,40 +163,25 @@ Item {
194163
195164 var indicator_item_coord = get_indicator_item_position(i);
196165
197− // 1) Press on the panel
198− mousePress(panel,
199− indicator_item_coord.x, panel.panelHeight/2,
200− Qt.LeftButton, Qt.NoModifier , 0);
201−
202− if (!panel.fullscreenMode)
203− {
204− // hint animation should be run, and panel will end in partiallyOpened state.
205− compare(indicator_revealer.hintingAnimation.running, true, "Indicator revealer hint animation should be running after mouse press on indicator panel");
206− tryCompare(indicator_revealer.hintingAnimation, "running", false);
207− tryCompare(panel.indicators, "partiallyOpened", true);
208− }
209−
210− // 2) Drag the mouse down
211− var old_progress = panel.indicators.progress
212− mouseMove(panel,
213− indicator_item_coord.x, old_progress + (panel.height - old_progress)/2,
214− 0, Qt.LeftButton);
215−
216− // progress should increase.
217− var progress_increases = panel.indicators.progress > old_progress;
218− compare(progress_increases, true, "Progress has not increased on dragging indicator.");
166+ touchPress(panel,
167+ indicator_item_coord.x, panel.panelHeight / 2)
219168
220− mouseMove(panel,
221− indicator_item_coord.x, shell.y + shell.height,
222− 0, Qt.LeftButton);
169+ // 1) Drag the mouse down
170+ touchFlick(panel,
171+ indicator_item_coord.x, panel.panelHeight / 2,
172+ indicator_item_coord.x, panel.height * 0.8,
173+ false /* beginTouch */, false /* endTouch */)
223174
224− tryCompare(panel.indicators, "fullyOpened", true);
175+ // Indicators height should follow the drag, and therefore increase accordingly.
176+ // They should be at least half-way through the screen
177+ tryCompareFunction(
178+ function() {return panel.indicators.height >= panel.height * 0.5},
179+ true)
225180
226− mouseRelease(panel,
227− indicator_item_coord.x, indicator_item_coord.y + panel.height/2,
228− Qt.LeftButton, Qt.NoModifier , 0);
181+ touchRelease(panel, indicator_item_coord.x, panel.height * 0.8)
229182
230− compare(indicator_row.currentItem, indicator_item, "Incorrect item activated at position " + i);
183+ compare(indicator_row.currentItem, indicator_item,
184+ "Incorrect item activated at position " + i)
231185 compare(menu_content.__shown, true, "Menu conetent should be enabled for item at position " + i);
232186
233187 // init for next indicator_item
@@ -242,11 +196,10 @@ Item {
242196 var search_indicator = findChild(panel, "search");
243197 verify(search_indicator != undefined);
244198
245− mouseClick(search_indicator,
246− 1, 1,
247− Qt.LeftButton, Qt.NoModifier , 0);
199+ tap(search_indicator, 1, 1)
248200
249− compare(search_clicked, true, "Clicking search indicator while it was enabled did not emit searchClicked signal")
201+ compare(search_clicked, true,
202+ "Tapping search indicator while it was enabled did not emit searchClicked signal")
250203 }
251204
252205 function test_search_click_when_not_visible() {
@@ -256,11 +209,10 @@ Item {
256209 var search_indicator = findChild(panel, "search");
257210 verify(search_indicator != undefined);
258211
259− mouseClick(search_indicator,
260− 1, 1,
261− Qt.LeftButton, Qt.NoModifier , 0);
212+ tap(search_indicator, 1, 1)
262213
263− compare(search_clicked, false, "Clicking search indicator while it was not visible emitted searchClicked signal")
214+ compare(search_clicked, false,
215+ "Tapping search indicator while it was not visible emitted searchClicked signal")
264216 }
265217 }
266218}