on xenial help sign in
Clean up tests. Following Albert's suggestion.
commit2a111a18ddc20c0a51030a070a0c838a02de03bf authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 5 Nov 2013, 08:18 (13 years ago) parenta98318f
5 files changed+9−14
tests/qmltests/Components/tst_Stage.qml−5 tests/qmltests/Panel/tst_Indicators.qml−4 tests/qmltests/Panel/tst_Panel.qml−4 tests/qmltests/tst_Shell.qml−1 tests/utils/modules/Unity/Test/UnityTestCase.qml+9
tests/qmltests/Components/tst_Stage.qml−5
@@ -24,7 +24,6 @@ import Unity.Test 0.1 as UT
2424import "tst_Stage"
2525
2626Rectangle {
27− id: root
2827 width: units.gu(70)
2928 height: stageRect.height
3029
@@ -206,10 +205,6 @@ Rectangle {
206205 && oldAppScreenshot.visible
207206 }
208207
209− function initTestCase() {
210− removeTimeConstraintsFromDirectionalDragAreas(root);
211− }
212−
213208 function init() {
214209 redControl.checked = false;
215210 greenControl.checked = false;
tests/qmltests/Panel/tst_Indicators.qml−4
@@ -82,10 +82,6 @@ Item {
8282 name: "Indicators"
8383 when: windowShown
8484
85− function initTestCase() {
86− removeTimeConstraintsFromDirectionalDragAreas(shell);
87− }
88−
8985 function init() {
9086 indicators.hide();
9187 tryCompare(indicators.hideAnimation, "running", false);
tests/qmltests/Panel/tst_Panel.qml−4
@@ -52,10 +52,6 @@ Item {
5252 {tag: "fullscreen", fullscreenFlag: true }
5353 ]}
5454
55− function initTestCase() {
56− removeTimeConstraintsFromDirectionalDragAreas(shell);
57− }
58−
5955 function init() {
6056 searchClicked = false;
6157 panel.indicators.hide();
tests/qmltests/tst_Shell.qml−1
@@ -67,7 +67,6 @@ Item {
6767 // The code above just didn't solve it.
6868 wait(2000);
6969
70− removeTimeConstraintsFromDirectionalDragAreas(shell);
7170 swipeAwayGreeter();
7271 }
7372
tests/utils/modules/Unity/Test/UnityTestCase.qml+9
@@ -14,6 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17+import QtQuick 2.0
1718import QtTest 1.0
1819import Ubuntu.Components 0.1
1920import Unity.Test 0.1 as UT
@@ -298,6 +299,14 @@ TestCase {
298299 event.commit()
299300 }
300301
302+ Component.onCompleted: {
303+ var rootItem = parent;
304+ while (rootItem.parent != undefined) {
305+ rootItem = rootItem.parent;
306+ }
307+ removeTimeConstraintsFromDirectionalDragAreas(rootItem);
308+ }
309+
301310 /*
302311 In qmltests, sequences of touch events are sent all at once, unlike in "real life".
303312 Also qmltests might run really slowly, e.g. when run from inside virtual machines.