Merge lp:~aacid/unity8/findChildInTryCompareFunction into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 2602
Merged at revision: 2641
Proposed branch: lp:~aacid/unity8/findChildInTryCompareFunction
Merge into: lp:unity8
Diff against target: 379 lines (+28/-47)
10 files modified
tests/qmltests/Components/tst_Carousel.qml (+0/-1)
tests/qmltests/Components/tst_Lockscreen.qml (+1/-2)
tests/qmltests/Dash/Previews/tst_Preview.qml (+0/-2)
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml (+0/-4)
tests/qmltests/Dash/tst_CardTool.qml (+4/-4)
tests/qmltests/Dash/tst_Dash.qml (+8/-8)
tests/qmltests/Dash/tst_DashContent.qml (+5/-7)
tests/qmltests/Dash/tst_GenericScopeView.qml (+9/-15)
tests/qmltests/Panel/tst_IndicatorPage.qml (+0/-2)
tests/qmltests/tst_ShellWithPin.qml (+1/-2)
To merge this branch: bzr merge lp:~aacid/unity8/findChildInTryCompareFunction
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+304347@code.launchpad.net

Commit message

Improve findChild calls inside tryCompareFunction.

findChild has a timeout retry since a while ago. This means that if we have a findChild inside a tryCompareFunction the retries multiply and it takes around 30 minutes for the tryCompareFunction to fail if the findChild is failing, so what we do is set the timeout of findChild to 0.

In other cases we just had a tryCompareFunction that made sure the findChild after it would succeed, since now findChild has a retry mechanism we can just remove that tryCompareFunction altogether.

Description of the change

* Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2602
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2058/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2704
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1488
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1488
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1488
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2732
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2605
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2605
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2605
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2598/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2598
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2598/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2058/rebuild

review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

OK then. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/qmltests/Components/tst_Carousel.qml'
--- tests/qmltests/Components/tst_Carousel.qml 2015-07-15 15:07:19 +0000
+++ tests/qmltests/Components/tst_Carousel.qml 2016-08-30 09:46:12 +0000
@@ -268,7 +268,6 @@
268268
269 function test_activate() {269 function test_activate() {
270 var carouselList = findChild(carousel, "listView");270 var carouselList = findChild(carousel, "listView");
271 tryCompareFunction(function() { return findChild(carouselList, "carouselDelegate3") ? true : false; }, true);
272 var carouselItem = findChild(carousel, "carouselDelegate3")271 var carouselItem = findChild(carousel, "carouselDelegate3")
273 verify(carouselItem, "Could not find delegate");272 verify(carouselItem, "Could not find delegate");
274273
275274
=== modified file 'tests/qmltests/Components/tst_Lockscreen.qml'
--- tests/qmltests/Components/tst_Lockscreen.qml 2016-05-26 20:59:30 +0000
+++ tests/qmltests/Components/tst_Lockscreen.qml 2016-08-30 09:46:12 +0000
@@ -422,7 +422,6 @@
422 function test_infoPopup() {422 function test_infoPopup() {
423 verify(findChild(root, "infoPopup") === null);423 verify(findChild(root, "infoPopup") === null);
424 lockscreen.showInfoPopup("foo", "bar");424 lockscreen.showInfoPopup("foo", "bar");
425 tryCompareFunction(function() { return findChild(root, "infoPopup") !== null}, true);
426425
427 var infoPopup = findChild(root, "infoPopup");426 var infoPopup = findChild(root, "infoPopup");
428 compare(infoPopup.title, "foo");427 compare(infoPopup.title, "foo");
@@ -434,7 +433,7 @@
434 var okButton = findChild(root, "infoPopupOkButton");433 var okButton = findChild(root, "infoPopupOkButton");
435 mouseClick(okButton);434 mouseClick(okButton);
436435
437 tryCompareFunction(function() { return findChild(root, "infoPopup") === null}, true);436 tryCompareFunction(function() { return findChild(root, "infoPopup", 0 /* timeout */) === null}, true);
438437
439 tryCompare(signalSpy, "count", 1);438 tryCompare(signalSpy, "count", 1);
440 }439 }
441440
=== modified file 'tests/qmltests/Dash/Previews/tst_Preview.qml'
--- tests/qmltests/Dash/Previews/tst_Preview.qml 2016-05-02 08:15:14 +0000
+++ tests/qmltests/Dash/Previews/tst_Preview.qml 2016-08-30 09:46:12 +0000
@@ -78,7 +78,6 @@
7878
79 function test_containOnFocus() {79 function test_containOnFocus() {
80 waitForRendering(preview);80 waitForRendering(preview);
81 tryCompareFunction(function () { return findChild(preview, "widget-10") != null }, true);
82 var widget = findChild(preview, "widget-10");81 var widget = findChild(preview, "widget-10");
8382
84 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);83 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
@@ -94,7 +93,6 @@
9493
95 function test_containOnGrow() {94 function test_containOnGrow() {
96 waitForRendering(preview);95 waitForRendering(preview);
97 tryCompareFunction(function () { return findChild(preview, "widget-13") != null }, true);
98 var widget = findChild(preview, "widget-13");96 var widget = findChild(preview, "widget-13");
9997
100 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);98 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
10199
=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewHeader.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewHeader.qml 2016-03-10 22:39:24 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewHeader.qml 2016-08-30 09:46:12 +0000
@@ -116,7 +116,6 @@
116116
117 tryCompare(testCase.mascotShapeLoader, "visible", data.loaderVisible);117 tryCompare(testCase.mascotShapeLoader, "visible", data.loaderVisible);
118 if (data.loaderVisible) {118 if (data.loaderVisible) {
119 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
120 var mascot = findChild(previewHeader, "mascotShape")119 var mascot = findChild(previewHeader, "mascotShape")
121 tryCompare(mascot, "visible", data.visible);120 tryCompare(mascot, "visible", data.visible);
122 }121 }
@@ -165,20 +164,17 @@
165164
166 function test_fallback() {165 function test_fallback() {
167 previewHeader.widgetData = brokenheaderjson;166 previewHeader.widgetData = brokenheaderjson;
168 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
169 var mascot = findChild(previewHeader, "mascotShape");167 var mascot = findChild(previewHeader, "mascotShape");
170 compare(mascot.visible, false);168 compare(mascot.visible, false);
171169
172 previewHeader.widgetData = {};170 previewHeader.widgetData = {};
173 previewHeader.widgetData = fallbackheaderjson;171 previewHeader.widgetData = fallbackheaderjson;
174 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
175 var mascot = findChild(previewHeader, "mascotShape");172 var mascot = findChild(previewHeader, "mascotShape");
176 tryCompare(mascot, "visible", true);173 tryCompare(mascot, "visible", true);
177 tryCompare(mascot.source, "status", Image.Ready);174 tryCompare(mascot.source, "status", Image.Ready);
178175
179 previewHeader.widgetData = {};176 previewHeader.widgetData = {};
180 previewHeader.widgetData = emptyfallbackheaderjson;177 previewHeader.widgetData = emptyfallbackheaderjson;
181 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
182 var mascot = findChild(previewHeader, "mascotShape");178 var mascot = findChild(previewHeader, "mascotShape");
183 tryCompare(mascot, "visible", true);179 tryCompare(mascot, "visible", true);
184 tryCompare(mascot.source, "status", Image.Ready);180 tryCompare(mascot.source, "status", Image.Ready);
185181
=== modified file 'tests/qmltests/Dash/tst_CardTool.qml'
--- tests/qmltests/Dash/tst_CardTool.qml 2016-05-26 14:40:48 +0000
+++ tests/qmltests/Dash/tst_CardTool.qml 2016-08-30 09:46:12 +0000
@@ -339,22 +339,22 @@
339 function test_card_title_alignment(data) {339 function test_card_title_alignment(data) {
340 selector.selectedIndex = data.index;340 selector.selectedIndex = data.index;
341341
342 tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == Text.AlignLeft; }, true);342 tryCompareFunction(function() { return findChild(internalCard, "titleLabel", 0 /* timeout */).horizontalAlignment == Text.AlignLeft; }, true);
343343
344 cardTool.components['title'] = { "field": "title", "align": "center" };344 cardTool.components['title'] = { "field": "title", "align": "center" };
345 cardTool.componentsChanged();345 cardTool.componentsChanged();
346346
347 tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == data.value; }, true);347 tryCompareFunction(function() { return findChild(internalCard, "titleLabel", 0 /* timeout */).horizontalAlignment == data.value; }, true);
348348
349 cardTool.components['title'] = { "field": "title" };349 cardTool.components['title'] = { "field": "title" };
350 cardTool.componentsChanged();350 cardTool.componentsChanged();
351351
352 tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == data.value; }, true);352 tryCompareFunction(function() { return findChild(internalCard, "titleLabel", 0 /* timeout */).horizontalAlignment == data.value; }, true);
353353
354 cardTool.components['title'] = { "field": "title", "align": "left" };354 cardTool.components['title'] = { "field": "title", "align": "left" };
355 cardTool.componentsChanged();355 cardTool.componentsChanged();
356356
357 tryCompareFunction(function() { return findChild(internalCard, "titleLabel").horizontalAlignment == Text.AlignLeft; }, true);357 tryCompareFunction(function() { return findChild(internalCard, "titleLabel", 0 /* timeout */).horizontalAlignment == Text.AlignLeft; }, true);
358 }358 }
359359
360 function test_categoryLayout_data() {360 function test_categoryLayout_data() {
361361
=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
--- tests/qmltests/Dash/tst_Dash.qml 2016-06-21 08:14:56 +0000
+++ tests/qmltests/Dash/tst_Dash.qml 2016-08-30 09:46:12 +0000
@@ -76,7 +76,7 @@
76 var genericScopeView = dashContentList.currentItem;76 var genericScopeView = dashContentList.currentItem;
77 var categoryListView = findChild(genericScopeView, "categoryListView");77 var categoryListView = findChild(genericScopeView, "categoryListView");
78 tryCompareFunction(function() {78 tryCompareFunction(function() {
79 var category = findChild(genericScopeView, categoryName);79 var category = findChild(genericScopeView, categoryName, 0 /* timeout */);
80 if (category && category.y > 0 && category.y < genericScopeView.height) return true;80 if (category && category.y > 0 && category.y < genericScopeView.height) return true;
81 touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),81 touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),
82 genericScopeView.width/2, genericScopeView.y)82 genericScopeView.width/2, genericScopeView.y)
@@ -84,7 +84,7 @@
84 return false;84 return false;
85 }, true);85 }, true);
8686
87 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);87 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0", 0 /* timeout */) !== null; }, true);
88 return findChild(genericScopeView, categoryName);88 return findChild(genericScopeView, categoryName);
89 }89 }
9090
@@ -94,9 +94,9 @@
94 if (category === undefined) category = 0;94 if (category === undefined) category = 0;
95 if (delegate === undefined) delegate = 0;95 if (delegate === undefined) delegate = 0;
96 tryCompareFunction(function() {96 tryCompareFunction(function() {
97 var cardGrid = findChild(genericScopeView, "dashCategory"+category);97 var cardGrid = findChild(genericScopeView, "dashCategory"+category, 0 /* timeout */);
98 if (cardGrid != null) {98 if (cardGrid != null) {
99 var tile = findChild(cardGrid, "delegate"+delegate);99 var tile = findChild(cardGrid, "delegate"+delegate, 0 /* timeout */);
100 return tile != null;100 return tile != null;
101 }101 }
102 return false;102 return false;
@@ -473,9 +473,9 @@
473 compare(dashContentList.currentItem.scopeId, "MockScope1");473 compare(dashContentList.currentItem.scopeId, "MockScope1");
474474
475 tryCompareFunction(function() {475 tryCompareFunction(function() {
476 var cardGrid = findChild(dashContentList, "dashCategory0");476 var cardGrid = findChild(dashContentList, "dashCategory0", 0 /* timeout */);
477 if (cardGrid != null) {477 if (cardGrid != null) {
478 var tile = findChild(cardGrid, "delegate0");478 var tile = findChild(cardGrid, "delegate0", 0 /* timeout */);
479 return tile != null;479 return tile != null;
480 }480 }
481 return false;481 return false;
@@ -520,9 +520,9 @@
520 var categoryListView = findChild(dashTempScopeItem, "categoryListView");520 var categoryListView = findChild(dashTempScopeItem, "categoryListView");
521 categoryListView.positionAtBeginning();521 categoryListView.positionAtBeginning();
522 tryCompareFunction(function() {522 tryCompareFunction(function() {
523 var cardGrid = findChild(dashTempScopeItem, "dashCategory0");523 var cardGrid = findChild(dashTempScopeItem, "dashCategory0", 0 /* timeout */);
524 if (cardGrid != null) {524 if (cardGrid != null) {
525 var tile = findChild(cardGrid, "delegate0");525 var tile = findChild(cardGrid, "delegate0", 0 /* timeout */);
526 return tile != null;526 return tile != null;
527 }527 }
528 return false;528 return false;
529529
=== modified file 'tests/qmltests/Dash/tst_DashContent.qml'
--- tests/qmltests/Dash/tst_DashContent.qml 2016-08-03 15:51:32 +0000
+++ tests/qmltests/Dash/tst_DashContent.qml 2016-08-30 09:46:12 +0000
@@ -261,11 +261,11 @@
261261
262 function test_carouselAspectRatio() {262 function test_carouselAspectRatio() {
263 tryCompareFunction(function() {263 tryCompareFunction(function() {
264 var scope = findChild(dashContent, "scopeLoader0");264 var scope = findChild(dashContent, "scopeLoader0", 0 /* timeout */);
265 if (scope != null) {265 if (scope != null) {
266 var dashCategory1 = findChild(scope, "dashCategory1");266 var dashCategory1 = findChild(scope, "dashCategory1", 0 /* timeout */);
267 if (dashCategory1 != null) {267 if (dashCategory1 != null) {
268 var tile = findChild(dashCategory1, "carouselDelegate1");268 var tile = findChild(dashCategory1, "carouselDelegate1", 0 /* timeout */);
269 return tile != null;269 return tile != null;
270 }270 }
271 }271 }
@@ -282,7 +282,6 @@
282282
283 function test_mainNavigation() {283 function test_mainNavigation() {
284 var dashContentList = findChild(dashContent, "dashContentList");284 var dashContentList = findChild(dashContent, "dashContentList");
285 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
286 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");285 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
287 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");286 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
288 var searchButton = findChild(dashContentList.currentItem, "search_button");287 var searchButton = findChild(dashContentList.currentItem, "search_button");
@@ -405,7 +404,6 @@
405404
406 function goToSecondLevel() {405 function goToSecondLevel() {
407 var dashContentList = findChild(dashContent, "dashContentList");406 var dashContentList = findChild(dashContent, "dashContentList");
408 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);
409 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");407 var dashNavigation = findChild(dashContentList.currentItem, "dashNavigation");
410 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");408 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
411 var searchButton = findChild(dashContentList.currentItem, "search_button");409 var searchButton = findChild(dashContentList.currentItem, "search_button");
@@ -580,7 +578,7 @@
580578
581 function test_primaryFilter() {579 function test_primaryFilter() {
582 var dashContentList = findChild(dashContent, "dashContentList");580 var dashContentList = findChild(dashContent, "dashContentList");
583 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation") != null; }, true);581 tryCompareFunction(function() { return findChild(dashContentList.currentItem, "dashNavigation", 0 /* timeout */) != null; }, true);
584 dashContentList.currentItem.item.scope.setHasNavigation(false);582 dashContentList.currentItem.item.scope.setHasNavigation(false);
585 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");583 var peExtraPanel = findChild(dashContentList.currentItem, "peExtraPanel");
586 var searchButton = findChild(dashContentList.currentItem, "search_button");584 var searchButton = findChild(dashContentList.currentItem, "search_button");
@@ -589,7 +587,7 @@
589 mouseClick(searchButton);587 mouseClick(searchButton);
590 tryCompare(peExtraPanel, "visible", true);588 tryCompare(peExtraPanel, "visible", true);
591589
592 tryCompareFunction(function() { return findChild(peExtraPanel, "OSF3") != null; }, true);590 tryCompareFunction(function() { return findChild(peExtraPanel, "OSF3", 0 /* timeout */) != null; }, true);
593 }591 }
594592
595 function test_searchHint() {593 function test_searchHint() {
596594
=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
--- tests/qmltests/Dash/tst_GenericScopeView.qml 2016-06-29 14:45:18 +0000
+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2016-08-30 09:46:12 +0000
@@ -92,7 +92,7 @@
92 function scrollToCategory(categoryName) {92 function scrollToCategory(categoryName) {
93 var categoryListView = findChild(genericScopeView, "categoryListView");93 var categoryListView = findChild(genericScopeView, "categoryListView");
94 tryCompareFunction(function() {94 tryCompareFunction(function() {
95 var category = findChild(genericScopeView, categoryName);95 var category = findChild(genericScopeView, categoryName, 0 /* timeout */);
96 if (category && category.y > 0 && category.y < genericScopeView.height) return true;96 if (category && category.y > 0 && category.y < genericScopeView.height) return true;
97 touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),97 touchFlick(genericScopeView, genericScopeView.width/2, units.gu(20),
98 genericScopeView.width/2, genericScopeView.y)98 genericScopeView.width/2, genericScopeView.y)
@@ -100,7 +100,7 @@
100 return false;100 return false;
101 }, true);101 }, true);
102102
103 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0") !== null; }, true);103 tryCompareFunction(function() { return findChild(genericScopeView, "delegate0", 0 /* timeout */) !== null; }, true);
104 return findChild(genericScopeView, categoryName);104 return findChild(genericScopeView, categoryName);
105 }105 }
106106
@@ -163,7 +163,7 @@
163 }163 }
164164
165 function test_expand_collapse() {165 function test_expand_collapse() {
166 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);166 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0", 0 /* timeout */) != null; }, true);
167167
168 var category = findChild(genericScopeView, "dashCategory0")168 var category = findChild(genericScopeView, "dashCategory0")
169 var seeAll = findChild(category, "seeAll")169 var seeAll = findChild(category, "seeAll")
@@ -184,7 +184,7 @@
184184
185 function test_expand_expand_collapse() {185 function test_expand_expand_collapse() {
186 // wait for the item to be there186 // wait for the item to be there
187 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != null; }, true);187 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2", 0 /* timeout */) != null; }, true);
188188
189 var categoryListView = findChild(genericScopeView, "categoryListView");189 var categoryListView = findChild(genericScopeView, "categoryListView");
190 categoryListView.contentY = categoryListView.height;190 categoryListView.contentY = categoryListView.height;
@@ -212,7 +212,6 @@
212 }212 }
213213
214 function test_headerLink() {214 function test_headerLink() {
215 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader1") != null; }, true);
216 var header = findChild(genericScopeView, "dashSectionHeader1");215 var header = findChild(genericScopeView, "dashSectionHeader1");
217216
218 spy.target = genericScopeView.scope;217 spy.target = genericScopeView.scope;
@@ -231,7 +230,7 @@
231 categoryListView.contentY = categoryListView.height * 2;230 categoryListView.contentY = categoryListView.height * 2;
232231
233 // wait for the item to be there232 // wait for the item to be there
234 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader4") != null; }, true);233 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader4", 0 /* timeout */) != null; }, true);
235234
236 var categoryView = findChild(genericScopeView, "dashCategory4");235 var categoryView = findChild(genericScopeView, "dashCategory4");
237 verify(categoryView, "Can't find the category view.");236 verify(categoryView, "Can't find the category view.");
@@ -243,7 +242,6 @@
243 }242 }
244243
245 function test_narrow_delegate_ranges_expand() {244 function test_narrow_delegate_ranges_expand() {
246 tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") !== null; }, true);
247 var category = findChild(genericScopeView, "dashCategory0")245 var category = findChild(genericScopeView, "dashCategory0")
248 tryCompare(category, "expanded", false);246 tryCompare(category, "expanded", false);
249247
@@ -275,7 +273,6 @@
275 function test_single_category_expansion() {273 function test_single_category_expansion() {
276 genericScopeView.scope = scopes.getScope(3);274 genericScopeView.scope = scopes.getScope(3);
277275
278 tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
279 var category = findChild(genericScopeView, "dashCategory0")276 var category = findChild(genericScopeView, "dashCategory0")
280 compare(category.expandable, false, "Only category should not be expandable.");277 compare(category.expandable, false, "Only category should not be expandable.");
281278
@@ -289,9 +286,9 @@
289 if (category === undefined) category = 0;286 if (category === undefined) category = 0;
290 if (delegate === undefined) delegate = 0;287 if (delegate === undefined) delegate = 0;
291 tryCompareFunction(function() {288 tryCompareFunction(function() {
292 var cardGrid = findChild(genericScopeView, "dashCategory"+category);289 var cardGrid = findChild(genericScopeView, "dashCategory"+category, 0 /* timeout */);
293 if (cardGrid != null) {290 if (cardGrid != null) {
294 var tile = findChild(cardGrid, "delegate"+delegate);291 var tile = findChild(cardGrid, "delegate"+delegate, 0 /* timeout */);
295 return tile != null;292 return tile != null;
296 }293 }
297 return false;294 return false;
@@ -332,9 +329,9 @@
332 genericScopeView.scope = scopes.getScope("NullPreviewScope");329 genericScopeView.scope = scopes.getScope("NullPreviewScope");
333330
334 tryCompareFunction(function() {331 tryCompareFunction(function() {
335 var cardGrid = findChild(genericScopeView, 0);332 var cardGrid = findChild(genericScopeView, 0, 0 /* timeout */);
336 if (cardGrid != null) {333 if (cardGrid != null) {
337 var tile = findChild(cardGrid, 0);334 var tile = findChild(cardGrid, 0, 0 /* timeout */);
338 return tile != null;335 return tile != null;
339 }336 }
340 return false;337 return false;
@@ -385,7 +382,6 @@
385382
386 tryCompare(testCase.subPageLoader, "open", false);383 tryCompare(testCase.subPageLoader, "open", false);
387384
388 tryCompareFunction(function() { return findChild(category, "delegate1") != null; }, true);
389 var tile = findChild(category, "delegate1");385 var tile = findChild(category, "delegate1");
390386
391 mouseClick(tile);387 mouseClick(tile);
@@ -487,7 +483,6 @@
487483
488 scrollToEnd();484 scrollToEnd();
489485
490 tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory1") !== null; }, true);
491 var category1 = findChild(genericScopeView, "dashCategory1")486 var category1 = findChild(genericScopeView, "dashCategory1")
492 var seeAll1 = findChild(category1, "seeAll")487 var seeAll1 = findChild(category1, "seeAll")
493 verify(category1.expandable);488 verify(category1.expandable);
@@ -669,7 +664,6 @@
669 function test_carousel_borderSource() {664 function test_carousel_borderSource() {
670 var category = scrollToCategory("dashCategory1");665 var category = scrollToCategory("dashCategory1");
671 var tile = findChild(category, "carouselDelegate0");666 var tile = findChild(category, "carouselDelegate0");
672 tryCompareFunction(function() { return findChild(tile, "artShapeLoader") !== null; }, true);
673 var artShapeLoader = findChild(tile, "artShapeLoader");667 var artShapeLoader = findChild(tile, "artShapeLoader");
674 var shape = findChildsByType(artShapeLoader, "UCUbuntuShape");668 var shape = findChildsByType(artShapeLoader, "UCUbuntuShape");
675 compare(shape.borderSource, undefined);669 compare(shape.borderSource, undefined);
676670
=== modified file 'tests/qmltests/Panel/tst_IndicatorPage.qml'
--- tests/qmltests/Panel/tst_IndicatorPage.qml 2015-07-15 15:07:19 +0000
+++ tests/qmltests/Panel/tst_IndicatorPage.qml 2016-08-30 09:46:12 +0000
@@ -177,8 +177,6 @@
177 initializeMenuData(fullMenuData);177 initializeMenuData(fullMenuData);
178178
179 var menuId = "menu"+data.remove179 var menuId = "menu"+data.remove
180
181 tryCompareFunction(function() { return findChild(page, menuId) !== null;}, true);
182 var menu = findChild(page, menuId);180 var menu = findChild(page, menuId);
183181
184 menu.menuSelected();182 menu.menuSelected();
185183
=== modified file 'tests/qmltests/tst_ShellWithPin.qml'
--- tests/qmltests/tst_ShellWithPin.qml 2016-07-07 19:52:57 +0000
+++ tests/qmltests/tst_ShellWithPin.qml 2016-08-30 09:46:12 +0000
@@ -363,12 +363,11 @@
363363
364 enterPin("1111")364 enterPin("1111")
365 enterPin("1111")365 enterPin("1111")
366 tryCompareFunction(function() {return findChild(root, "infoPopup") !== null}, true)
367366
368 var dialog = findChild(root, "infoPopup")367 var dialog = findChild(root, "infoPopup")
369 var button = findChild(dialog, "infoPopupOkButton")368 var button = findChild(dialog, "infoPopupOkButton")
370 tap(button)369 tap(button)
371 tryCompareFunction(function() {return findChild(root, "infoPopup")}, null)370 tryCompareFunction(function() {return findChild(root, "infoPopup", 0 /* timeout */)}, null)
372371
373 tryCompare(resetSpy, "count", 0)372 tryCompare(resetSpy, "count", 0)
374 enterPin("1111")373 enterPin("1111")

Subscribers

People subscribed via source and target branches