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
=== modified file 'components.api'
--- components.api 2014-05-28 18:08:33 +0000
+++ components.api 2014-06-19 14:03:36 +0000
@@ -63,18 +63,8 @@
63 property size sourceSize63 property size sourceSize
64 readonly property int status64 readonly property int status
65Header 0.1 1.065Header 0.1 1.0
66StyledItem66AppHeader
67 property bool animate67 property string _for_autopilot
68 function show()
69 function hide()
70 property string title
71 property Item contents
72 property var tabsModel
73 property var pageStack
74 property var actions
75 property var __customBackAction
76 property Flickable flickable
77 property bool useDeprecatedToolbar
78Icon 0.1 1.068Icon 0.1 1.0
79Item69Item
80 property string name70 property string name
8171
=== renamed file 'modules/Ubuntu/Components/Header.qml' => 'modules/Ubuntu/Components/AppHeader.qml'
--- modules/Ubuntu/Components/Header.qml 2014-05-06 10:24:56 +0000
+++ modules/Ubuntu/Components/AppHeader.qml 2014-06-19 14:03:36 +0000
@@ -19,7 +19,7 @@
1919
20/*!20/*!
21 \internal21 \internal
22 \qmltype Header22 \qmltype AppHeader
23 \inqmlmodule Ubuntu.Components 1.123 \inqmlmodule Ubuntu.Components 1.1
24 \ingroup ubuntu24 \ingroup ubuntu
25*/25*/
2626
=== added file 'modules/Ubuntu/Components/Header.qml'
--- modules/Ubuntu/Components/Header.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/Header.qml 2014-06-19 14:03:36 +0000
@@ -0,0 +1,39 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18
19/*!
20 \qmltype Header
21 \internal
22 \deprecated
23*/
24AppHeader {
25
26 /*!
27 \internal
28 We need this property so QML exposes this class as Header instead of
29 AppHeader. This way autopilot can select the deprecated header.
30 */
31 property string _for_autopilot
32
33 Component.onCompleted: {
34 print("WARNING: Header is an internal component of Ubuntu.Components and" +
35 "its API may change or be removed at any moment." +
36 "Please use MainView and Page instead."
37 );
38 }
39}
040
=== modified file 'modules/Ubuntu/Components/MainView.qml'
--- modules/Ubuntu/Components/MainView.qml 2014-05-09 23:03:21 +0000
+++ modules/Ubuntu/Components/MainView.qml 2014-06-19 14:03:36 +0000
@@ -334,7 +334,7 @@
334 The header of the MainView. Can be used to obtain the height of the header334 The header of the MainView. Can be used to obtain the height of the header
335 in \l Page to determine the area for the \l Page to fill.335 in \l Page to determine the area for the \l Page to fill.
336 */336 */
337 Header {337 AppHeader {
338 // FIXME We need to set an object name to this header in order to differentiate it from the ListItem.Header on Autopilot tests.338 // FIXME We need to set an object name to this header in order to differentiate it from the ListItem.Header on Autopilot tests.
339 // This is a temporary workaround while we find a better solution for https://bugs.launchpad.net/autopilot/+bug/1210265339 // This is a temporary workaround while we find a better solution for https://bugs.launchpad.net/autopilot/+bug/1210265
340 // --elopio - 2013-08-08340 // --elopio - 2013-08-08
@@ -479,7 +479,7 @@
479 The header that will be propagated to the children in the page tree node.479 The header that will be propagated to the children in the page tree node.
480 It is used by Tabs to bind header's tabsModel.480 It is used by Tabs to bind header's tabsModel.
481 */481 */
482 property Header header: headerItem482 property AppHeader header: headerItem
483483
484 /*!484 /*!
485 \internal485 \internal
486486
=== modified file 'modules/Ubuntu/Components/Page.qml'
--- modules/Ubuntu/Components/Page.qml 2014-05-23 09:27:57 +0000
+++ modules/Ubuntu/Components/Page.qml 2014-06-19 14:03:36 +0000
@@ -174,7 +174,7 @@
174 actionContext.active = page.active;174 actionContext.active = page.active;
175 }175 }
176176
177 property Header header: page.__propagated && page.__propagated.header ? page.__propagated.header : null177 property AppHeader header: page.__propagated && page.__propagated.header ? page.__propagated.header : null
178 // Used to position the Page when there is no flickable.178 // Used to position the Page when there is no flickable.
179 // When there is a flickable, the header will automatically position it.179 // When there is a flickable, the header will automatically position it.
180 property real headerHeight: internal.header && internal.header.visible ? internal.header.height : 0180 property real headerHeight: internal.header && internal.header.visible ? internal.header.height : 0
@@ -189,7 +189,7 @@
189 target: tools189 target: tools
190 property: "visible"190 property: "visible"
191 value: false191 value: false
192 when: header && !header.useDeprecatedToolbar &&192 when: internal.header && !internal.header.useDeprecatedToolbar &&
193 page.tools !== null193 page.tools !== null
194 }194 }
195195
196196
=== modified file 'modules/Ubuntu/Components/PageTreeNode.qml'
--- modules/Ubuntu/Components/PageTreeNode.qml 2014-05-16 11:33:37 +0000
+++ modules/Ubuntu/Components/PageTreeNode.qml 2014-06-19 14:03:36 +0000
@@ -43,14 +43,14 @@
43 /*!43 /*!
44 \deprecated44 \deprecated
45 The header of the node. Propagates down from the root node.45 The header of the node. Propagates down from the root node.
46 This property is deprecated.46 This property is DEPRECATED.
47 */47 */
48 property Header header: node.__propagated ? node.__propagated.header : null48 property AppHeader header: node.__propagated ? node.__propagated.header : null
4949
50 /*!50 /*!
51 \deprecated51 \deprecated
52 The toolbar of the node. Propagates down from the root node.52 The toolbar of the node. Propagates down from the root node.
53 This property is deprecated.53 This property is DEPRECATED.
54 */54 */
55 property Toolbar toolbar: node.__propagated ? node.__propagated.toolbar : null55 property Toolbar toolbar: node.__propagated ? node.__propagated.toolbar : null
5656
@@ -109,6 +109,7 @@
109109
110 Item {110 Item {
111 id: internal111 id: internal
112
112 function isPageTreeNode(object) {113 function isPageTreeNode(object) {
113 // FIXME: Use QuickUtils.className() when it becomes available.114 // FIXME: Use QuickUtils.className() when it becomes available.
114 return (object && object.hasOwnProperty("__isPageTreeNode") && object.__isPageTreeNode);115 return (object && object.hasOwnProperty("__isPageTreeNode") && object.__isPageTreeNode);
115116
=== modified file 'modules/Ubuntu/Components/Tabs.qml'
--- modules/Ubuntu/Components/Tabs.qml 2014-05-10 15:54:11 +0000
+++ modules/Ubuntu/Components/Tabs.qml 2014-06-19 14:03:36 +0000
@@ -303,7 +303,7 @@
303303
304 Object {304 Object {
305 id: internal305 id: internal
306 property Header header: tabs.__propagated ? tabs.__propagated.header : null306 property AppHeader header: tabs.__propagated ? tabs.__propagated.header : null
307307
308 /*308 /*
309 List of connected Repeaters to avoid repeater "hammering" of itemAdded() signal.309 List of connected Repeaters to avoid repeater "hammering" of itemAdded() signal.
310310
=== modified file 'modules/Ubuntu/Components/qmldir'
--- modules/Ubuntu/Components/qmldir 2014-05-28 18:08:33 +0000
+++ modules/Ubuntu/Components/qmldir 2014-06-19 14:03:36 +0000
@@ -29,6 +29,7 @@
29internal PageTreeNode PageTreeNode.qml29internal PageTreeNode PageTreeNode.qml
30PageStack 0.1 PageStack.qml30PageStack 0.1 PageStack.qml
31internal Toolbar Toolbar.qml31internal Toolbar Toolbar.qml
32internal AppHeader AppHeader.qml
32Header 0.1 Header.qml33Header 0.1 Header.qml
33internal AnimatedItem AnimatedItem.qml34internal AnimatedItem AnimatedItem.qml
34internal PageWrapper PageWrapper.qml35internal PageWrapper PageWrapper.qml
3536
=== modified file 'tests/autopilot/ubuntuuitoolkit/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/__init__.py 2014-05-09 04:12:25 +0000
+++ tests/autopilot/ubuntuuitoolkit/__init__.py 2014-06-19 14:03:36 +0000
@@ -18,6 +18,7 @@
1818
1919
20__all__ = [20__all__ = [
21 'AppHeader',
21 'base',22 'base',
22 'check_autopilot_version',23 'check_autopilot_version',
23 'CheckBox',24 'CheckBox',
@@ -52,6 +53,7 @@
52 tests,53 tests,
53)54)
54from ubuntuuitoolkit._custom_proxy_objects import (55from ubuntuuitoolkit._custom_proxy_objects import (
56 AppHeader,
55 check_autopilot_version,57 check_autopilot_version,
56 CheckBox,58 CheckBox,
57 get_keyboard,59 get_keyboard,
5860
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py 2014-05-09 04:12:25 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/__init__.py 2014-06-19 14:03:36 +0000
@@ -18,6 +18,7 @@
1818
1919
20__all__ = [20__all__ = [
21 'AppHeader',
21 'check_autopilot_version',22 'check_autopilot_version',
22 'CheckBox',23 'CheckBox',
23 'get_keyboard',24 'get_keyboard',
@@ -47,7 +48,10 @@
47 UbuntuUIToolkitCustomProxyObjectBase,48 UbuntuUIToolkitCustomProxyObjectBase,
48)49)
49from ubuntuuitoolkit._custom_proxy_objects._flickable import QQuickFlickable50from ubuntuuitoolkit._custom_proxy_objects._flickable import QQuickFlickable
50from ubuntuuitoolkit._custom_proxy_objects._header import Header51from ubuntuuitoolkit._custom_proxy_objects._header import (
52 AppHeader,
53 Header,
54)
51from ubuntuuitoolkit._custom_proxy_objects import listitems55from ubuntuuitoolkit._custom_proxy_objects import listitems
52from ubuntuuitoolkit._custom_proxy_objects._mainview import MainView56from ubuntuuitoolkit._custom_proxy_objects._mainview import MainView
53from ubuntuuitoolkit._custom_proxy_objects._optionselector import (57from ubuntuuitoolkit._custom_proxy_objects._optionselector import (
5458
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-06-04 07:05:01 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_header.py 2014-06-19 14:03:36 +0000
@@ -31,8 +31,8 @@
31logger = logging.getLogger(__name__)31logger = logging.getLogger(__name__)
3232
3333
34class Header(_common.UbuntuUIToolkitCustomProxyObjectBase):34class AppHeader(_common.UbuntuUIToolkitCustomProxyObjectBase):
35 """Header Autopilot emulator."""35 """AppHeader Autopilot emulator."""
3636
37 def _show_if_not_visible(self):37 def _show_if_not_visible(self):
38 if not self._is_visible():38 if not self._is_visible():
@@ -132,7 +132,7 @@
132132
133 if self.useDeprecatedToolbar:133 if self.useDeprecatedToolbar:
134 raise _common.ToolkitException(134 raise _common.ToolkitException(
135 "Header.swtich_to_tab_by_index only works with new header")135 "AppHeader.switch_to_tab_by_index only works with new header")
136 else:136 else:
137 self._switch_to_tab_in_drawer_by_index(index)137 self._switch_to_tab_in_drawer_by_index(index)
138138
@@ -204,3 +204,14 @@
204 # to find the requested button204 # to find the requested button
205 return self.get_root_instance().select_single(205 return self.get_root_instance().select_single(
206 'Standard', objectName=object_name)206 'Standard', objectName=object_name)
207
208
209class Header(AppHeader):
210 """Autopilot helper for the deprecated Header."""
211
212 def __init__(self, *args):
213 logger.warning(
214 'Header is an internal QML component of Ubuntu.Components and '
215 'its API may change or be removed at any moment. Please use '
216 'MainView and Page instead.')
217 super(Header, self).__init__(*args)
207218
=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py'
--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-05-19 08:35:01 +0000
+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_mainview.py 2014-06-19 14:03:36 +0000
@@ -39,9 +39,10 @@
39 """MainView Autopilot emulator."""39 """MainView Autopilot emulator."""
4040
41 def get_header(self):41 def get_header(self):
42 """Return the Header emulator of the MainView."""42 """Return the AppHeader emulator of the MainView."""
43 try:43 try:
44 return self.select_single('Header', objectName='MainView_Header')44 return self.select_single(
45 'AppHeader', objectName='MainView_Header')
45 except dbus.StateNotFoundError:46 except dbus.StateNotFoundError:
46 raise _common.ToolkitException('The main view has no header.')47 raise _common.ToolkitException('The main view has no header.')
4748
4849
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-06-09 17:20:43 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-06-19 14:03:36 +0000
@@ -150,7 +150,7 @@
150150
151 def checkPageHeader(self, pageTitle):151 def checkPageHeader(self, pageTitle):
152 orientationHelper = self.getOrientationHelper()152 orientationHelper = self.getOrientationHelper()
153 header = orientationHelper.select_many("Header", title=pageTitle)[0]153 header = orientationHelper.select_single("AppHeader", title=pageTitle)
154 self.assertThat(header, Not(Is(None)))154 self.assertThat(header, Not(Is(None)))
155 self.assertThat(header.visible, Eventually(Equals(True)))155 self.assertThat(header.visible, Eventually(Equals(True)))
156 return header156 return header
157157
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderTestCase.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderTestCase.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.DeprecatedHeaderTestCase.qml 2014-06-19 14:03:36 +0000
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.1
19
20Item {
21
22 objectName: 'main'
23
24 Header {
25 title: 'test'
26 }
27}
028
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-05 21:21:44 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_header.py 2014-06-19 14:03:36 +0000
@@ -14,8 +14,12 @@
14# You should have received a copy of the GNU Lesser General Public License14# You should have received a copy of the GNU Lesser General Public License
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/>.
1616
17import logging
17import os18import os
1819
20import fixtures
21from testtools.matchers import Contains
22
19import ubuntuuitoolkit23import ubuntuuitoolkit
20from ubuntuuitoolkit import tests24from ubuntuuitoolkit import tests
21from testtools.matchers import Equals25from testtools.matchers import Equals
@@ -133,7 +137,7 @@
133 self.assertEqual(self.label.text, 'No button clicked.')137 self.assertEqual(self.label.text, 'No button clicked.')
134138
135 def test_header_custom_proxy_object(self):139 def test_header_custom_proxy_object(self):
136 self.assertIsInstance(self.header, ubuntuuitoolkit.Header)140 self.assertIsInstance(self.header, ubuntuuitoolkit.AppHeader)
137 self.assertTrue(self.header.visible)141 self.assertTrue(self.header.visible)
138 self.assertEqual(self.header.title, "Test title")142 self.assertEqual(self.header.title, "Test title")
139143
@@ -212,4 +216,27 @@
212216
213 """217 """
214 header = self.main_view.get_header()218 header = self.main_view.get_header()
215 self.assertIsInstance(header, ubuntuuitoolkit.Header)219 self.assertIsInstance(header, ubuntuuitoolkit.AppHeader)
220
221
222class DeprecatedHeaderTestCase(tests.QMLFileAppTestCase):
223
224 path = os.path.abspath(__file__)
225 dir_path = os.path.dirname(path)
226 test_qml_file_path = os.path.join(
227 dir_path, 'test_header.DeprecatedHeaderTestCase.qml')
228
229 @property
230 def main_view(self):
231 return self.app.select_single('QQuickItem', objectName='main')
232
233 def test_get_deprecated_header_must_log_deprecation_warning(self):
234 fake_logger = fixtures.FakeLogger(level=logging.WARNING)
235 self.useFixture(fake_logger)
236 self.main_view.select_single(ubuntuuitoolkit.Header)
237 self.assertThat(
238 fake_logger.output,
239 Contains(
240 'Header is an internal QML component of Ubuntu.Components and '
241 'its API may change or be removed at any moment. Please use '
242 'MainView and Page instead.'))
216243
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py 2014-04-25 16:43:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_tabs.py 2014-06-19 14:03:36 +0000
@@ -116,7 +116,8 @@
116116
117 def test_switch_to_opened_tab_is_not_opened_again(self):117 def test_switch_to_opened_tab_is_not_opened_again(self):
118 with mock.patch.object(118 with mock.patch.object(
119 ubuntuuitoolkit.Header, 'switch_to_next_tab') as mock_switch:119 ubuntuuitoolkit.AppHeader,
120 'switch_to_next_tab') as mock_switch:
120 current_tab = self.main_view.switch_to_tab_by_index(0)121 current_tab = self.main_view.switch_to_tab_by_index(0)
121122
122 self.assertFalse(mock_switch.called)123 self.assertFalse(mock_switch.called)
123124
=== modified file 'tests/unit/tst_components/tst_pagestack.qml'
--- tests/unit/tst_components/tst_pagestack.qml 2014-05-10 16:32:59 +0000
+++ tests/unit/tst_components/tst_pagestack.qml 2014-06-19 14:03:36 +0000
@@ -69,11 +69,11 @@
6969
70 function test_title_bug1143345_bug1317902() {70 function test_title_bug1143345_bug1317902() {
71 pageStack.push(page1);71 pageStack.push(page1);
72 compare(mainView.__propagated.header.title, "Title 1", "Header is correctly set by page");72 compare(mainView.__propagated.header.title, "Title 1", "Header title is correctly set by page");
73 page1.title = "New title";73 page1.title = "New title";
74 compare(mainView.__propagated.header.title, "New title", "Header title correctly updated by page");74 compare(mainView.__propagated.header.title, "New title", "Header title correctly updated by page");
75 pageStack.push(page2);75 pageStack.push(page2);
76 compare(mainView.__propagated.header.title, "Title 2", "Header is correctly set by page");76 compare(mainView.__propagated.header.title, "Title 2", "Header title is correctly set by page");
77 pageStack.clear();77 pageStack.clear();
78 page1.title = "Title 1";78 page1.title = "Title 1";
7979

Subscribers

People subscribed via source and target branches