on xenial help sign in
Adapt to test changes
ba3ffd0Albert Astals
qml/Dash/GenericScopeView.qml+3−3
@@ -342,9 +342,9 @@ FocusScope {
342 item.displayMarginBeginning = 0;
342 item.displayMarginBeginning = 0;
343 item.displayMarginEnd = -baseItem.height;
343 item.displayMarginEnd = -baseItem.height;
344 } else {
344 } else {
345− item.displayMarginBeginning = -Math.max(-baseItem.y, 0);
345+ item.displayMarginBeginning = Math.round(-Math.max(-baseItem.y, 0));
346− item.displayMarginEnd = -Math.max(baseItem.height - seeAll.height
346+ item.displayMarginEnd = -Math.round(Math.max(baseItem.height - seeAll.height
347− - categoryView.height + baseItem.y, 0)
347+ - categoryView.height + baseItem.y, 0));
348 }
348 }
349 }
349 }
350 }
350 }
tests/qmltests/Dash/tst_GenericScopeView.qml+7−6
@@ -76,18 +76,19 @@ Item {
76 spy.signalName = "";
76 spy.signalName = "";
77 }
77 }
78
78
79− function scrollToCategory(category) {
79+ function scrollToCategory(categoryName) {
80 var categoryListView = findChild(genericScopeView, "categoryListView");
80 var categoryListView = findChild(genericScopeView, "categoryListView");
81 tryCompareFunction(function() {
81 tryCompareFunction(function() {
82− if (findChild(genericScopeView, category)) return true;
82+ var category = findChild(genericScopeView, categoryName);
83+ if (category && category.y > 0 && category.y < genericScopeView.height) return true;
83 mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
84 mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
84 genericScopeView.width/2, genericScopeView.y)
85 genericScopeView.width/2, genericScopeView.y)
85 tryCompare(categoryListView, "moving", false);
86 tryCompare(categoryListView, "moving", false);
86− return findChild(genericScopeView, category) !== null;
87+ return false;
87 }, true);
88 }, true);
88
89
89 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
90 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
90− return findChild(genericScopeView, category);
91+ return findChild(genericScopeView, categoryName);
91 }
92 }
92
93
93 function test_isActive() {
94 function test_isActive() {
@@ -262,7 +263,7 @@ Item {
262 if (category === undefined) category = 0;
263 if (category === undefined) category = 0;
263 if (delegate === undefined) delegate = 0;
264 if (delegate === undefined) delegate = 0;
264 tryCompareFunction(function() {
265 tryCompareFunction(function() {
265− var cardGrid = findChild(genericScopeView, category);
266+ var cardGrid = findChild(genericScopeView, "dashCategory"+category);
266 if (cardGrid != null) {
267 if (cardGrid != null) {
267 var tile = findChild(cardGrid, "delegate"+delegate);
268 var tile = findChild(cardGrid, "delegate"+delegate);
268 return tile != null;
269 return tile != null;
@@ -270,7 +271,7 @@ Item {
270 return false;
271 return false;
271 },
272 },
272 true);
273 true);
273− var tile = findChild(findChild(genericScopeView, category), "delegate"+delegate);
274+ var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
274 mouseClick(tile, tile.width / 2, tile.height / 2);
275 mouseClick(tile, tile.width / 2, tile.height / 2);
275 tryCompare(testCase.previewListView, "open", true);
276 tryCompare(testCase.previewListView, "open", true);
276 tryCompare(testCase.previewListView, "x", 0);
277 tryCompare(testCase.previewListView, "x", 0);