28
28
width: units.gu(40)
29
29
height: units.gu(80)
32
// Fake. Make a few components less noisy
38
// Fake. Make a few components less noisy
31
// BEGIN To reduce warnings
32
// TODO I think it we should pass down these variables
33
// as needed instead of hoping they will be globally around
34
property var greeter: null
35
property var panel: null
36
// BEGIN To reduce warnings
43
38
property var scopeStatus: {
44
39
'MockScope1': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
45
40
'MockScope2': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
46
'home.scope': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
47
'applications.scope': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
41
'clickscope': { 'movementStarted': 0, 'positionedAtBeginning': 0 },
48
42
'MockScope5': { 'movementStarted': 0, 'positionedAtBeginning': 0 }
170
160
compare(movementStartedSpy.count, 1, "DashContent should have emitted movementStarted signal when content list did.");
171
161
compare(scopeStatus["MockScope1"].movementStarted, 1, "MockScope1 should have emitted movementStarted signal when content list did.");
172
162
compare(scopeStatus["MockScope2"].movementStarted, 1, "MockScope2 should have emitted movementStarted signal when content list did.");
173
compare(scopeStatus["home.scope"].movementStarted, 1, "home.scope should have emitted movementStarted signal when content list did.");
174
compare(scopeStatus["applications.scope"].movementStarted, 1, "applications.scope should have emitted movementStarted signal when content list did.");
163
compare(scopeStatus["clickscope"].movementStarted, 1, "clickscope should have emitted movementStarted signal when content list did.");
175
164
compare(scopeStatus["MockScope5"].movementStarted, 1, "MockScope5 should have emitted movementStarted signal when content list did.");
181
170
dashContent.positionedAtBeginning();
182
171
compare(scopeStatus["MockScope1"].positionedAtBeginning, 1, "MockScope1 should have emitted positionedAtBeginning signal when DashContent did.");
183
172
compare(scopeStatus["MockScope2"].positionedAtBeginning, 1, "MockScope2 should have emitted positionedAtBeginning signal when DashContent did.");
184
compare(scopeStatus["home.scope"].positionedAtBeginning, 1, "home.scope should have emitted positionedAtBeginning signal when DashContent did.");
185
compare(scopeStatus["applications.scope"].positionedAtBeginning, 1, "applications.scope should have emitted positionedAtBeginning signal when DashContent did.");
173
compare(scopeStatus["clickscope"].positionedAtBeginning, 1, "clickscope should have emitted positionedAtBeginning signal when DashContent did.");
186
174
compare(scopeStatus["MockScope5"].positionedAtBeginning, 1, "MockScope5 should have emitted positionedAtBeginning signal when DashContent did.");
221
209
function test_scope_mapping_data() {
223
{tag: "index0", index: 0, objectName: "fake_scopeView1"},
224
{tag: "index1", index: 1, objectName: "fake_scopeView2"},
225
{tag: "index2", index: 2, objectName: "fake_scopeView3"},
226
{tag: "index3", index: 3, objectName: "fake_scopeView4"},
227
{tag: "index4", index: 4, objectName: "fake_generic_scopeView"}
211
{tag: "index0", index: 0, objectName: "MockScope1"},
212
{tag: "index1", index: 1, objectName: "MockScope2"},
213
{tag: "index2", index: 2, objectName: "clickscope"},
214
{tag: "index3", index: 3, objectName: "MockScope5"}
335
324
tryCompareFunction(checkFlickMovingAndNotInteractive, true);
327
function openPreview() {
328
tryCompareFunction(function() {
329
var filterGrid = findChild(dashContent, "0");
330
if (filterGrid != null) {
331
var tile = findChild(filterGrid, "delegate0");
337
var tile = findChild(findChild(dashContent, "0"), "delegate0");
338
mouseClick(tile, tile.width / 2, tile.height / 2);
339
var previewListView = findChild(dashContent, "dashContentPreviewList");
340
tryCompare(previewListView, "open", true);
341
tryCompare(previewListView, "x", 0);
344
function closePreview() {
345
var closePreviewMouseArea = findChild(dashContent, "dashContentPreviewList_pageHeader_backButton");
346
mouseClick(closePreviewMouseArea, closePreviewMouseArea.width / 2, closePreviewMouseArea.height / 2);
348
var previewListView = findChild(dashContent, "dashContentPreviewList");
349
tryCompare(previewListView, "open", false);
352
function test_previewOpenClose() {
353
tryCompare(scopeLoadedSpy, "count", 4);
355
var previewListView = findChild(dashContent, "dashContentPreviewList");
356
tryCompare(previewListView, "open", false);
358
var categoryListView = findChild(dashContent, "categoryListView");
359
categoryListView.positionAtBeginning();
365
function test_showPreviewCarousel() {
366
tryCompareFunction(function() {
367
var scope = findChild(dashContent, "MockScope1 loader");
369
var dashCategory1 = findChild(scope, "dashCategory1");
370
if (dashCategory1 != null) {
371
var tile = findChild(dashCategory1, "carouselDelegate1");
379
tryCompare(scopeLoadedSpy, "count", 4);
381
var previewListView = findChild(dashContent, "dashContentPreviewList");
382
tryCompare(previewListView, "open", false);
384
var scope = findChild(dashContent, "MockScope1 loader");
385
var dashCategory1 = findChild(scope, "dashCategory1");
386
var tile = findChild(dashCategory1, "carouselDelegate1");
387
mouseClick(tile, tile.width / 2, tile.height / 2);
388
tryCompare(previewListView, "open", true);
389
tryCompare(previewListView, "x", 0);
394
function test_previewCycle() {
395
tryCompare(scopeLoadedSpy, "count", 4);
397
var categoryListView = findChild(dashContent, "categoryListView");
398
categoryListView.positionAtBeginning();
400
var previewListView = findChild(dashContent, "dashContentPreviewList");
401
tryCompare(previewListView, "open", false);
402
var previewListViewList = findChild(dashContent, "dashContentPreviewList_listView");
406
// flick to the next previews
407
tryCompare(previewListView, "count", 15);
408
for (var i = 1; i < previewListView.count; ++i) {
409
mouseFlick(previewListView, previewListView.width - units.gu(1),
410
previewListView.height / 2,
412
previewListView.height / 2);
413
tryCompare(previewListViewList, "moving", false);
414
tryCompare(previewListView.currentItem, "objectName", "previewItem" + i);