Merge lp:~tpeeters/ubuntu-ui-toolkit/98-DeprecateHeader into lp:ubuntu-ui-toolkit/staging
- 98-DeprecateHeader
- Merge into staging
Status: | Superseded |
---|---|
Proposed branch: | lp:~tpeeters/ubuntu-ui-toolkit/98-DeprecateHeader |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Diff against target: |
479 lines (+145/-41) 18 files modified
components.api (+2/-12) modules/Ubuntu/Components/AppHeader.qml (+1/-1) modules/Ubuntu/Components/Header.qml (+39/-0) modules/Ubuntu/Components/MainView.qml (+2/-2) modules/Ubuntu/Components/Page.qml (+2/-2) modules/Ubuntu/Components/PageTreeNode.qml (+4/-3) modules/Ubuntu/Components/Tabs.qml (+1/-1) modules/Ubuntu/Components/qmldir (+1/-0) tests/autopilot/ubuntuuitoolkit/__init__.py (+2/-0) tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py (+5/-1) tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py (+14/-3) tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py (+3/-2) tests/autopilot/ubuntuuitoolkit/tests/__init__.py (+1/-1) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderTestCase.qml (+27/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py (+29/-2) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py (+2/-1) tests/qmlapicheck.py (+8/-8) tests/unit/tst_components/tst_pagestack.qml (+2/-2) |
To merge this branch: | bzr merge lp:~tpeeters/ubuntu-ui-toolkit/98-DeprecateHeader |
Related bugs: | |
Related blueprints: |
New header and bottom edge
(Essential)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Cris Dywan | Approve | ||
Zsombor Egri | Pending | ||
Review via email: mp+224114@code.launchpad.net |
This proposal supersedes a proposal from 2014-06-03.
This proposal has been superseded by a proposal from 2014-06-25.
Commit message
Description of the change
Print a warning when using deprecated Header component.
These MRs update apps that currently rely on the internals of Header in UITK. The MRs change them to use the provided custom proxy object from UITK so then the app tests will not break with the changes proposed here.
https:/
https:/
https:/
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
Leo Arias (elopio) wrote : Posted in a previous version of this proposal | # |
messaging-app, notes-app and ubuntu-terminal-app might need updates on their autopilot tests.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1106
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1107
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Tim Peeters (tpeeters) wrote : Posted in a previous version of this proposal | # |
> messaging-app, notes-app and ubuntu-terminal-app might need updates on their
> autopilot tests.
I proposed changes for those apps here:
https:/
https:/
https:/
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1109
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1111
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Zsombor Egri (zsombi) wrote : Posted in a previous version of this proposal | # |
Looks good now. Hopefully these kind of mistakes will not happen in the future :)
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1112
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1115
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
FAILURE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1116
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:1118
http://
Executed test runs:
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:1120
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Cris Dywan (kalikiana) : Posted in a previous version of this proposal | # |
Tim Peeters (tpeeters) wrote : | # |
resubmitted without prerequisite (which landed already, but it seems like jenkins did not detect that well)
Cris Dywan (kalikiana) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1120
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1121
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Cris Dywan (kalikiana) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1122
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Tim Peeters (tpeeters) wrote : | # |
waiting for this to land in staging: https:/
- 1123. By Tim Peeters
-
merge pre-requisite
- 1124. By Tim Peeters
-
merge staging
- 1125. By Tim Peeters
-
merge staging
Unmerged revisions
Preview Diff
1 | === modified file 'components.api' |
2 | --- components.api 2014-06-19 07:21:53 +0000 |
3 | +++ components.api 2014-06-25 19:46:23 +0000 |
4 | @@ -63,18 +63,8 @@ |
5 | property size sourceSize |
6 | readonly property int status |
7 | Header 0.1 1.0 |
8 | -StyledItem |
9 | - property bool animate |
10 | - function show() |
11 | - function hide() |
12 | - property string title |
13 | - property Item contents |
14 | - property var tabsModel |
15 | - property var pageStack |
16 | - property var actions |
17 | - property var __customBackAction |
18 | - property Flickable flickable |
19 | - property bool useDeprecatedToolbar |
20 | +AppHeader |
21 | + property string _for_autopilot |
22 | Icon 0.1 1.0 |
23 | Item |
24 | property string name |
25 | |
26 | === renamed file 'modules/Ubuntu/Components/Header.qml' => 'modules/Ubuntu/Components/AppHeader.qml' |
27 | --- modules/Ubuntu/Components/Header.qml 2014-05-06 10:24:56 +0000 |
28 | +++ modules/Ubuntu/Components/AppHeader.qml 2014-06-25 19:46:23 +0000 |
29 | @@ -19,7 +19,7 @@ |
30 | |
31 | /*! |
32 | \internal |
33 | - \qmltype Header |
34 | + \qmltype AppHeader |
35 | \inqmlmodule Ubuntu.Components 1.1 |
36 | \ingroup ubuntu |
37 | */ |
38 | |
39 | === added file 'modules/Ubuntu/Components/Header.qml' |
40 | --- modules/Ubuntu/Components/Header.qml 1970-01-01 00:00:00 +0000 |
41 | +++ modules/Ubuntu/Components/Header.qml 2014-06-25 19:46:23 +0000 |
42 | @@ -0,0 +1,39 @@ |
43 | +/* |
44 | + * Copyright 2014 Canonical Ltd. |
45 | + * |
46 | + * This program is free software; you can redistribute it and/or modify |
47 | + * it under the terms of the GNU Lesser General Public License as published by |
48 | + * the Free Software Foundation; version 3. |
49 | + * |
50 | + * This program is distributed in the hope that it will be useful, |
51 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
52 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
53 | + * GNU Lesser General Public License for more details. |
54 | + * |
55 | + * You should have received a copy of the GNU Lesser General Public License |
56 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
57 | + */ |
58 | + |
59 | +import QtQuick 2.0 |
60 | + |
61 | +/*! |
62 | + \qmltype Header |
63 | + \internal |
64 | + \deprecated |
65 | +*/ |
66 | +AppHeader { |
67 | + |
68 | + /*! |
69 | + \internal |
70 | + We need this property so QML exposes this class as Header instead of |
71 | + AppHeader. This way autopilot can select the deprecated header. |
72 | + */ |
73 | + property string _for_autopilot |
74 | + |
75 | + Component.onCompleted: { |
76 | + print("WARNING: Header is an internal component of Ubuntu.Components and" + |
77 | + "its API may change or be removed at any moment." + |
78 | + "Please use MainView and Page instead." |
79 | + ); |
80 | + } |
81 | +} |
82 | |
83 | === modified file 'modules/Ubuntu/Components/MainView.qml' |
84 | --- modules/Ubuntu/Components/MainView.qml 2014-05-09 23:03:21 +0000 |
85 | +++ modules/Ubuntu/Components/MainView.qml 2014-06-25 19:46:23 +0000 |
86 | @@ -334,7 +334,7 @@ |
87 | The header of the MainView. Can be used to obtain the height of the header |
88 | in \l Page to determine the area for the \l Page to fill. |
89 | */ |
90 | - Header { |
91 | + AppHeader { |
92 | // FIXME We need to set an object name to this header in order to differentiate it from the ListItem.Header on Autopilot tests. |
93 | // This is a temporary workaround while we find a better solution for https://bugs.launchpad.net/autopilot/+bug/1210265 |
94 | // --elopio - 2013-08-08 |
95 | @@ -479,7 +479,7 @@ |
96 | The header that will be propagated to the children in the page tree node. |
97 | It is used by Tabs to bind header's tabsModel. |
98 | */ |
99 | - property Header header: headerItem |
100 | + property AppHeader header: headerItem |
101 | |
102 | /*! |
103 | \internal |
104 | |
105 | === modified file 'modules/Ubuntu/Components/Page.qml' |
106 | --- modules/Ubuntu/Components/Page.qml 2014-05-23 09:27:57 +0000 |
107 | +++ modules/Ubuntu/Components/Page.qml 2014-06-25 19:46:23 +0000 |
108 | @@ -174,7 +174,7 @@ |
109 | actionContext.active = page.active; |
110 | } |
111 | |
112 | - property Header header: page.__propagated && page.__propagated.header ? page.__propagated.header : null |
113 | + property AppHeader header: page.__propagated && page.__propagated.header ? page.__propagated.header : null |
114 | // Used to position the Page when there is no flickable. |
115 | // When there is a flickable, the header will automatically position it. |
116 | property real headerHeight: internal.header && internal.header.visible ? internal.header.height : 0 |
117 | @@ -189,7 +189,7 @@ |
118 | target: tools |
119 | property: "visible" |
120 | value: false |
121 | - when: header && !header.useDeprecatedToolbar && |
122 | + when: internal.header && !internal.header.useDeprecatedToolbar && |
123 | page.tools !== null |
124 | } |
125 | |
126 | |
127 | === modified file 'modules/Ubuntu/Components/PageTreeNode.qml' |
128 | --- modules/Ubuntu/Components/PageTreeNode.qml 2014-05-16 11:33:37 +0000 |
129 | +++ modules/Ubuntu/Components/PageTreeNode.qml 2014-06-25 19:46:23 +0000 |
130 | @@ -43,14 +43,14 @@ |
131 | /*! |
132 | \deprecated |
133 | The header of the node. Propagates down from the root node. |
134 | - This property is deprecated. |
135 | + This property is DEPRECATED. |
136 | */ |
137 | - property Header header: node.__propagated ? node.__propagated.header : null |
138 | + property AppHeader header: node.__propagated ? node.__propagated.header : null |
139 | |
140 | /*! |
141 | \deprecated |
142 | The toolbar of the node. Propagates down from the root node. |
143 | - This property is deprecated. |
144 | + This property is DEPRECATED. |
145 | */ |
146 | property Toolbar toolbar: node.__propagated ? node.__propagated.toolbar : null |
147 | |
148 | @@ -109,6 +109,7 @@ |
149 | |
150 | Item { |
151 | id: internal |
152 | + |
153 | function isPageTreeNode(object) { |
154 | // FIXME: Use QuickUtils.className() when it becomes available. |
155 | return (object && object.hasOwnProperty("__isPageTreeNode") && object.__isPageTreeNode); |
156 | |
157 | === modified file 'modules/Ubuntu/Components/Tabs.qml' |
158 | --- modules/Ubuntu/Components/Tabs.qml 2014-05-10 15:54:11 +0000 |
159 | +++ modules/Ubuntu/Components/Tabs.qml 2014-06-25 19:46:23 +0000 |
160 | @@ -303,7 +303,7 @@ |
161 | |
162 | Object { |
163 | id: internal |
164 | - property Header header: tabs.__propagated ? tabs.__propagated.header : null |
165 | + property AppHeader header: tabs.__propagated ? tabs.__propagated.header : null |
166 | |
167 | /* |
168 | List of connected Repeaters to avoid repeater "hammering" of itemAdded() signal. |
169 | |
170 | === modified file 'modules/Ubuntu/Components/qmldir' |
171 | --- modules/Ubuntu/Components/qmldir 2014-05-28 18:08:33 +0000 |
172 | +++ modules/Ubuntu/Components/qmldir 2014-06-25 19:46:23 +0000 |
173 | @@ -29,6 +29,7 @@ |
174 | internal PageTreeNode PageTreeNode.qml |
175 | PageStack 0.1 PageStack.qml |
176 | internal Toolbar Toolbar.qml |
177 | +internal AppHeader AppHeader.qml |
178 | Header 0.1 Header.qml |
179 | internal AnimatedItem AnimatedItem.qml |
180 | internal PageWrapper PageWrapper.qml |
181 | |
182 | === modified file 'tests/autopilot/ubuntuuitoolkit/__init__.py' |
183 | --- tests/autopilot/ubuntuuitoolkit/__init__.py 2014-05-09 04:12:25 +0000 |
184 | +++ tests/autopilot/ubuntuuitoolkit/__init__.py 2014-06-25 19:46:23 +0000 |
185 | @@ -18,6 +18,7 @@ |
186 | |
187 | |
188 | __all__ = [ |
189 | + 'AppHeader', |
190 | 'base', |
191 | 'check_autopilot_version', |
192 | 'CheckBox', |
193 | @@ -52,6 +53,7 @@ |
194 | tests, |
195 | ) |
196 | from ubuntuuitoolkit._custom_proxy_objects import ( |
197 | + AppHeader, |
198 | check_autopilot_version, |
199 | CheckBox, |
200 | get_keyboard, |
201 | |
202 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py' |
203 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py 2014-05-09 04:12:25 +0000 |
204 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py 2014-06-25 19:46:23 +0000 |
205 | @@ -18,6 +18,7 @@ |
206 | |
207 | |
208 | __all__ = [ |
209 | + 'AppHeader', |
210 | 'check_autopilot_version', |
211 | 'CheckBox', |
212 | 'get_keyboard', |
213 | @@ -47,7 +48,10 @@ |
214 | UbuntuUIToolkitCustomProxyObjectBase, |
215 | ) |
216 | from ubuntuuitoolkit._custom_proxy_objects._flickable import QQuickFlickable |
217 | -from ubuntuuitoolkit._custom_proxy_objects._header import Header |
218 | +from ubuntuuitoolkit._custom_proxy_objects._header import ( |
219 | + AppHeader, |
220 | + Header, |
221 | +) |
222 | from ubuntuuitoolkit._custom_proxy_objects import listitems |
223 | from ubuntuuitoolkit._custom_proxy_objects._mainview import MainView |
224 | from ubuntuuitoolkit._custom_proxy_objects._optionselector import ( |
225 | |
226 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py' |
227 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-06-04 07:05:01 +0000 |
228 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-06-25 19:46:23 +0000 |
229 | @@ -31,8 +31,8 @@ |
230 | logger = logging.getLogger(__name__) |
231 | |
232 | |
233 | -class Header(_common.UbuntuUIToolkitCustomProxyObjectBase): |
234 | - """Header Autopilot emulator.""" |
235 | +class AppHeader(_common.UbuntuUIToolkitCustomProxyObjectBase): |
236 | + """AppHeader Autopilot emulator.""" |
237 | |
238 | def _show_if_not_visible(self): |
239 | if not self._is_visible(): |
240 | @@ -132,7 +132,7 @@ |
241 | |
242 | if self.useDeprecatedToolbar: |
243 | raise _common.ToolkitException( |
244 | - "Header.swtich_to_tab_by_index only works with new header") |
245 | + "AppHeader.switch_to_tab_by_index only works with new header") |
246 | else: |
247 | self._switch_to_tab_in_drawer_by_index(index) |
248 | |
249 | @@ -204,3 +204,14 @@ |
250 | # to find the requested button |
251 | return self.get_root_instance().select_single( |
252 | 'Standard', objectName=object_name) |
253 | + |
254 | + |
255 | +class Header(AppHeader): |
256 | + """Autopilot helper for the deprecated Header.""" |
257 | + |
258 | + def __init__(self, *args): |
259 | + logger.warning( |
260 | + 'Header is an internal QML component of Ubuntu.Components and ' |
261 | + 'its API may change or be removed at any moment. Please use ' |
262 | + 'MainView and Page instead.') |
263 | + super(Header, self).__init__(*args) |
264 | |
265 | === modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py' |
266 | --- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-05-19 08:35:01 +0000 |
267 | +++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-06-25 19:46:23 +0000 |
268 | @@ -39,9 +39,10 @@ |
269 | """MainView Autopilot emulator.""" |
270 | |
271 | def get_header(self): |
272 | - """Return the Header emulator of the MainView.""" |
273 | + """Return the AppHeader emulator of the MainView.""" |
274 | try: |
275 | - return self.select_single('Header', objectName='MainView_Header') |
276 | + return self.select_single( |
277 | + 'AppHeader', objectName='MainView_Header') |
278 | except dbus.StateNotFoundError: |
279 | raise _common.ToolkitException('The main view has no header.') |
280 | |
281 | |
282 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py' |
283 | --- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-06-09 17:20:43 +0000 |
284 | +++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-06-25 19:46:23 +0000 |
285 | @@ -150,7 +150,7 @@ |
286 | |
287 | def checkPageHeader(self, pageTitle): |
288 | orientationHelper = self.getOrientationHelper() |
289 | - header = orientationHelper.select_many("Header", title=pageTitle)[0] |
290 | + header = orientationHelper.select_single("AppHeader", title=pageTitle) |
291 | self.assertThat(header, Not(Is(None))) |
292 | self.assertThat(header.visible, Eventually(Equals(True))) |
293 | return header |
294 | |
295 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderTestCase.qml' |
296 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderTestCase.qml 1970-01-01 00:00:00 +0000 |
297 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderTestCase.qml 2014-06-25 19:46:23 +0000 |
298 | @@ -0,0 +1,27 @@ |
299 | +/* |
300 | + * Copyright 2014 Canonical Ltd. |
301 | + * |
302 | + * This program is free software; you can redistribute it and/or modify |
303 | + * it under the terms of the GNU Lesser General Public License as published by |
304 | + * the Free Software Foundation; version 3. |
305 | + * |
306 | + * This program is distributed in the hope that it will be useful, |
307 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
308 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
309 | + * GNU Lesser General Public License for more details. |
310 | + * |
311 | + * You should have received a copy of the GNU Lesser General Public License |
312 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
313 | + */ |
314 | + |
315 | +import QtQuick 2.0 |
316 | +import Ubuntu.Components 1.1 |
317 | + |
318 | +Item { |
319 | + |
320 | + objectName: 'main' |
321 | + |
322 | + Header { |
323 | + title: 'test' |
324 | + } |
325 | +} |
326 | |
327 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py' |
328 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-05 21:21:44 +0000 |
329 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-25 19:46:23 +0000 |
330 | @@ -14,8 +14,12 @@ |
331 | # You should have received a copy of the GNU Lesser General Public License |
332 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
333 | |
334 | +import logging |
335 | import os |
336 | |
337 | +import fixtures |
338 | +from testtools.matchers import Contains |
339 | + |
340 | import ubuntuuitoolkit |
341 | from ubuntuuitoolkit import tests |
342 | from testtools.matchers import Equals |
343 | @@ -133,7 +137,7 @@ |
344 | self.assertEqual(self.label.text, 'No button clicked.') |
345 | |
346 | def test_header_custom_proxy_object(self): |
347 | - self.assertIsInstance(self.header, ubuntuuitoolkit.Header) |
348 | + self.assertIsInstance(self.header, ubuntuuitoolkit.AppHeader) |
349 | self.assertTrue(self.header.visible) |
350 | self.assertEqual(self.header.title, "Test title") |
351 | |
352 | @@ -212,4 +216,27 @@ |
353 | |
354 | """ |
355 | header = self.main_view.get_header() |
356 | - self.assertIsInstance(header, ubuntuuitoolkit.Header) |
357 | + self.assertIsInstance(header, ubuntuuitoolkit.AppHeader) |
358 | + |
359 | + |
360 | +class DeprecatedHeaderTestCase(tests.QMLFileAppTestCase): |
361 | + |
362 | + path = os.path.abspath(__file__) |
363 | + dir_path = os.path.dirname(path) |
364 | + test_qml_file_path = os.path.join( |
365 | + dir_path, 'test_header.DeprecatedHeaderTestCase.qml') |
366 | + |
367 | + @property |
368 | + def main_view(self): |
369 | + return self.app.select_single('QQuickItem', objectName='main') |
370 | + |
371 | + def test_get_deprecated_header_must_log_deprecation_warning(self): |
372 | + fake_logger = fixtures.FakeLogger(level=logging.WARNING) |
373 | + self.useFixture(fake_logger) |
374 | + self.main_view.select_single(ubuntuuitoolkit.Header) |
375 | + self.assertThat( |
376 | + fake_logger.output, |
377 | + Contains( |
378 | + 'Header is an internal QML component of Ubuntu.Components and ' |
379 | + 'its API may change or be removed at any moment. Please use ' |
380 | + 'MainView and Page instead.')) |
381 | |
382 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py' |
383 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py 2014-04-25 16:43:00 +0000 |
384 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py 2014-06-25 19:46:23 +0000 |
385 | @@ -116,7 +116,8 @@ |
386 | |
387 | def test_switch_to_opened_tab_is_not_opened_again(self): |
388 | with mock.patch.object( |
389 | - ubuntuuitoolkit.Header, 'switch_to_next_tab') as mock_switch: |
390 | + ubuntuuitoolkit.AppHeader, |
391 | + 'switch_to_next_tab') as mock_switch: |
392 | current_tab = self.main_view.switch_to_tab_by_index(0) |
393 | |
394 | self.assertFalse(mock_switch.called) |
395 | |
396 | === modified file 'tests/qmlapicheck.py' |
397 | --- tests/qmlapicheck.py 2014-05-26 16:03:32 +0000 |
398 | +++ tests/qmlapicheck.py 2014-06-25 19:46:23 +0000 |
399 | @@ -63,12 +63,12 @@ |
400 | fullpath = folder + '/' + filename |
401 | classname = pieces[0] |
402 | version = pieces[1] |
403 | - if not fullpath in inputfiles: |
404 | + if fullpath not in inputfiles: |
405 | inputfiles.append(fullpath) |
406 | classes[fullpath] = [classname, version] |
407 | else: |
408 | versions = classes[fullpath] |
409 | - if not classname in versions: |
410 | + if classname not in versions: |
411 | versions.append(classname) |
412 | versions.append(version) |
413 | else: |
414 | @@ -118,7 +118,7 @@ |
415 | # internal without type always relates to the next declared property |
416 | annotated_properties['internal'] = 'internal' |
417 | |
418 | - if '/*' in line and not '*/' in line: |
419 | + if '/*' in line and '*/' not in line: |
420 | in_comment = True |
421 | continue |
422 | if '*/' in line: |
423 | @@ -133,7 +133,7 @@ |
424 | continue |
425 | |
426 | # End of function/ signal/ Item block |
427 | - if '}' in line and not '{' in line: |
428 | + if '}' in line and '{' not in line: |
429 | in_block -= 1 |
430 | block_meta = {} |
431 | if in_block == 1 and in_builtin_type: |
432 | @@ -162,7 +162,7 @@ |
433 | |
434 | block_meta[words[0]] = line |
435 | # Omit prototype if it comes before the name since we may skip it |
436 | - if not 'name' in block_meta and words[0] == 'prototype': |
437 | + if 'name' not in block_meta and words[0] == 'prototype': |
438 | continue |
439 | |
440 | # Don't consider the qml variable name as a keyword |
441 | @@ -183,10 +183,10 @@ |
442 | no_mods = no_mods.replace(mod, '') |
443 | name = no_mods.strip().split(' ')[2] |
444 | if 'internal' in annotated_properties: |
445 | - if not name in annotated_properties: |
446 | + if name not in annotated_properties: |
447 | annotated_properties[name] = 'internal' |
448 | del annotated_properties['internal'] |
449 | - if not name in annotated_properties: |
450 | + if name not in annotated_properties: |
451 | print(' %s' % (signature)) |
452 | print('Error: Missing \\qmlproperty for %s' % name) |
453 | sys.exit(1) |
454 | @@ -199,7 +199,7 @@ |
455 | break |
456 | |
457 | # Start of function/ signal/ Item block |
458 | - if '{' in line and not '}' in line: |
459 | + if '{' in line and '}' not in line: |
460 | in_block += 1 |
461 | block_meta = {} |
462 | # The parent type can affect API |
463 | |
464 | === modified file 'tests/unit/tst_components/tst_pagestack.qml' |
465 | --- tests/unit/tst_components/tst_pagestack.qml 2014-05-10 16:32:59 +0000 |
466 | +++ tests/unit/tst_components/tst_pagestack.qml 2014-06-25 19:46:23 +0000 |
467 | @@ -69,11 +69,11 @@ |
468 | |
469 | function test_title_bug1143345_bug1317902() { |
470 | pageStack.push(page1); |
471 | - compare(mainView.__propagated.header.title, "Title 1", "Header is correctly set by page"); |
472 | + compare(mainView.__propagated.header.title, "Title 1", "Header title is correctly set by page"); |
473 | page1.title = "New title"; |
474 | compare(mainView.__propagated.header.title, "New title", "Header title correctly updated by page"); |
475 | pageStack.push(page2); |
476 | - compare(mainView.__propagated.header.title, "Title 2", "Header is correctly set by page"); |
477 | + compare(mainView.__propagated.header.title, "Title 2", "Header title is correctly set by page"); |
478 | pageStack.clear(); |
479 | page1.title = "Title 1"; |
480 |
FAILED: Continuous integration, rev:1104 jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- ci/328/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/642/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 587/console jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- utopic- amd64-ci/ 160/console jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- utopic- armhf-ci/ 160/console jenkins. qa.ubuntu. com/job/ ubuntu- sdk-team- ubuntu- ui-toolkit- staging- utopic- i386-ci/ 160/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1231/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/726/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- sdk-team- ubuntu- ui-toolkit- staging- ci/328/ rebuild
http://