Merge lp:~canonical-platform-qa/ubuntu-ui-toolkit/fix1324469-untabify into lp:ubuntu-ui-toolkit/staging

Proposed by Leo Arias
Status: Merged
Approved by: Cris Dywan
Approved revision: 1273
Merged at revision: 1301
Proposed branch: lp:~canonical-platform-qa/ubuntu-ui-toolkit/fix1324469-untabify
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 171 lines (+71/-72)
1 file modified
modules/Ubuntu/Test/UbuntuTestCase.qml (+71/-72)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-ui-toolkit/fix1324469-untabify
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Cris Dywan Approve
Review via email: mp+236771@code.launchpad.net

This proposal supersedes a proposal from 2014-10-01.

Commit message

Replaced the tabs for spaces in UbuntuTestCase.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1272. By Leo Arias

Merged with staging.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1273. By Leo Arias

Merged with staging.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Test/UbuntuTestCase.qml'
2--- modules/Ubuntu/Test/UbuntuTestCase.qml 2014-10-07 14:52:27 +0000
3+++ modules/Ubuntu/Test/UbuntuTestCase.qml 2014-10-21 17:40:10 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2012 Canonical Ltd.
7+ * Copyright 2012, 2014 Canonical Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11@@ -29,45 +29,45 @@
12 This class extends the default QML TestCase class which is available in QtTest 1.0.
13 */
14 TestCase {
15- TestUtil {
16- id:util
17- }
18+ TestUtil {
19+ id:util
20+ }
21
22- /*!
23- Find a child from the item based on the objectName.
24- */
25- function findChild(obj,objectName) {
26- var childs = new Array(0);
27- childs.push(obj)
28- while (childs.length > 0) {
29- if (childs[0].objectName == objectName) {
30- return childs[0]
31- }
32- for (var i in childs[0].children) {
33- childs.push(childs[0].children[i])
34- }
35- childs.splice(0, 1);
36- }
37- return null;
38- }
39+ /*!
40+ Find a child from the item based on the objectName.
41+ */
42+ function findChild(obj,objectName) {
43+ var childs = new Array(0);
44+ childs.push(obj)
45+ while (childs.length > 0) {
46+ if (childs[0].objectName == objectName) {
47+ return childs[0]
48+ }
49+ for (var i in childs[0].children) {
50+ childs.push(childs[0].children[i])
51+ }
52+ childs.splice(0, 1);
53+ }
54+ return null;
55+ }
56
57 /*!
58 Find a non-visual child such as QtObject based on objectName.
59 */
60- function findInvisibleChild(obj,objectName) {
61- var childs = new Array(0);
62- childs.push(obj)
63- while (childs.length > 0) {
64- if (childs[0].objectName == objectName) {
65- return childs[0]
66- }
67- for (var i in childs[0].data) {
68- childs.push(childs[0].data[i])
69- }
70- childs.splice(0, 1);
71- }
72- return null;
73- }
74+ function findInvisibleChild(obj,objectName) {
75+ var childs = new Array(0);
76+ childs.push(obj)
77+ while (childs.length > 0) {
78+ if (childs[0].objectName == objectName) {
79+ return childs[0]
80+ }
81+ for (var i in childs[0].data) {
82+ childs.push(childs[0].data[i])
83+ }
84+ childs.splice(0, 1);
85+ }
86+ return null;
87+ }
88
89 /*!
90 Finds a visible child of an \a item having a given \a property with a given
91@@ -194,44 +194,43 @@
92 }
93
94 /*!
95- Keeps executing a given parameter-less function until it returns the given
96- expected result or the timemout is reached (in which case a test failure
97- is generated)
98- */
99+ Keeps executing a given parameter-less function until it returns the given
100+ expected result or the timemout is reached (in which case a test failure
101+ is generated)
102+ */
103
104- function tryCompareFunction(func, expectedResult, timeout) {
105- var timeSpent = 0
106- var success = false
107- var actualResult
108- if (timeout == undefined) {
109+ function tryCompareFunction(func, expectedResult, timeout) {
110+ var timeSpent = 0
111+ var success = false
112+ var actualResult
113+ if (timeout == undefined) {
114 timeout = 5000;
115 }
116- while (timeSpent < timeout && !success) {
117- actualResult = func()
118- success = qtest_compareInternal(actualResult, expectedResult)
119- if (success === false) {
120- wait(50)
121- timeSpent += 50
122- }
123- }
124-
125- var act = qtest_results.stringify(actualResult)
126- var exp = qtest_results.stringify(expectedResult)
127- if (!qtest_results.compare(success,
128- "function returned unexpected result",
129- act, exp,
130- util.callerFile(), util.callerLine())) {
131- throw new Error("QtQuickTest::fail")
132- }
133- }
134-
135- /*!
136- Convenience function to allow typing a full string instead of single characters
137- */
138- function typeString(string) {
139- for (var i = 0; i < string.length; i++) {
140- keyClick(string[i]);
141- }
142- }
143+ while (timeSpent < timeout && !success) {
144+ actualResult = func()
145+ success = qtest_compareInternal(actualResult, expectedResult)
146+ if (success === false) {
147+ wait(50)
148+ timeSpent += 50
149+ }
150+ }
151+
152+ var act = qtest_results.stringify(actualResult)
153+ var exp = qtest_results.stringify(expectedResult)
154+ if (!qtest_results.compare(success,
155+ "function returned unexpected result",
156+ act, exp,
157+ util.callerFile(), util.callerLine())) {
158+ throw new Error("QtQuickTest::fail")
159+ }
160+ }
161+
162+ /*!
163+ Convenience function to allow typing a full string instead of single characters
164+ */
165+ function typeString(string) {
166+ for (var i = 0; i < string.length; i++) {
167+ keyClick(string[i]);
168+ }
169+ }
170 }
171-

Subscribers

People subscribed via source and target branches