on xenial help sign in
Fix dash overview test and prevent crash in mock ApplicationInfo's d'tor.

tryCompareFunction didn't work because .item threw. Approved by: Andrea Cimitan, PS Jenkins bot

commitb94dabbf122a94ed1daf0793f53fd4b0541b94a2 authorMichał Sawicz <michal.sawicz@canonical.com> dateSun 17 Aug 2014, 00:37 (12 years ago) parent2ab9bc84bafdb7
2 files changed+3−1
tests/mocks/Unity/Application/ApplicationInfo.cpp+1 tests/qmltests/Dash/tst_Dash.qml+2−1
tests/mocks/Unity/Application/ApplicationInfo.cpp+1
@@ -54,6 +54,7 @@ ApplicationInfo::~ApplicationInfo()
5454 if (m_surface) {
5555 Q_EMIT SurfaceManager::singleton()->surfaceDestroyed(m_surface);
5656 m_surface->deleteLater();
57+ setSurface(nullptr);
5758 }
5859}
5960
tests/qmltests/Dash/tst_Dash.qml+2−1
@@ -127,8 +127,9 @@ Item {
127127 tryCompare(scopes, "loaded", true);
128128 var dashContentList = findChild(dash, "dashContentList");
129129 tryCompare(dashContentList, "count", 6);
130+ tryCompareFunction(function() { return findChild(dash, "MockScope1 loader") != null; }, true);
130131 var mockScope1Loader = findChild(dash, "MockScope1 loader");
131− tryCompareFunction(function() { return mockScope1Loader.item != null; }, true);
132+ tryCompare(mockScope1Loader, "status", Loader.Ready);
132133
133134 // Show the overview
134135 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, dash.height - units.gu(18));