Merge lp:~bzoltan/ubuntu-ui-toolkit/landing_28-05 into lp:ubuntu-ui-toolkit
- landing_28-05
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 1027 |
Proposed branch: | lp:~bzoltan/ubuntu-ui-toolkit/landing_28-05 |
Merge into: | lp:ubuntu-ui-toolkit |
Diff against target: |
594 lines (+241/-82) 16 files modified
components.api (+7/-1) modules/Ubuntu/Components/AnimatedItem.qml (+1/-38) modules/Ubuntu/Components/ListItems/Base.qml (+1/-1) modules/Ubuntu/Components/PageStack.qml (+1/-0) modules/Ubuntu/Components/Pickers/DatePicker.qml (+4/-2) modules/Ubuntu/Components/plugin/i18n.cpp (+6/-5) modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp (+6/-3) tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py (+16/-0) tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py (+0/-17) tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+2/-9) tests/autopilot/ubuntuuitoolkit/fixture_setup.py (+45/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/CustomMainView.qml (+23/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.HeaderInCustomMainViewTestCase.qml (+24/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py (+27/-0) tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py (+72/-1) tests/qmlapicheck.py (+6/-5) |
To merge this branch: | bzr merge lp:~bzoltan/ubuntu-ui-toolkit/landing_28-05 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Zsombor Egri | Pending | ||
Review via email: mp+221199@code.launchpad.net |
Commit message
[ Christian Dywan ]
* Tweak API parsing to include the Button.font property.
Fixes: https:/
* Call bindtextdomain on /usr if APP_DIR is not defined.
Fixes: https:/
* More unit tests and property corrections for SortFilterModel.
* Read ubuntu-
* Skip test_ubuntushape which is flakey and add a FIXME.
[ Zsombor Egri ]
* Missing "default" keyword added to children property of Base,
causing rendering and test case failures on Qt 5.3.
Fixes: https:/
[ Ugo Riboni ]
* Allow requesting extra large thumbnails.
[ Florian Boucault ]
* AnimatedItem: deprecated as it was not used and still costly.
* Label: default font weight is now light.
[ Zoltán Balogh ]
* Replace split with match to work around failing split()
function usage.
Description of the change
[ Christian Dywan ]
* Tweak API parsing to include the Button.font property.
Fixes: https:/
* Call bindtextdomain on /usr if APP_DIR is not defined.
Fixes: https:/
* More unit tests and property corrections for SortFilterModel.
* Read ubuntu-
* Skip test_ubuntushape which is flakey and add a FIXME.
[ Zsombor Egri ]
* Missing "default" keyword added to children property of Base,
causing rendering and test case failures on Qt 5.3.
Fixes: https:/
[ Ugo Riboni ]
* Allow requesting extra large thumbnails.
[ Florian Boucault ]
* AnimatedItem: deprecated as it was not used and still costly.
* Label: default font weight is now light.
[ Zoltán Balogh ]
* Replace split with match to work around failing split()
function usage.
- 1088. By Zoltan Balogh
-
Merged from the trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
- 1089. By Zoltan Balogh
-
Undo changes of r1082 that cause a regression in messaging-app (and contenthub).
Tim Peeters (tpeeters) wrote : | # |
I removed the change that was reverted from the commit message
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:1089
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 1090. By Zoltan Balogh
-
On the autopilot Header helper, do not assume that the top container will be a MainView
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1090
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Leo Arias (elopio) wrote : | # |
I've confirmed that this landing fixes bug 1324556.
I flashed image 55, ran the gallery tests without the ppa and got the failure.
Then I added the PPA and ran the gallery tests again successfully.
Please note that phablet-test-setup adds an ubuntuuitoolkit folder to /home/phablet/
Tim Peeters (tpeeters) wrote : | # |
Running gallery-app tests from image 55 without the ppa fails big time: http://
I cleared /home/phablet/
Installing ubuntu-
phablet-
Tim Peeters (tpeeters) wrote : | # |
After installing the new ubuntu-
- 1091. By Zoltan Balogh
-
Fix changelog
- 1092. By Zoltan Balogh
-
Fix changelog
- 1093. By Zoltan Balogh
-
Fix changelog
- 1094. By Zoltan Balogh
-
Fix changelog
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1091
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1094
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'components.api' | |||
2 | --- components.api 2014-05-26 11:36:53 +0000 | |||
3 | +++ components.api 2014-06-02 11:30:26 +0000 | |||
4 | @@ -31,6 +31,7 @@ | |||
5 | 31 | AbstractButton | 31 | AbstractButton |
6 | 32 | property color color | 32 | property color color |
7 | 33 | property Gradient gradient | 33 | property Gradient gradient |
8 | 34 | property font font | ||
9 | 34 | property string iconPosition | 35 | property string iconPosition |
10 | 35 | CheckBox 0.1 1.0 | 36 | CheckBox 0.1 1.0 |
11 | 36 | AbstractButton | 37 | AbstractButton |
12 | @@ -94,7 +95,7 @@ | |||
13 | 94 | property real __leftIconMargin | 95 | property real __leftIconMargin |
14 | 95 | property real __rightIconMargin | 96 | property real __rightIconMargin |
15 | 96 | property bool __iconIsItem | 97 | property bool __iconIsItem |
17 | 97 | property internal children | 98 | default property internal children |
18 | 98 | Caption 0.1 1.0 | 99 | Caption 0.1 1.0 |
19 | 99 | Item | 100 | Item |
20 | 100 | property string text | 101 | property string text |
21 | @@ -140,6 +141,7 @@ | |||
22 | 140 | property bool expanded | 141 | property bool expanded |
23 | 141 | property bool multiSelection | 142 | property bool multiSelection |
24 | 142 | property bool colourImage | 143 | property bool colourImage |
25 | 144 | property Component delegate | ||
26 | 143 | property real containerHeight | 145 | property real containerHeight |
27 | 144 | property int selectedIndex | 146 | property int selectedIndex |
28 | 145 | property bool currentlyExpanded | 147 | property bool currentlyExpanded |
29 | @@ -204,12 +206,14 @@ | |||
30 | 204 | Object 0.1 1.0 | 206 | Object 0.1 1.0 |
31 | 205 | QtObject | 207 | QtObject |
32 | 206 | default property internal children | 208 | default property internal children |
33 | 209 | property list<QtObject> __defaultPropertyFix | ||
34 | 207 | OptionSelector 0.1 1.0 | 210 | OptionSelector 0.1 1.0 |
35 | 208 | ListItem.Empty | 211 | ListItem.Empty |
36 | 209 | property var model | 212 | property var model |
37 | 210 | property bool expanded | 213 | property bool expanded |
38 | 211 | property bool multiSelection | 214 | property bool multiSelection |
39 | 212 | property bool colourImage | 215 | property bool colourImage |
40 | 216 | property Component delegate | ||
41 | 213 | property real containerHeight | 217 | property real containerHeight |
42 | 214 | property int selectedIndex | 218 | property int selectedIndex |
43 | 215 | property bool currentlyExpanded | 219 | property bool currentlyExpanded |
44 | @@ -235,6 +239,7 @@ | |||
45 | 235 | Page 0.1 1.0 | 239 | Page 0.1 1.0 |
46 | 236 | PageTreeNode | 240 | PageTreeNode |
47 | 237 | property string title | 241 | property string title |
48 | 242 | property Item tools | ||
49 | 238 | property Item __customHeaderContents | 243 | property Item __customHeaderContents |
50 | 239 | property Flickable flickable | 244 | property Flickable flickable |
51 | 240 | property list<Action> actions | 245 | property list<Action> actions |
52 | @@ -355,6 +360,7 @@ | |||
53 | 355 | OrientationHelper | 360 | OrientationHelper |
54 | 356 | property Item dismissArea | 361 | property Item dismissArea |
55 | 357 | property bool grabDismissAreaEvents | 362 | property bool grabDismissAreaEvents |
56 | 363 | property PropertyAnimation fadingAnimation | ||
57 | 358 | function show() | 364 | function show() |
58 | 359 | function hide() | 365 | function hide() |
59 | 360 | function __closeIfHidden() | 366 | function __closeIfHidden() |
60 | 361 | 367 | ||
61 | === modified file 'modules/Ubuntu/Components/AnimatedItem.qml' | |||
62 | --- modules/Ubuntu/Components/AnimatedItem.qml 2014-04-23 08:50:20 +0000 | |||
63 | +++ modules/Ubuntu/Components/AnimatedItem.qml 2014-06-02 11:30:26 +0000 | |||
64 | @@ -30,45 +30,8 @@ | |||
65 | 30 | id: root | 30 | id: root |
66 | 31 | /*! | 31 | /*! |
67 | 32 | \preliminary | 32 | \preliminary |
68 | 33 | \deprecated | ||
69 | 33 | Specifies whether the component is on the visible area of the Flickable or not. | 34 | Specifies whether the component is on the visible area of the Flickable or not. |
70 | 34 | */ | 35 | */ |
71 | 35 | property bool onScreen: true | 36 | property bool onScreen: true |
72 | 36 | |||
73 | 37 | QtObject { | ||
74 | 38 | id: internal | ||
75 | 39 | property Flickable flickable | ||
76 | 40 | |||
77 | 41 | // returns whether the component is in the visible area of the flickable | ||
78 | 42 | function checkOnScreen() | ||
79 | 43 | { | ||
80 | 44 | var pos = root.mapToItem(flickable, 0, 0) | ||
81 | 45 | root.onScreen = (pos.y + root.height >= 0) && (pos.y <= internal.flickable.height) && | ||
82 | 46 | (pos.x + root.width >= 0) && (pos.x <= internal.flickable.width) | ||
83 | 47 | } | ||
84 | 48 | // lookup for a flickable parent | ||
85 | 49 | function updateFlickableParent() | ||
86 | 50 | { | ||
87 | 51 | var flickable = root.parent | ||
88 | 52 | while (flickable) { | ||
89 | 53 | if (flickable.hasOwnProperty("flicking") && flickable.hasOwnProperty("flickableDirection")) { | ||
90 | 54 | // non-interactive flickables must be skipped as those do not provide | ||
91 | 55 | // on-screen detection support | ||
92 | 56 | if (flickable.interactive) | ||
93 | 57 | break | ||
94 | 58 | } | ||
95 | 59 | flickable = flickable.parent | ||
96 | 60 | } | ||
97 | 61 | internal.flickable = flickable | ||
98 | 62 | } | ||
99 | 63 | } | ||
100 | 64 | |||
101 | 65 | Connections { | ||
102 | 66 | target: internal.flickable | ||
103 | 67 | |||
104 | 68 | onContentXChanged: internal.checkOnScreen() | ||
105 | 69 | onContentYChanged: internal.checkOnScreen() | ||
106 | 70 | } | ||
107 | 71 | |||
108 | 72 | Component.onCompleted: internal.updateFlickableParent() | ||
109 | 73 | onParentChanged: internal.updateFlickableParent() | ||
110 | 74 | } | 37 | } |
111 | 75 | 38 | ||
112 | === modified file 'modules/Ubuntu/Components/ListItems/Base.qml' | |||
113 | --- modules/Ubuntu/Components/ListItems/Base.qml 2014-04-28 19:24:56 +0000 | |||
114 | +++ modules/Ubuntu/Components/ListItems/Base.qml 2014-06-02 11:30:26 +0000 | |||
115 | @@ -159,7 +159,7 @@ | |||
116 | 159 | /*! | 159 | /*! |
117 | 160 | \internal | 160 | \internal |
118 | 161 | */ | 161 | */ |
120 | 162 | property alias children: middle.data | 162 | default property alias children: middle.data |
121 | 163 | Item { | 163 | Item { |
122 | 164 | id: middle | 164 | id: middle |
123 | 165 | property bool anchorToIconHelper: !__iconIsItem && iconHelper.source != "" | 165 | property bool anchorToIconHelper: !__iconIsItem && iconHelper.source != "" |
124 | 166 | 166 | ||
125 | === modified file 'modules/Ubuntu/Components/PageStack.qml' | |||
126 | --- modules/Ubuntu/Components/PageStack.qml 2014-05-13 09:09:35 +0000 | |||
127 | +++ modules/Ubuntu/Components/PageStack.qml 2014-06-02 11:30:26 +0000 | |||
128 | @@ -192,6 +192,7 @@ | |||
129 | 192 | */ | 192 | */ |
130 | 193 | default property alias data: inactiveNode.data | 193 | default property alias data: inactiveNode.data |
131 | 194 | PageTreeNode { | 194 | PageTreeNode { |
132 | 195 | anchors.fill: parent | ||
133 | 195 | id: inactiveNode | 196 | id: inactiveNode |
134 | 196 | active: false | 197 | active: false |
135 | 197 | } | 198 | } |
136 | 198 | 199 | ||
137 | === modified file 'modules/Ubuntu/Components/Pickers/DatePicker.qml' | |||
138 | --- modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-05-07 10:42:31 +0000 | |||
139 | +++ modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-06-02 11:30:26 +0000 | |||
140 | @@ -523,7 +523,8 @@ | |||
141 | 523 | function updatePickers() { | 523 | function updatePickers() { |
142 | 524 | if (completed) { | 524 | if (completed) { |
143 | 525 | // check mode flags first | 525 | // check mode flags first |
145 | 526 | var modes = datePicker.mode.split(/\W/g); | 526 | // FIXME: The js split(/\W/g) terminates the process on armhf with Qt 5.3 (v4 js) (https://bugreports.qt-project.org/browse/QTBUG-39255) |
146 | 527 | var modes = datePicker.mode.match(/\w+/g); | ||
147 | 527 | 528 | ||
148 | 528 | showYearPicker = showMonthPicker = showDayPicker = | 529 | showYearPicker = showMonthPicker = showDayPicker = |
149 | 529 | showHoursPicker = showMinutesPicker = showSecondsPicker = false; | 530 | showHoursPicker = showMinutesPicker = showSecondsPicker = false; |
150 | @@ -607,7 +608,8 @@ | |||
151 | 607 | completed = false; | 608 | completed = false; |
152 | 608 | 609 | ||
153 | 609 | // use short format to exclude any extra characters | 610 | // use short format to exclude any extra characters |
155 | 610 | var format = datePicker.locale.dateFormat(Locale.ShortFormat).split(/\W/g); | 611 | // FIXME: The js split(/\W/g) terminates the process on armhf with Qt 5.3 (v4 js) (https://bugreports.qt-project.org/browse/QTBUG-39255) |
156 | 612 | var format = datePicker.locale.dateFormat(Locale.ShortFormat).match(/\w+/g); | ||
157 | 611 | // loop through the format to decide the position of the tumbler | 613 | // loop through the format to decide the position of the tumbler |
158 | 612 | var formatIndex = 0; | 614 | var formatIndex = 0; |
159 | 613 | for (var i in format) { | 615 | for (var i in format) { |
160 | 614 | 616 | ||
161 | === modified file 'modules/Ubuntu/Components/plugin/i18n.cpp' | |||
162 | --- modules/Ubuntu/Components/plugin/i18n.cpp 2014-05-22 15:54:13 +0000 | |||
163 | +++ modules/Ubuntu/Components/plugin/i18n.cpp 2014-06-02 11:30:26 +0000 | |||
164 | @@ -103,13 +103,14 @@ | |||
165 | 103 | /* | 103 | /* |
166 | 104 | The default is /usr/share/locale if we don't set a folder | 104 | The default is /usr/share/locale if we don't set a folder |
167 | 105 | For click we use APP_DIR/share/locale | 105 | For click we use APP_DIR/share/locale |
169 | 106 | eg. /usr/share/click/preinstalled/com.example.foo/current/share/locale | 106 | e.g. /usr/share/click/preinstalled/com.example.foo/current/share/locale |
170 | 107 | */ | 107 | */ |
175 | 108 | QDir appDir(getenv("APP_DIR")); | 108 | QString appDir(getenv("APP_DIR")); |
176 | 109 | if (appDir.exists()) { | 109 | if (!QDir::isAbsolutePath (appDir)) { |
177 | 110 | QString localePath(appDir.filePath("share/locale")); | 110 | appDir = "/usr"; |
174 | 111 | C::bindtextdomain(domain.toUtf8(), localePath.toUtf8()); | ||
178 | 112 | } | 111 | } |
179 | 112 | QString localePath(QDir(appDir).filePath("share/locale")); | ||
180 | 113 | C::bindtextdomain(domain.toUtf8(), localePath.toUtf8()); | ||
181 | 113 | Q_EMIT domainChanged(); | 114 | Q_EMIT domainChanged(); |
182 | 114 | } | 115 | } |
183 | 115 | 116 | ||
184 | 116 | 117 | ||
185 | === modified file 'modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp' | |||
186 | --- modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp 2014-02-25 09:14:23 +0000 | |||
187 | +++ modules/Ubuntu/Components/plugin/thumbnailgenerator.cpp 2014-06-02 11:30:26 +0000 | |||
188 | @@ -43,12 +43,15 @@ | |||
189 | 43 | * is the only way around the issue for now. */ | 43 | * is the only way around the issue for now. */ |
190 | 44 | std::string src_path(QUrl(id).path().toUtf8().data()); | 44 | std::string src_path(QUrl(id).path().toUtf8().data()); |
191 | 45 | std::string tgt_path; | 45 | std::string tgt_path; |
192 | 46 | const int xlarge_cutoff = 512; | ||
193 | 47 | const int large_cutoff = 256; | ||
194 | 48 | const int small_cutoff = 128; | ||
195 | 46 | try { | 49 | try { |
196 | 47 | ThumbnailSize desiredSize; | 50 | ThumbnailSize desiredSize; |
200 | 48 | const int large_cutoff = 256; | 51 | if(requestedSize.width() > xlarge_cutoff || requestedSize.height() > xlarge_cutoff) { |
198 | 49 | const int small_cutoff = 128; | ||
199 | 50 | if(requestedSize.width() > large_cutoff || requestedSize.height() > large_cutoff) { | ||
201 | 51 | desiredSize = TN_SIZE_ORIGINAL; | 52 | desiredSize = TN_SIZE_ORIGINAL; |
202 | 53 | } else if(requestedSize.width() > large_cutoff || requestedSize.height() > large_cutoff) { | ||
203 | 54 | desiredSize = TN_SIZE_XLARGE; | ||
204 | 52 | } else if(requestedSize.width() > small_cutoff || requestedSize.height() > small_cutoff) { | 55 | } else if(requestedSize.width() > small_cutoff || requestedSize.height() > small_cutoff) { |
205 | 53 | desiredSize = TN_SIZE_LARGE; | 56 | desiredSize = TN_SIZE_LARGE; |
206 | 54 | } else { | 57 | } else { |
207 | 55 | 58 | ||
208 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py' | |||
209 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2014-04-29 23:03:58 +0000 | |||
210 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_common.py 2014-06-02 11:30:26 +0000 | |||
211 | @@ -111,3 +111,19 @@ | |||
212 | 111 | raise ToolkitException( | 111 | raise ToolkitException( |
213 | 112 | "The element is not contained in a Flickable so it can't be " | 112 | "The element is not contained in a Flickable so it can't be " |
214 | 113 | "swiped into view.") | 113 | "swiped into view.") |
215 | 114 | |||
216 | 115 | def _get_top_container(self): | ||
217 | 116 | """Return the top-most container with a globalRect.""" | ||
218 | 117 | root = self.get_root_instance() | ||
219 | 118 | parent = self.get_parent() | ||
220 | 119 | top_container = None | ||
221 | 120 | while parent.id != root.id: | ||
222 | 121 | if hasattr(parent, 'globalRect'): | ||
223 | 122 | top_container = parent | ||
224 | 123 | |||
225 | 124 | parent = parent.get_parent() | ||
226 | 125 | |||
227 | 126 | if top_container is None: | ||
228 | 127 | raise ToolkitException('Could not find the top-most container.') | ||
229 | 128 | else: | ||
230 | 129 | return top_container | ||
231 | 114 | 130 | ||
232 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py' | |||
233 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py 2014-05-20 07:31:55 +0000 | |||
234 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py 2014-06-02 11:30:26 +0000 | |||
235 | @@ -51,23 +51,6 @@ | |||
236 | 51 | containers = [self._get_top_container(), self] | 51 | containers = [self._get_top_container(), self] |
237 | 52 | return containers | 52 | return containers |
238 | 53 | 53 | ||
239 | 54 | def _get_top_container(self): | ||
240 | 55 | """Return the top-most container with a globalRect.""" | ||
241 | 56 | root = self.get_root_instance() | ||
242 | 57 | parent = self.get_parent() | ||
243 | 58 | top_container = None | ||
244 | 59 | while parent.id != root.id: | ||
245 | 60 | if hasattr(parent, 'globalRect'): | ||
246 | 61 | top_container = parent | ||
247 | 62 | |||
248 | 63 | parent = parent.get_parent() | ||
249 | 64 | |||
250 | 65 | if top_container is None: | ||
251 | 66 | raise _common.ToolkitException( | ||
252 | 67 | "Couldn't find the top-most container.") | ||
253 | 68 | else: | ||
254 | 69 | return top_container | ||
255 | 70 | |||
256 | 71 | def _is_child_visible(self, child, containers): | 54 | def _is_child_visible(self, child, containers): |
257 | 72 | """Check if the center of the child is visible. | 55 | """Check if the center of the child is visible. |
258 | 73 | 56 | ||
259 | 74 | 57 | ||
260 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py' | |||
261 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-05-13 12:43:31 +0000 | |||
262 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-06-02 11:30:26 +0000 | |||
263 | @@ -21,7 +21,6 @@ | |||
264 | 21 | 21 | ||
265 | 22 | from ubuntuuitoolkit._custom_proxy_objects import ( | 22 | from ubuntuuitoolkit._custom_proxy_objects import ( |
266 | 23 | _common, | 23 | _common, |
267 | 24 | _mainview, | ||
268 | 25 | _tabbar | 24 | _tabbar |
269 | 26 | ) | 25 | ) |
270 | 27 | 26 | ||
271 | @@ -35,13 +34,6 @@ | |||
272 | 35 | class Header(_common.UbuntuUIToolkitCustomProxyObjectBase): | 34 | class Header(_common.UbuntuUIToolkitCustomProxyObjectBase): |
273 | 36 | """Header Autopilot emulator.""" | 35 | """Header Autopilot emulator.""" |
274 | 37 | 36 | ||
275 | 38 | def __init__(self, *args): | ||
276 | 39 | super(Header, self).__init__(*args) | ||
277 | 40 | # XXX we need a better way to keep reference to the main view. | ||
278 | 41 | # --elopio - 2014-02-26 | ||
279 | 42 | self.main_view = self.get_root_instance().select_single( | ||
280 | 43 | _mainview.MainView) | ||
281 | 44 | |||
282 | 45 | def _show_if_not_visible(self): | 37 | def _show_if_not_visible(self): |
283 | 46 | if not self._is_visible(): | 38 | if not self._is_visible(): |
284 | 47 | self._show() | 39 | self._show() |
285 | @@ -53,8 +45,9 @@ | |||
286 | 53 | # FIXME This will fail if the header is not linked to a flickable that | 45 | # FIXME This will fail if the header is not linked to a flickable that |
287 | 54 | # fills the main view. The header has a flickable property but it | 46 | # fills the main view. The header has a flickable property but it |
288 | 55 | # can't be read by autopilot. See bug http://pad.lv/1318829 | 47 | # can't be read by autopilot. See bug http://pad.lv/1318829 |
289 | 48 | top_container = self._get_top_container() | ||
290 | 56 | start_x = stop_x = (self.globalRect.x + self.globalRect.width) // 2 | 49 | start_x = stop_x = (self.globalRect.x + self.globalRect.width) // 2 |
292 | 57 | start_y = self.main_view.globalRect.y + 5 | 50 | start_y = top_container.globalRect.y + 5 |
293 | 58 | stop_y = start_y + self.globalRect.height | 51 | stop_y = start_y + self.globalRect.height |
294 | 59 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) | 52 | self.pointing_device.drag(start_x, start_y, stop_x, stop_y) |
295 | 60 | self.y.wait_for(0) | 53 | self.y.wait_for(0) |
296 | 61 | 54 | ||
297 | === modified file 'tests/autopilot/ubuntuuitoolkit/fixture_setup.py' | |||
298 | --- tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-04-23 08:50:20 +0000 | |||
299 | +++ tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-06-02 11:30:26 +0000 | |||
300 | @@ -16,6 +16,7 @@ | |||
301 | 16 | 16 | ||
302 | 17 | import copy | 17 | import copy |
303 | 18 | import os | 18 | import os |
304 | 19 | import shutil | ||
305 | 19 | import tempfile | 20 | import tempfile |
306 | 20 | 21 | ||
307 | 21 | import fixtures | 22 | import fixtures |
308 | @@ -118,3 +119,47 @@ | |||
309 | 118 | original_value) | 119 | original_value) |
310 | 119 | else: | 120 | else: |
311 | 120 | self.addCleanup(environment.unset_initctl_env_var, variable) | 121 | self.addCleanup(environment.unset_initctl_env_var, variable) |
312 | 122 | |||
313 | 123 | |||
314 | 124 | class FakeHome(fixtures.Fixture): | ||
315 | 125 | |||
316 | 126 | # We copy the Xauthority file to allow executions using XVFB. If it is not | ||
317 | 127 | # on the user's HOME directory, nothing will happen. | ||
318 | 128 | should_copy_xauthority_file = True | ||
319 | 129 | |||
320 | 130 | def __init__(self, directory=None): | ||
321 | 131 | super(FakeHome, self).__init__() | ||
322 | 132 | self.directory = directory | ||
323 | 133 | |||
324 | 134 | def setUp(self): | ||
325 | 135 | super(FakeHome, self).setUp() | ||
326 | 136 | self.directory = self._make_directory_if_not_specified() | ||
327 | 137 | if self.should_copy_xauthority_file: | ||
328 | 138 | self._copy_xauthority_file(self.directory) | ||
329 | 139 | # We patch both environment variables so it works on the desktop and on | ||
330 | 140 | # the phone. | ||
331 | 141 | self.useFixture( | ||
332 | 142 | InitctlEnvironmentVariable(HOME=self.directory)) | ||
333 | 143 | self.useFixture( | ||
334 | 144 | fixtures.EnvironmentVariable('HOME', newvalue=self.directory)) | ||
335 | 145 | |||
336 | 146 | def _make_directory_if_not_specified(self): | ||
337 | 147 | if self.directory is None: | ||
338 | 148 | parent_directory = os.path.join( | ||
339 | 149 | os.environ.get('HOME'), 'autopilot', 'fakeenv') | ||
340 | 150 | if not os.path.exists(parent_directory): | ||
341 | 151 | os.makedirs(parent_directory) | ||
342 | 152 | temp_dir_fixture = fixtures.TempDir(parent_directory) | ||
343 | 153 | self.useFixture(temp_dir_fixture) | ||
344 | 154 | return temp_dir_fixture.path | ||
345 | 155 | else: | ||
346 | 156 | return self.directory | ||
347 | 157 | |||
348 | 158 | def _copy_xauthority_file(self, directory): | ||
349 | 159 | """Copy the .Xauthority file if it exists in the user's home.""" | ||
350 | 160 | xauthority_file_path = os.path.join( | ||
351 | 161 | os.environ.get('HOME'), '.Xauthority') | ||
352 | 162 | if os.path.isfile(xauthority_file_path): | ||
353 | 163 | shutil.copyfile( | ||
354 | 164 | xauthority_file_path, | ||
355 | 165 | os.path.join(directory, '.Xauthority')) | ||
356 | 121 | 166 | ||
357 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/CustomMainView.qml' | |||
358 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/CustomMainView.qml 1970-01-01 00:00:00 +0000 | |||
359 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/CustomMainView.qml 2014-06-02 11:30:26 +0000 | |||
360 | @@ -0,0 +1,23 @@ | |||
361 | 1 | /* | ||
362 | 2 | * Copyright 2014 Canonical Ltd. | ||
363 | 3 | * | ||
364 | 4 | * This program is free software; you can redistribute it and/or modify | ||
365 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
366 | 6 | * the Free Software Foundation; version 3. | ||
367 | 7 | * | ||
368 | 8 | * This program is distributed in the hope that it will be useful, | ||
369 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
370 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
371 | 11 | * GNU Lesser General Public License for more details. | ||
372 | 12 | * | ||
373 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
374 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
375 | 15 | */ | ||
376 | 16 | |||
377 | 17 | import QtQuick 2.0 | ||
378 | 18 | import Ubuntu.Components 0.1 | ||
379 | 19 | |||
380 | 20 | MainView { | ||
381 | 21 | objectName: "overview" | ||
382 | 22 | property string test | ||
383 | 23 | } | ||
384 | 0 | 24 | ||
385 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.HeaderInCustomMainViewTestCase.qml' | |||
386 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.HeaderInCustomMainViewTestCase.qml 1970-01-01 00:00:00 +0000 | |||
387 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.HeaderInCustomMainViewTestCase.qml 2014-06-02 11:30:26 +0000 | |||
388 | @@ -0,0 +1,24 @@ | |||
389 | 1 | /* | ||
390 | 2 | * Copyright 2014 Canonical Ltd. | ||
391 | 3 | * | ||
392 | 4 | * This program is free software; you can redistribute it and/or modify | ||
393 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
394 | 6 | * the Free Software Foundation; version 3. | ||
395 | 7 | * | ||
396 | 8 | * This program is distributed in the hope that it will be useful, | ||
397 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
398 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
399 | 11 | * GNU Lesser General Public License for more details. | ||
400 | 12 | * | ||
401 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
402 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
403 | 15 | */ | ||
404 | 16 | |||
405 | 17 | import QtQuick 2.0 | ||
406 | 18 | import Ubuntu.Components 1.1 | ||
407 | 19 | |||
408 | 20 | CustomMainView { | ||
409 | 21 | |||
410 | 22 | objectName: 'mainView' | ||
411 | 23 | |||
412 | 24 | } | ||
413 | 0 | 25 | ||
414 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py' | |||
415 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-05-20 08:56:28 +0000 | |||
416 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-02 11:30:26 +0000 | |||
417 | @@ -14,6 +14,8 @@ | |||
418 | 14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
419 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
420 | 16 | 16 | ||
421 | 17 | import os | ||
422 | 18 | |||
423 | 17 | import ubuntuuitoolkit | 19 | import ubuntuuitoolkit |
424 | 18 | from ubuntuuitoolkit import tests | 20 | from ubuntuuitoolkit import tests |
425 | 19 | 21 | ||
426 | @@ -157,3 +159,28 @@ | |||
427 | 157 | 159 | ||
428 | 158 | # only three actions are visible | 160 | # only three actions are visible |
429 | 159 | self.assertEqual(overflow_button.visible, False) | 161 | self.assertEqual(overflow_button.visible, False) |
430 | 162 | |||
431 | 163 | |||
432 | 164 | class CustomMainView(ubuntuuitoolkit.MainView): | ||
433 | 165 | """Autopilot helper for a custom main view.""" | ||
434 | 166 | |||
435 | 167 | |||
436 | 168 | class HeaderInCustomMainViewTestCase(tests.QMLFileAppTestCase): | ||
437 | 169 | |||
438 | 170 | path = os.path.abspath(__file__) | ||
439 | 171 | dir_path = os.path.dirname(path) | ||
440 | 172 | test_qml_file_path = os.path.join( | ||
441 | 173 | dir_path, 'test_header.HeaderInCustomMainViewTestCase.qml') | ||
442 | 174 | |||
443 | 175 | @property | ||
444 | 176 | def main_view(self): | ||
445 | 177 | return self.app.select_single(CustomMainView) | ||
446 | 178 | |||
447 | 179 | def test_get_header_from_custom_main_view(self): | ||
448 | 180 | """Test that we can get the header from a custom main view. | ||
449 | 181 | |||
450 | 182 | This prevents a regression of http://pad.lv/1324556. | ||
451 | 183 | |||
452 | 184 | """ | ||
453 | 185 | header = self.main_view.get_header() | ||
454 | 186 | self.assertIsInstance(header, ubuntuuitoolkit.Header) | ||
455 | 160 | 187 | ||
456 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py' | |||
457 | --- tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-03-10 16:51:01 +0000 | |||
458 | +++ tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-06-02 11:30:26 +0000 | |||
459 | @@ -15,6 +15,7 @@ | |||
460 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
461 | 16 | 16 | ||
462 | 17 | import os | 17 | import os |
463 | 18 | import tempfile | ||
464 | 18 | 19 | ||
465 | 19 | try: | 20 | try: |
466 | 20 | # Python 3. | 21 | # Python 3. |
467 | @@ -24,7 +25,7 @@ | |||
468 | 24 | import mock | 25 | import mock |
469 | 25 | import testtools | 26 | import testtools |
470 | 26 | from autopilot import testcase as autopilot_testcase | 27 | from autopilot import testcase as autopilot_testcase |
472 | 27 | from testtools.matchers import Contains, Not, FileExists | 28 | from testtools.matchers import Contains, FileExists, Not |
473 | 28 | 29 | ||
474 | 29 | from ubuntuuitoolkit import base, environment, fixture_setup | 30 | from ubuntuuitoolkit import base, environment, fixture_setup |
475 | 30 | 31 | ||
476 | @@ -233,3 +234,73 @@ | |||
477 | 233 | self.assertEqual( | 234 | self.assertEqual( |
478 | 234 | 'original test value', | 235 | 'original test value', |
479 | 235 | environment.get_initctl_env_var('testenvvarforfixture')) | 236 | environment.get_initctl_env_var('testenvvarforfixture')) |
480 | 237 | |||
481 | 238 | |||
482 | 239 | class FakeHomeTestCase(testtools.TestCase): | ||
483 | 240 | |||
484 | 241 | def test_fake_home_fixture_patches_initctl_env_var(self): | ||
485 | 242 | original_home = environment.get_initctl_env_var('HOME') | ||
486 | 243 | fake_home = original_home + 'fake' | ||
487 | 244 | result = testtools.TestResult() | ||
488 | 245 | |||
489 | 246 | def inner_test(): | ||
490 | 247 | class TestWithFakeHome(testtools.TestCase): | ||
491 | 248 | def test_it(self): | ||
492 | 249 | fake_home_fixture = fixture_setup.FakeHome(fake_home) | ||
493 | 250 | fake_home_fixture.should_copy_xauthority_file = False | ||
494 | 251 | self.useFixture(fake_home_fixture) | ||
495 | 252 | self.assertEqual( | ||
496 | 253 | fake_home, environment.get_initctl_env_var('HOME')) | ||
497 | 254 | return TestWithFakeHome('test_it') | ||
498 | 255 | |||
499 | 256 | inner_test().run(result) | ||
500 | 257 | |||
501 | 258 | self.assertTrue( | ||
502 | 259 | result.wasSuccessful(), | ||
503 | 260 | 'Failed to fake the home: {}'.format(result.errors)) | ||
504 | 261 | self.assertEqual( | ||
505 | 262 | original_home, | ||
506 | 263 | environment.get_initctl_env_var('HOME')) | ||
507 | 264 | |||
508 | 265 | def test_fake_home_fixture_patches_env_var(self): | ||
509 | 266 | original_home = os.environ.get('HOME') | ||
510 | 267 | fake_home = tempfile.gettempdir() | ||
511 | 268 | result = testtools.TestResult() | ||
512 | 269 | |||
513 | 270 | def inner_test(): | ||
514 | 271 | class TestWithFakeHome(testtools.TestCase): | ||
515 | 272 | def test_it(self): | ||
516 | 273 | fake_home_fixture = fixture_setup.FakeHome(fake_home) | ||
517 | 274 | fake_home_fixture.should_copy_xauthority_file = False | ||
518 | 275 | self.useFixture(fake_home_fixture) | ||
519 | 276 | self.assertEqual( | ||
520 | 277 | fake_home, os.environ.get('HOME')) | ||
521 | 278 | return TestWithFakeHome('test_it') | ||
522 | 279 | |||
523 | 280 | inner_test().run(result) | ||
524 | 281 | |||
525 | 282 | self.assertTrue( | ||
526 | 283 | result.wasSuccessful(), | ||
527 | 284 | 'Failed to fake the home: {}'.format(result.failures)) | ||
528 | 285 | self.assertEqual(original_home, os.environ.get('HOME')) | ||
529 | 286 | |||
530 | 287 | def test_fake_home_fixture_must_create_default_directory(self): | ||
531 | 288 | original_home = os.environ.get('HOME') | ||
532 | 289 | self.useFixture(fixture_setup.FakeHome()) | ||
533 | 290 | |||
534 | 291 | home_parent_directory, _ = os.path.split(os.environ.get('HOME')) | ||
535 | 292 | self.assertEqual( | ||
536 | 293 | home_parent_directory, | ||
537 | 294 | os.path.join(original_home, 'autopilot', 'fakeenv')) | ||
538 | 295 | |||
539 | 296 | def test_fake_home_fixture_must_copy_xauthority(self): | ||
540 | 297 | # Fake the home first so we don't write the xauthority on the real | ||
541 | 298 | # home. | ||
542 | 299 | self.useFixture(fixture_setup.FakeHome()) | ||
543 | 300 | |||
544 | 301 | open(os.path.join(os.environ.get('HOME'), '.Xauthority')).close() | ||
545 | 302 | |||
546 | 303 | self.useFixture(fixture_setup.FakeHome()) | ||
547 | 304 | self.assertTrue( | ||
548 | 305 | os.path.exists( | ||
549 | 306 | os.path.join(os.environ.get('HOME'), '.Xauthority'))) | ||
550 | 236 | 307 | ||
551 | === modified file 'tests/qmlapicheck.py' | |||
552 | --- tests/qmlapicheck.py 2014-04-24 09:18:38 +0000 | |||
553 | +++ tests/qmlapicheck.py 2014-06-02 11:30:26 +0000 | |||
554 | @@ -130,10 +130,10 @@ | |||
555 | 130 | if '{' in line and '}' in line: | 130 | if '{' in line and '}' in line: |
556 | 131 | if filetype == 'qmltypes' and not in_builtin_type: | 131 | if filetype == 'qmltypes' and not in_builtin_type: |
557 | 132 | print(' ' + line.strip()) | 132 | print(' ' + line.strip()) |
559 | 133 | continue | 133 | continue |
560 | 134 | 134 | ||
561 | 135 | # End of function/ signal/ Item block | 135 | # End of function/ signal/ Item block |
563 | 136 | if '}' in line: | 136 | if '}' in line and not '{' in line: |
564 | 137 | in_block -= 1 | 137 | in_block -= 1 |
565 | 138 | block_meta = {} | 138 | block_meta = {} |
566 | 139 | if in_block == 1 and in_builtin_type: | 139 | if in_block == 1 and in_builtin_type: |
567 | @@ -143,7 +143,7 @@ | |||
568 | 143 | # Only root "Item {" is inspected for QML, otherwise all children | 143 | # Only root "Item {" is inspected for QML, otherwise all children |
569 | 144 | if in_block == 1 or filetype == 'qmltypes': | 144 | if in_block == 1 or filetype == 'qmltypes': |
570 | 145 | # Left hand side specifies a keyword, a type and a variable name | 145 | # Left hand side specifies a keyword, a type and a variable name |
572 | 146 | declaration = line.split(':')[0] | 146 | declaration = line.split(':', 1)[0] |
573 | 147 | words = declaration.strip().split(' ') | 147 | words = declaration.strip().split(' ') |
574 | 148 | # Skip types with prefixes considered builtin | 148 | # Skip types with prefixes considered builtin |
575 | 149 | if filetype == 'qmltypes' and words[0] == 'name': | 149 | if filetype == 'qmltypes' and words[0] == 'name': |
576 | @@ -175,7 +175,8 @@ | |||
577 | 175 | for word in words: | 175 | for word in words: |
578 | 176 | if word in keywords: | 176 | if word in keywords: |
579 | 177 | if filetype == 'qml': | 177 | if filetype == 'qml': |
581 | 178 | signature = declaration.split('{')[0].strip() | 178 | separator = '{' if 'function' in declaration else ':' |
582 | 179 | signature = declaration.split(separator, 1)[0].strip() | ||
583 | 179 | if 'alias' in line: | 180 | if 'alias' in line: |
584 | 180 | no_mods = signature | 181 | no_mods = signature |
585 | 181 | for mod in ['readonly', 'default']: | 182 | for mod in ['readonly', 'default']: |
586 | @@ -198,7 +199,7 @@ | |||
587 | 198 | break | 199 | break |
588 | 199 | 200 | ||
589 | 200 | # Start of function/ signal/ Item block | 201 | # Start of function/ signal/ Item block |
591 | 201 | if '{' in line: | 202 | if '{' in line and not '}' in line: |
592 | 202 | in_block += 1 | 203 | in_block += 1 |
593 | 203 | block_meta = {} | 204 | block_meta = {} |
594 | 204 | # The parent type can affect API | 205 | # The parent type can affect API |
PASSED: Continuous integration, rev:1087 jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- ci/2079/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/527 jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 472 jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- utopic- amd64-ci/ 25 jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- utopic- armhf-ci/ 25 jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- utopic- armhf-ci/ 25/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- mako/976 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1014 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1014/ artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 7827 jenkins. qa.ubuntu. com/job/ autopilot- testrunner- otto-utopic/ 417 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/610 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/610/ artifact/ work/output/ *zip*/output. zip
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- ui-toolkit- ci/2079/ rebuild
http://