@@ -154,6 +154,7 @@ IndicatorTest {
154154 // Dragging from a indicator item in the panel will gradually expose the
155155 // indicators, first by running the hint animation, then after dragging down will
156156 // expose more of the panel, binding it to the selected indicator and opening it's menu.
157+ // Tested from first Y pixel to check for swipe from offscreen.
157158 function test_drag_show(data) {
158159 panel.fullscreenMode = data.fullscreen;
159160 callManager.foregroundCall = data.call;
@@ -173,11 +174,13 @@ IndicatorTest {
173174
174175 for (var i = 0; i < indicatorsModel.originalModelData.length; i++) {
175176 var indicatorItem = get_indicator_item(i);
176− var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width / 2, indicatorItem.height / 2);
177+
178+ var startXPosition = root.mapFromItem(indicatorItem, indicatorItem.width / 2, 0).x;
179+ var startYPosition = root.mapFromItem(panel, 0, 0).y;
177180
178181 touchFlick(panel,
179− mappedPosition.x, panel.indicators.minimizedPanelHeight / 2,
180− mappedPosition.x, panel.height,
182+ startXPosition, startYPosition,
183+ startXPosition, panel.height,
181184 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
182185
183186 // Indicators height should follow the drag, and therefore increase accordingly.
@@ -186,7 +189,7 @@ IndicatorTest {
186189 function() {return panel.indicators.height >= panel.height * 0.5},
187190 true);
188191
189− touchRelease(panel, mappedPosition.x, panel.height);
192+ touchRelease(panel, startXPosition, panel.height);
190193
191194 compare(indicatorRow.currentItemIndex, i, "Indicator item should be activated at position " + i);
192195 compare(menuContent.currentMenuIndex, i, "Menu conetent should be activated for item at position " + i);
@@ -198,6 +201,64 @@ IndicatorTest {
198201 }
199202 }
200203
204+ function test_drag_hide_data() {
205+ return [
206+ { tag: "pinned", fullscreen: false, call: null,
207+ indicatorY: 0 },
208+ { tag: "fullscreen", fullscreen: true, call: null,
209+ indicatorY: -panel.panelAndSeparatorHeight },
210+ { tag: "pinned-callActive", fullscreen: false, call: phoneCall,
211+ indicatorY: 0},
212+ { tag: "fullscreen-callActive", fullscreen: true, call: phoneCall,
213+ indicatorY: -panel.panelAndSeparatorHeight }
214+ ];
215+ }
216+
217+ // Dragging the shown indicators up from bottom of panel will hide the indicators
218+ // Tested from last Y pixel to check for swipe from offscreen.
219+ function test_drag_hide(data) {
220+ panel.fullscreenMode = data.fullscreen;
221+ callManager.foregroundCall = data.call;
222+
223+ var indicatorRow = findChild(panel.indicators, "indicatorItemRow");
224+ verify(indicatorRow !== null);
225+
226+ var menuContent = findChild(panel.indicators, "menuContent");
227+ verify(menuContent !== null);
228+
229+ var indicatorArea = findChild(panel, "indicatorArea");
230+ verify(indicatorArea !== null);
231+
232+ // Wait for the indicators to get into position.
233+ // (switches between normal and fullscreen modes are animated)
234+ tryCompareFunction(function() { return indicatorArea.y }, data.indicatorY);
235+
236+ var startXPosition = root.mapFromItem(panel.indicators, panel.indicators.width / 2, 0).x;
237+ var startYPosition = root.mapFromItem(panel, 0, panel.height).y;
238+
239+ panel.indicators.show();
240+ tryCompare(panel.indicators.showAnimation, "running", false);
241+ tryCompare(panel.indicators, "unitProgress", 1);
242+
243+
244+ touchFlick(panel.indicators,
245+ startXPosition, startYPosition,
246+ startXPosition, 0,
247+ true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
248+
249+ // Indicators height should follow the drag, and therefore increase accordingly.
250+ // They should be at least half-way through the screen
251+ tryCompareFunction(
252+ function() {return panel.indicators.height <= panel.height * 0.5},
253+ true);
254+
255+ touchRelease(panel.indicators, startXPosition, 0);
256+
257+ tryCompare(panel.indicators.hideAnimation, "running", true);
258+ tryCompare(panel.indicators.hideAnimation, "running", false);
259+ tryCompare(panel.indicators, "state", "initial");
260+ }
261+
201262 function test_hint_data() {
202263 return [
203264 { tag: "normal", fullscreen: false, call: null, hintExpected: true},