on xenial help sign in
removed unused test function
commit66344cf635dbd37bc673b541af96061d767dac8b authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 23 Jun 2014, 17:40 (12 years ago) parentb2d121a
2 files changed+9−40
tests/qmltests/Panel/tst_Panel.qml+9−11 tests/utils/modules/Unity/Test/UnityTestCase.qml−29
tests/qmltests/Panel/tst_Panel.qml+9−11
@@ -56,8 +56,6 @@ Item {
5656 height: units.gu(4)
5757 }
5858
59− onSearchClicked: console.log("Search Clicked")
60−
6159 property real panelAndSeparatorHeight: panel.indicators.panelHeight + units.dp(2)
6260
6361 Component.onCompleted: {
@@ -172,8 +170,8 @@ Item {
172170
173171 // hint animation should be run, meaning that indicators will move downwards
174172 // by hintValue pixels without any drag taking place
175− tryCompareFunction2(function() { return panel.indicators.height },
176− function() { return panel.indicators.panelHeight + panel.indicators.hintValue });
173+ tryCompareFunction(function() { return panel.indicators.height },
174+ panel.indicators.panelHeight + panel.indicators.hintValue);
177175 tryCompare(panel.indicators, "partiallyOpened", true);
178176 tryCompare(panel.indicators, "fullyOpened", false);
179177
@@ -231,17 +229,17 @@ Item {
231229 function test_drag_show_data() {
232230 return [
233231 { tag: "pinned", fullscreenFlag: false, alreadyOpen: false, call: false,
234− indicatorY: function() { return 0 } },
232+ indicatorY: 0 },
235233 { tag: "fullscreen", fullscreenFlag: true, alreadyOpen: false, call: false,
236− indicatorY: function() {return -panel.panelAndSeparatorHeight } },
234+ indicatorY: -panel.panelAndSeparatorHeight },
237235 { tag: "pinned-alreadyOpen", fullscreenFlag: false, alreadyOpen: true, call: false,
238− indicatorY: function() { return 0 } },
236+ indicatorY: 0 },
239237 { tag: "fullscreen-alreadyOpen", fullscreenFlag: true, alreadyOpen: true, call: false,
240− indicatorY: function() {return 0 } },
238+ indicatorY: 0 },
241239 { tag: "pinned-callActive", fullscreenFlag: false, alreadyOpen: false, call: true,
242− indicatorY: function() { return 0 } },
240+ indicatorY: 0},
243241 { tag: "fullscreen-callActive", fullscreenFlag: true, alreadyOpen: false, call: true,
244− indicatorY: function() { return -panel.panelAndSeparatorHeight } }
242+ indicatorY: -panel.panelAndSeparatorHeight }
245243 ];
246244 }
247245
@@ -268,7 +266,7 @@ Item {
268266
269267 // Wait for the indicators to get into position.
270268 // (switches between normal and fullscreen modes are animated)
271− tryCompareFunction2(function() { return indicatorArea.y } , data.indicatorY);
269+ tryCompareFunction(function() { return indicatorArea.y }, data.indicatorY);
272270
273271 // do this for each indicator item
274272 for (var i = 0; i < indicatorRow.row.count; i++) {
tests/utils/modules/Unity/Test/UnityTestCase.qml−29
@@ -202,35 +202,6 @@ TestCase {
202202 }
203203 }
204204
205− // Keeps executing a given parameter-less function until it returns the given
206− // expected result or the timemout is reached (in which case a test failure
207− // is generated)
208− function tryCompareFunction2(func, expectedResultFunc) {
209− var timeSpent = 0
210− var timeout = 5000
211− var success = false
212− var actualResult
213− var expectedResult
214− while (timeSpent < timeout && !success) {
215− actualResult = func()
216− expectedResult = expectedResultFunc()
217− success = qtest_compareInternal(actualResult, expectedResult)
218− if (success === false) {
219− wait(50)
220− timeSpent += 50
221− }
222− }
223−
224− var act = qtest_results.stringify(actualResult)
225− var exp = qtest_results.stringify(expectedResult)
226− if (!qtest_results.compare(success,
227− "function returned unexpected result",
228− act, exp,
229− util.callerFile(), util.callerLine())) {
230− throw new Error("QtQuickTest::fail")
231− }
232− }
233−
234205 function touchEvent() {
235206 return UT.Util.touchEvent()
236207 }