on xenial help sign in
Adapt to test changes
commitba3ffd01920e464e681c8117a77629c6ee9d25f5 authorAlbert Astals <albert.astals@canonical.com> dateWed 27 Aug 2014, 15:46 (12 years ago) parent6bc54ff
2 files changed+10−9
qml/Dash/GenericScopeView.qml+3−3 tests/qmltests/Dash/tst_GenericScopeView.qml+7−6
qml/Dash/GenericScopeView.qml+3−3
@@ -342,9 +342,9 @@ FocusScope {
342342 item.displayMarginBeginning = 0;
343343 item.displayMarginEnd = -baseItem.height;
344344 } else {
345− item.displayMarginBeginning = -Math.max(-baseItem.y, 0);
346− item.displayMarginEnd = -Math.max(baseItem.height - seeAll.height
347− - categoryView.height + baseItem.y, 0)
345+ item.displayMarginBeginning = Math.round(-Math.max(-baseItem.y, 0));
346+ item.displayMarginEnd = -Math.round(Math.max(baseItem.height - seeAll.height
347+ - categoryView.height + baseItem.y, 0));
348348 }
349349 }
350350 }
tests/qmltests/Dash/tst_GenericScopeView.qml+7−6
@@ -76,18 +76,19 @@ Item {
7676 spy.signalName = "";
7777 }
7878
79− function scrollToCategory(category) {
79+ function scrollToCategory(categoryName) {
8080 var categoryListView = findChild(genericScopeView, "categoryListView");
8181 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;
8384 mouseFlick(genericScopeView, genericScopeView.width/2, genericScopeView.height,
8485 genericScopeView.width/2, genericScopeView.y)
8586 tryCompare(categoryListView, "moving", false);
86− return findChild(genericScopeView, category) !== null;
87+ return false;
8788 }, true);
8889
8990 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);
90− return findChild(genericScopeView, category);
91+ return findChild(genericScopeView, categoryName);
9192 }
9293
9394 function test_isActive() {
@@ -262,7 +263,7 @@ Item {
262263 if (category === undefined) category = 0;
263264 if (delegate === undefined) delegate = 0;
264265 tryCompareFunction(function() {
265− var cardGrid = findChild(genericScopeView, category);
266+ var cardGrid = findChild(genericScopeView, "dashCategory"+category);
266267 if (cardGrid != null) {
267268 var tile = findChild(cardGrid, "delegate"+delegate);
268269 return tile != null;
@@ -270,7 +271,7 @@ Item {
270271 return false;
271272 },
272273 true);
273− var tile = findChild(findChild(genericScopeView, category), "delegate"+delegate);
274+ var tile = findChild(findChild(genericScopeView, "dashCategory"+category), "delegate"+delegate);
274275 mouseClick(tile, tile.width / 2, tile.height / 2);
275276 tryCompare(testCase.previewListView, "open", true);
276277 tryCompare(testCase.previewListView, "x", 0);