153
153
tryCompare(panel, "x", -panel.width, 1000);
156
function positionLauncherListAtBeginning() {
157
var listView = testCase.findChild(launcherLoader.item, "launcherListView");
158
listView.contentY = -listView.topMargin;
160
function positionLauncherListAtEnd() {
161
var listView = testCase.findChild(launcherLoader.item, "launcherListView");
162
if ((listView.contentHeight + listView.topMargin + listView.bottomMargin) > listView.height) {
163
listView.contentY = listView.topMargin + listView.contentHeight
156
168
// Drag from the left edge of the screen rightwards and check that the launcher
157
169
// appears (as if being dragged by the finger/pointer)
158
170
function test_dragLeftEdgeToRevealLauncherAndTapCenterToDismiss() {
179
191
launcherApplicationSelected("[...]dialer-app.desktop") */
180
192
function test_clickingOnAppIconCausesSignalEmission() {
181
193
dragLauncherIntoView();
182
launcher.lastSelectedApplication = ""
184
var listView = findChild(launcher, "launcherListView");
185
listView.positionViewAtEnd();
187
var appIcon = findChild(launcher, "launcherDelegate0")
189
verify(appIcon != undefined)
194
launcher.lastSelectedApplication = "";
195
launcher.inverted = false;
197
positionLauncherListAtBeginning();
199
var appIcon = findChild(launcher, "launcherDelegate0");
201
verify(appIcon != undefined);
193
205
tryCompare(launcher, "lastSelectedApplication",
196
208
// Tapping on an application icon also dismisses the launcher
197
waitUntilLauncherDisappears()
209
waitUntilLauncherDisappears();
200
212
/* If I click on the dash icon on the launcher
290
302
function test_clickFlick_data() {
291
303
var listView = findChild(launcher, "launcherListView");
293
{tag: "unfolded top", positionViewAtBeginning: false,
305
{tag: "unfolded top", positionViewAtBeginning: true,
294
306
clickY: listView.topMargin + units.gu(2),
295
307
expectFlick: false},
297
{tag: "folded top", positionViewAtBeginning: true,
309
{tag: "folded top", positionViewAtBeginning: false,
298
310
clickY: listView.topMargin + units.gu(2),
299
311
expectFlick: true},
301
{tag: "unfolded bottom", positionViewAtBeginning: true,
313
{tag: "unfolded bottom", positionViewAtBeginning: false,
302
314
clickY: listView.height - listView.topMargin - units.gu(1),
303
315
expectFlick: false},
305
{tag: "folded bottom", positionViewAtBeginning: false,
317
{tag: "folded bottom", positionViewAtBeginning: true,
306
318
clickY: listView.height - listView.topMargin - units.gu(1),
307
319
expectFlick: true},
311
323
function test_clickFlick(data) {
324
launcher.inverted = false;
312
325
launcher.lastSelectedApplication = "";
313
326
dragLauncherIntoView();
314
327
var listView = findChild(launcher, "launcherListView");
318
331
// So for stability's sake we just put the listView in the position
319
332
// we want to to actually start doing what this tests intends to check.
320
333
if (data.positionViewAtBeginning) {
321
listView.positionViewAtBeginning();
334
positionLauncherListAtBeginning();
323
listView.positionViewAtEnd();
336
positionLauncherListAtEnd();
325
338
tryCompare(listView, "flicking", false);
455
468
// Position launcher to where we need it
456
469
var listView = findChild(launcher, "launcherListView");
457
470
if (data.flickTo == "top") {
458
listView.positionViewAtEnd();
471
positionLauncherListAtBeginning();
460
listView.positionViewAtBeginning();
473
positionLauncherListAtEnd();
463
476
// Doing longpress