@@ -154,6 +154,7 @@ IndicatorTest {
154 // Dragging from a indicator item in the panel will gradually expose the
154 // Dragging from a indicator item in the panel will gradually expose the
155 // indicators, first by running the hint animation, then after dragging down will
155 // indicators, first by running the hint animation, then after dragging down will
156 // expose more of the panel, binding it to the selected indicator and opening it's menu.
156 // 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.
157 function test_drag_show(data) {
158 function test_drag_show(data) {
158 panel.fullscreenMode = data.fullscreen;
159 panel.fullscreenMode = data.fullscreen;
159 callManager.foregroundCall = data.call;
160 callManager.foregroundCall = data.call;
@@ -173,11 +174,13 @@ IndicatorTest {
174 for (var i = 0; i < indicatorsModel.originalModelData.length; i++) {
175 for (var i = 0; i < indicatorsModel.originalModelData.length; i++) {
175 var indicatorItem = get_indicator_item(i);
176 var indicatorItem = get_indicator_item(i);
176− var mappedPosition = root.mapFromItem(indicatorItem, indicatorItem.width / 2, indicatorItem.height / 2);
178+ var startXPosition = root.mapFromItem(indicatorItem, indicatorItem.width / 2, 0).x;
179+ var startYPosition = root.mapFromItem(panel, 0, 0).y;
178 touchFlick(panel,
181 touchFlick(panel,
179− mappedPosition.x, panel.indicators.minimizedPanelHeight / 2,
182+ startXPosition, startYPosition,
180− mappedPosition.x, panel.height,
183+ startXPosition, panel.height,
181 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
184 true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
183 // Indicators height should follow the drag, and therefore increase accordingly.
186 // Indicators height should follow the drag, and therefore increase accordingly.
@@ -186,7 +189,7 @@ IndicatorTest {
186 function() {return panel.indicators.height >= panel.height * 0.5},
189 function() {return panel.indicators.height >= panel.height * 0.5},
189− touchRelease(panel, mappedPosition.x, panel.height);
192+ touchRelease(panel, startXPosition, panel.height);
191 compare(indicatorRow.currentItemIndex, i, "Indicator item should be activated at position " + i);
194 compare(indicatorRow.currentItemIndex, i, "Indicator item should be activated at position " + i);
192 compare(menuContent.currentMenuIndex, i, "Menu conetent should be activated for item at position " + i);
195 compare(menuContent.currentMenuIndex, i, "Menu conetent should be activated for item at position " + i);
@@ -198,6 +201,64 @@ IndicatorTest {
204+ function test_drag_hide_data() {
206+ { tag: "pinned", fullscreen: false, call: null,
208+ { tag: "fullscreen", fullscreen: true, call: null,
209+ indicatorY: -panel.panelAndSeparatorHeight },
210+ { tag: "pinned-callActive", fullscreen: false, call: phoneCall,
212+ { tag: "fullscreen-callActive", fullscreen: true, call: phoneCall,
213+ indicatorY: -panel.panelAndSeparatorHeight }
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;
223+ var indicatorRow = findChild(panel.indicators, "indicatorItemRow");
224+ verify(indicatorRow !== null);
226+ var menuContent = findChild(panel.indicators, "menuContent");
227+ verify(menuContent !== null);
229+ var indicatorArea = findChild(panel, "indicatorArea");
230+ verify(indicatorArea !== null);
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);
236+ var startXPosition = root.mapFromItem(panel.indicators, panel.indicators.width / 2, 0).x;
237+ var startYPosition = root.mapFromItem(panel, 0, panel.height).y;
239+ panel.indicators.show();
240+ tryCompare(panel.indicators.showAnimation, "running", false);
241+ tryCompare(panel.indicators, "unitProgress", 1);
244+ touchFlick(panel.indicators,
245+ startXPosition, startYPosition,
247+ true /* beginTouch */, false /* endTouch */, units.gu(5), 15);
249+ // Indicators height should follow the drag, and therefore increase accordingly.
250+ // They should be at least half-way through the screen
252+ function() {return panel.indicators.height <= panel.height * 0.5},
255+ touchRelease(panel.indicators, startXPosition, 0);
257+ tryCompare(panel.indicators.hideAnimation, "running", true);
258+ tryCompare(panel.indicators.hideAnimation, "running", false);
259+ tryCompare(panel.indicators, "state", "initial");
201 function test_hint_data() {
262 function test_hint_data() {
203 { tag: "normal", fullscreen: false, call: null, hintExpected: true},
264 { tag: "normal", fullscreen: false, call: null, hintExpected: true},