Merge lp:~tpeeters/ubuntu-ui-toolkit/98-DeprecateHeader into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Superseded
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/98-DeprecateHeader
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~bzoltan/ubuntu-ui-toolkit/landing_28-05
Diff against target: 411 lines (+137/-33)
17 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/unit/tst_components/tst_pagestack.qml (+2/-2)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/98-DeprecateHeader
Reviewer Review Type Date Requested Status
Cris Dywan Approve
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+221935@code.launchpad.net

This proposal has been superseded by a proposal from 2014-06-23.

Commit message

Print a warning when using deprecated Header component.

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://code.launchpad.net/~tpeeters/messaging-app/ap-get-header/+merge/222201
https://code.launchpad.net/~tpeeters/ubuntu-terminal-app/use_default_get_header/+merge/223217
https://code.launchpad.net/~tpeeters/notes-app/remove_get_header/+merge/223218

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

messaging-app, notes-app and ubuntu-terminal-app might need updates on their autopilot tests.

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
Tim Peeters (tpeeters) wrote :
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
Zsombor Egri (zsombi) wrote :

Looks good now. Hopefully these kind of mistakes will not happen in the future :)

review: Approve
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 :

FAILED: Continuous integration, rev:1116
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/416/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1031
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/929
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/248
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/248
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/248/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/248
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1411
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1815
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1815/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8628
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/803
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1072
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1072/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/416/rebuild

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

FAILED: Continuous integration, rev:1118
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/418/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1035
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/932
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/250
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/250
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/250/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/250
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1414
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1819
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1819/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8631
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/806
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1075
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1075/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/418/rebuild

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

PASSED: Continuous integration, rev:1120
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/421/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/1040
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/937
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/253
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/253
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/253/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/253
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/1418
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1826
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/1826/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/8637
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/810
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1080
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/1080/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/421/rebuild

review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) :
review: Approve
1121. By Tim Peeters

merge staging

1122. By Tim Peeters

merge staging

1123. By Tim Peeters

merge pre-requisite

1124. By Tim Peeters

merge staging

1125. By Tim Peeters

merge staging

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components.api'
2--- components.api 2014-05-28 18:08:33 +0000
3+++ components.api 2014-06-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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-19 14:03:36 +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/unit/tst_components/tst_pagestack.qml'
397--- tests/unit/tst_components/tst_pagestack.qml 2014-05-10 16:32:59 +0000
398+++ tests/unit/tst_components/tst_pagestack.qml 2014-06-19 14:03:36 +0000
399@@ -69,11 +69,11 @@
400
401 function test_title_bug1143345_bug1317902() {
402 pageStack.push(page1);
403- compare(mainView.__propagated.header.title, "Title 1", "Header is correctly set by page");
404+ compare(mainView.__propagated.header.title, "Title 1", "Header title is correctly set by page");
405 page1.title = "New title";
406 compare(mainView.__propagated.header.title, "New title", "Header title correctly updated by page");
407 pageStack.push(page2);
408- compare(mainView.__propagated.header.title, "Title 2", "Header is correctly set by page");
409+ compare(mainView.__propagated.header.title, "Title 2", "Header title is correctly set by page");
410 pageStack.clear();
411 page1.title = "Title 1";
412

Subscribers

People subscribed via source and target branches