Merge lp:~nskaggs/ubuntu-ui-toolkit/fix-1328600 into lp:ubuntu-ui-toolkit

Proposed by Nicholas Skaggs
Status: Superseded
Proposed branch: lp:~nskaggs/ubuntu-ui-toolkit/fix-1328600
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 2085 lines (+1008/-147)
52 files modified
components.api (+11/-0)
debian/control (+3/-0)
examples/ubuntu-ui-toolkit-gallery/Colors.qml (+72/-0)
examples/ubuntu-ui-toolkit-gallery/ListItems.qml (+13/-2)
examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml (+7/-1)
examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml (+22/-1)
examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml (+5/-1)
modules/Ubuntu/Components/Colors/FIXME (+4/-0)
modules/Ubuntu/Components/Colors/UbuntuColors.qml (+131/-0)
modules/Ubuntu/Components/Colors/UbuntuColors10.qml (+4/-48)
modules/Ubuntu/Components/ListItems/Empty.qml (+1/-0)
modules/Ubuntu/Components/PageHeadConfiguration.qml (+31/-1)
modules/Ubuntu/Components/Pickers/DatePicker.qml (+1/-1)
modules/Ubuntu/Components/ProgressBar11.qdoc (+6/-0)
modules/Ubuntu/Components/ProgressBar11.qml (+21/-0)
modules/Ubuntu/Components/TextArea.qml (+1/-1)
modules/Ubuntu/Components/TextField.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml (+6/-1)
modules/Ubuntu/Components/Themes/Ambiance/Palette.qml (+10/-8)
modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml (+3/-1)
modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml (+2/-2)
modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml (+3/-2)
modules/Ubuntu/Components/Themes/PaletteValues.qml (+4/-0)
modules/Ubuntu/Components/Themes/SuruDark/Palette.qml (+4/-2)
modules/Ubuntu/Components/deployment.pri (+1/-1)
modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp (+6/-9)
modules/Ubuntu/Components/plugin/plugin.cpp (+10/-2)
modules/Ubuntu/Components/qmldir (+3/-2)
modules/Ubuntu/Test/UbuntuTestCase.qml (+10/-1)
tests/autopilot/ubuntuuitoolkit/__init__.py (+2/-0)
tests/autopilot/ubuntuuitoolkit/base.py (+12/-4)
tests/autopilot/ubuntuuitoolkit/fixture_setup.py (+85/-0)
tests/autopilot/ubuntuuitoolkit/tests/__init__.py (+19/-14)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+1/-4)
tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py (+52/-5)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py (+21/-7)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py (+10/-1)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py (+6/-0)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py (+15/-4)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py (+10/-2)
tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py (+16/-6)
tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py (+104/-3)
tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py (+70/-0)
tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py (+54/-0)
tests/qmlapicheck.sh (+1/-1)
tests/unit/runtest.sh (+1/-0)
tests/unit/tst_components/tst_progressbar.qml (+6/-1)
tests/unit/tst_components/tst_progressbar11.qml (+38/-0)
tests/unit_x11/tst_components/tst_animator.qml (+75/-0)
tests/unit_x11/tst_components/tst_textinput_touch.qml (+3/-5)
tests/unit_x11/tst_test/tst_ubuntutestcase.qml (+10/-1)
To merge this branch: bzr merge lp:~nskaggs/ubuntu-ui-toolkit/fix-1328600
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+227380@code.launchpad.net

Commit message

Change the default maxyear property to 15 to avoid 32-bit limitation issues

Description of the change

Change the default maxyear property to 15 to avoid 32-bit limitation issues

To post a comment you must log in.
1154. By Nicholas Skaggs

set min and max values for picker to avoid bug 1328600

1155. By Nicholas Skaggs

revert default datepicker change

1156. By Nicholas Skaggs

workaround for bug 1346669

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-07-10 11:50:13 +0000
+++ components.api 2014-07-18 18:17:44 +0000
@@ -46,6 +46,12 @@
46 readonly property color coolGrey46 readonly property color coolGrey
47 property Gradient orangeGradient47 property Gradient orangeGradient
48 property Gradient greyGradient48 property Gradient greyGradient
49 readonly property color lightGrey
50 readonly property color darkGrey
51 readonly property color red
52 readonly property color green
53 readonly property color blue
54 readonly property color purple
49ComboButton 1.155ComboButton 1.1
50Button56Button
51 property bool expanded57 property bool expanded
@@ -398,6 +404,9 @@
398 property real minimumValue404 property real minimumValue
399 property real maximumValue405 property real maximumValue
400 property real value406 property real value
407ProgressBar 1.1
408ProgressBar
409 property bool showProgressPercentage
401PullToRefresh 1.1410PullToRefresh 1.1
402StyledItem411StyledItem
403 readonly property bool releaseToRefresh412 readonly property bool releaseToRefresh
@@ -620,6 +629,7 @@
620 property color overlayText629 property color overlayText
621 property color field630 property color field
622 property color fieldText631 property color fieldText
632 property color selection
623ToolbarButton 0.1 1.0633ToolbarButton 0.1 1.0
624ActionItem634ActionItem
625ToolbarItems 0.1 1.0635ToolbarItems 0.1 1.0
@@ -657,6 +667,7 @@
657 function flick(item, x, y, dx, dy, pressTimeout, steps, button, modifiers, delay)667 function flick(item, x, y, dx, dy, pressTimeout, steps, button, modifiers, delay)
658 function mouseLongPress(item, x, y, button, modifiers, delay)668 function mouseLongPress(item, x, y, button, modifiers, delay)
659 function tryCompareFunction(func, expectedResult, timeout)669 function tryCompareFunction(func, expectedResult, timeout)
670 function typeString(string)
660plugins.qmltypes671plugins.qmltypes
661 name: "FilterBehavior"672 name: "FilterBehavior"
662 prototype: "QObject"673 prototype: "QObject"
663674
=== modified file 'debian/control'
--- debian/control 2014-07-09 17:37:43 +0000
+++ debian/control 2014-07-18 18:17:44 +0000
@@ -39,6 +39,7 @@
39 xvfb,39 xvfb,
40 libgl1-mesa-dri,40 libgl1-mesa-dri,
41 locales,41 locales,
42 suru-icon-theme,
42Standards-Version: 3.9.443Standards-Version: 3.9.4
43Homepage: https://launchpad.net/ubuntu-ui-toolkit44Homepage: https://launchpad.net/ubuntu-ui-toolkit
44# If you aren't a member of ~ubuntu-sdk-team but need to upload packaging45# If you aren't a member of ~ubuntu-sdk-team but need to upload packaging
@@ -135,10 +136,12 @@
135 libqt5widgets5,136 libqt5widgets5,
136 python-autopilot (>= 1.4),137 python-autopilot (>= 1.4),
137 python-fixtures,138 python-fixtures,
139 python-gi,
138 python-mock,140 python-mock,
139 python-testscenarios,141 python-testscenarios,
140 python-testtools,142 python-testtools,
141 python3-fixtures,143 python3-fixtures,
144 python3-gi,
142 python3-testscenarios,145 python3-testscenarios,
143 python3-testtools,146 python3-testtools,
144 python3-autopilot (>= 1.4),147 python3-autopilot (>= 1.4),
145148
=== added file 'examples/ubuntu-ui-toolkit-gallery/Colors.qml'
--- examples/ubuntu-ui-toolkit-gallery/Colors.qml 1970-01-01 00:00:00 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Colors.qml 2014-07-18 18:17:44 +0000
@@ -0,0 +1,72 @@
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.2
18import Ubuntu.Components 1.1
19
20Template {
21 objectName: "colorsTemplate"
22
23 TemplateSection {
24 title: "UbuntuColors"
25 className: "UbuntuColors"
26
27 // Except orange, none of the colors from UbuntuComponents 1.0
28 // are included because they may be deprecated soon.
29 TemplateRow {
30 title: i18n.tr("Orange")
31 UbuntuShape {
32 color: UbuntuColors.orange
33 }
34 }
35 TemplateRow {
36 title: i18n.tr("Light grey")
37 UbuntuShape {
38 color: UbuntuColors.lightGrey
39 }
40 }
41 TemplateRow {
42 title: i18n.tr("Dark grey")
43 UbuntuShape {
44 color: UbuntuColors.darkGrey
45 }
46 }
47 TemplateRow {
48 title: i18n.tr("Red")
49 UbuntuShape {
50 color: UbuntuColors.red
51 }
52 }
53 TemplateRow {
54 title: i18n.tr("Green")
55 UbuntuShape {
56 color: UbuntuColors.green
57 }
58 }
59 TemplateRow {
60 title: i18n.tr("Blue")
61 UbuntuShape {
62 color: UbuntuColors.blue
63 }
64 }
65 TemplateRow {
66 title: i18n.tr("Purple")
67 UbuntuShape {
68 color: UbuntuColors.purple
69 }
70 }
71 }
72}
073
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2014-05-07 11:40:37 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2014-07-18 18:17:44 +0000
@@ -50,7 +50,7 @@
5050
51 TemplateSection {51 TemplateSection {
52 title: i18n.tr("ThinDivider")52 title: i18n.tr("ThinDivider")
53 className: "ThinDivider"53 className: "ListItems-ThinDivider"
5454
55 Column {55 Column {
56 anchors.left: parent.left56 anchors.left: parent.left
@@ -198,6 +198,7 @@
198 }198 }
199199
200 ListItemsSection {200 ListItemsSection {
201 id: removableSection
201 title: i18n.tr("Removable")202 title: i18n.tr("Removable")
202 className: "Standard"203 className: "Standard"
203 delegate: ListItem.Standard {204 delegate: ListItem.Standard {
@@ -209,11 +210,21 @@
209 color: Theme.palette.normal.base210 color: Theme.palette.normal.base
210 }211 }
211 }212 }
213
214 Toolkit.Button {
215 text: i18n.tr("Reset")
216 anchors.right: parent.right
217 onClicked: {
218 for (var i=0, iMax=removableSection.count; i < iMax; i++) {
219 removableSection.itemAt(i).cancelItemRemoval()
220 }
221 }
222 }
212 }223 }
213224
214 TemplateSection {225 TemplateSection {
215 title: i18n.tr("Grouped list")226 title: i18n.tr("Grouped list")
216 className: "Header"227 className: "ListItems-Header"
217228
218 Rectangle {229 Rectangle {
219 color: Qt.rgba(0.0, 0.0, 0.0, 0.01)230 color: Qt.rgba(0.0, 0.0, 0.0, 0.01)
220231
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml'
--- examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml 2014-04-23 09:39:11 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml 2014-07-18 18:17:44 +0000
@@ -20,7 +20,13 @@
20TemplateSection {20TemplateSection {
21 id: section21 id: section
22 property alias delegate: repeater.delegate22 property alias delegate: repeater.delegate
23 documentation: "qml-ubuntu-components-listitems0-%1.html".arg(className.toLowerCase())23 property alias count: repeater.count
24 documentation: "qml-ubuntu-components-listitems-%1.html".arg(className.toLowerCase())
25
26 function itemAt(index)
27 {
28 return repeater.itemAt(index)
29 }
2430
25 Column {31 Column {
26 id: column32 id: column
2733
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml'
--- examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2014-04-23 09:39:11 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2014-07-18 18:17:44 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 0.118import Ubuntu.Components 1.1
1919
20Template {20Template {
21 objectName: "progressBarsTemplate"21 objectName: "progressBarsTemplate"
@@ -53,6 +53,27 @@
53 indeterminate: true53 indeterminate: true
54 }54 }
55 }55 }
56
57 TemplateRow {
58 title: i18n.tr("No label")
59
60 ProgressBar {
61 id: progressNoLabel
62 objectName: "progressbar_nolabel"
63 width: parent.width
64 showProgressPercentage: false
65
66 SequentialAnimation on value {
67 loops: Animation.Infinite
68 NumberAnimation {
69 from: progress.minimumValue
70 to: progress.maximumValue
71 duration: 2000
72 }
73 PauseAnimation {duration: 1000}
74 }
75 }
76 }
56 }77 }
5778
58 TemplateSection {79 TemplateSection {
5980
=== modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml'
--- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-07-02 13:39:29 +0000
+++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-07-18 18:17:44 +0000
@@ -28,7 +28,11 @@
28 label: "Styles"28 label: "Styles"
29 source: "Styles.qml"29 source: "Styles.qml"
30 }30 }
3131 ListElement {
32 objectName: "colorsElement"
33 label: "Colors"
34 source: "Colors.qml"
35 }
32 ListElement {36 ListElement {
33 objectName: "togglesElement"37 objectName: "togglesElement"
34 label: "Toggles"38 label: "Toggles"
3539
=== modified file 'modules/Ubuntu/Components/Colors/FIXME'
--- modules/Ubuntu/Components/Colors/FIXME 2013-07-01 05:54:33 +0000
+++ modules/Ubuntu/Components/Colors/FIXME 2014-07-18 18:17:44 +0000
@@ -1,3 +1,7 @@
1UbuntuColors.qml is located in the Colors subdirectory because1UbuntuColors.qml is located in the Colors subdirectory because
2QuickUtils::createQmlObject() fails if the QML file is located in a2QuickUtils::createQmlObject() fails if the QML file is located in a
3folder that has a qmldir file with JavaScript modules.3folder that has a qmldir file with JavaScript modules.
4
5UbuntuColors 1.1 is not in a file named UbuntuColors11.qml but in
6UbuntuColors.qml so that qdoc can properly detect the component
7name without a qmldir file.
48
=== added file 'modules/Ubuntu/Components/Colors/UbuntuColors.qml'
--- modules/Ubuntu/Components/Colors/UbuntuColors.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/Colors/UbuntuColors.qml 2014-07-18 18:17:44 +0000
@@ -0,0 +1,131 @@
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.2
18
19/*!
20 \qmltype UbuntuColors
21 \inqmlmodule Ubuntu.Components 1.1
22 \ingroup ubuntu
23 \brief Singleton defining the Ubuntu color palette.
24
25 Each color of the Ubuntu color palette is accesible from it.
26 For more information on how to appropriately use the colors according to
27 the context, please refer to the
28 \l{http://design.ubuntu.com/brand/colour-palette}{Ubuntu brand guidelines}.
29
30 Example of use:
31
32 \qml
33 Rectangle {
34 color: UbuntuColors.orange
35 }
36 \endqml
37*/
38QtObject {
39 // old colors from UbuntuColors 1.0:
40
41 /*!
42 Orange. Recommended for branded elements, display progress
43 and intensity, textual links on light backgrounds.
44 */
45 readonly property color orange: "#DD4814"
46 /*!
47 \deprecated
48 Ubuntu supporting color: light aubergine
49 */
50 readonly property color lightAubergine: "#77216F"
51 /*!
52 \deprecated
53 Ubuntu supporting color: mid aubergine
54 */
55 readonly property color midAubergine: "#5E2750"
56 /*!
57 \deprecated
58 Ubuntu supporting color: dark aubergine
59 */
60 readonly property color darkAubergine: "#2C001E"
61 /*!
62 \deprecated
63 Ubuntu neutral color: warm grey
64 */
65 readonly property color warmGrey: "#AEA79F"
66 /*!
67 \deprecated
68 Ubuntu neutral color: cool grey
69 */
70 readonly property color coolGrey: "#333333"
71
72 /*!
73 Ubuntu orange gradient
74
75 \sa Button::gradient
76 */
77 property Gradient orangeGradient: Gradient {
78 GradientStop { position: 0.0; color: "#DD4814" }
79 GradientStop { position: 1.0; color: "#D9722D" }
80 }
81 /*!
82 Ubuntu grey gradient
83
84 \sa Button::gradient
85 */
86 property Gradient greyGradient: Gradient {
87 GradientStop { position: 0.0; color: "#888888" }
88 GradientStop { position: 1.0; color: "#BBBBBB" }
89 }
90
91 // New colors introduced in UbuntuColors 1.1:
92
93 /*!
94 Light grey. Recommended for neutral action buttons and
95 secondary text.
96 \since Ubuntu.Components 1.1
97 */
98 readonly property color lightGrey: "#888888"
99
100 /*!
101 Dark grey. Recommended for text and action icons.
102 \since Ubuntu.Components 1.1
103 */
104 readonly property color darkGrey: "#5d5d5d"
105
106 /*!
107 Red. Recommended for negative and irreversible action
108 buttons, errors and alerts.
109 \since Ubuntu.Components 1.1
110 */
111 readonly property color red: "#fc4949"
112
113 /*!
114 Green. Recommended for positive action buttons.
115 \since Ubuntu.Components 1.1
116 */
117 readonly property color green: "#3fb24f"
118
119 /*!
120 Blue. Recommended for text selection and text cursor.
121 \since Ubuntu.Components 1.1
122 */
123 readonly property color blue: "#1ab6ef"
124
125 /*!
126 Purple. Recommended for proper nouns in
127 list items.
128 \since Ubuntu.Components 1.1
129 */
130 readonly property color purple: "#762572"
131}
0132
=== renamed file 'modules/Ubuntu/Components/Colors/UbuntuColors.qml' => 'modules/Ubuntu/Components/Colors/UbuntuColors10.qml'
--- modules/Ubuntu/Components/Colors/UbuntuColors.qml 2013-07-02 00:15:07 +0000
+++ modules/Ubuntu/Components/Colors/UbuntuColors10.qml 2014-07-18 18:17:44 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 Copyright 2013 Canonical Ltd.2 Copyright 2013-2014 Canonical Ltd.
3 *3 *
4 This program is free software; you can redistribute it and/or modify4 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 by5 it under the terms of the GNU Lesser General Public License as published by
@@ -14,67 +14,23 @@
14 along with this program. If not, see <http://www.gnu.org/licenses/>.14 along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.2
1818
19/*!19/*!
20 \qmltype UbuntuColors20 \internal
21 \inqmlmodule Ubuntu.Components 0.121 Documentation is in UbuntuColors.qml
22 \ingroup theming
23 \brief Singleton defining the Ubuntu color palette.
24
25 Each color of the Ubuntu color palette is accesible from it.
26 For more information on how to appropriately use the colors according to
27 the context, please refer to the
28 \l{http://design.ubuntu.com/brand/colour-palette}{Ubuntu brand guidelines}.
29
30 Example of use:
31
32 \qml
33 Rectangle {
34 color: UbuntuColors.orange
35 }
36 \endqml
37*/22*/
38QtObject {23QtObject {
39 /*!
40 Ubuntu core color: Ubuntu orange
41 */
42 readonly property color orange: "#DD4814"24 readonly property color orange: "#DD4814"
43 /*!
44 Ubuntu supporting color: light aubergine
45 */
46 readonly property color lightAubergine: "#77216F"25 readonly property color lightAubergine: "#77216F"
47 /*!
48 Ubuntu supporting color: mid aubergine
49 */
50 readonly property color midAubergine: "#5E2750"26 readonly property color midAubergine: "#5E2750"
51 /*!
52 Ubuntu supporting color: dark aubergine
53 */
54 readonly property color darkAubergine: "#2C001E"27 readonly property color darkAubergine: "#2C001E"
55 /*!
56 Ubuntu neutral color: warm grey
57 */
58 readonly property color warmGrey: "#AEA79F"28 readonly property color warmGrey: "#AEA79F"
59 /*!
60 Ubuntu neutral color: cool grey
61 */
62 readonly property color coolGrey: "#333333"29 readonly property color coolGrey: "#333333"
63
64 /*!
65 Ubuntu orange gradient
66
67 \sa Button::gradient
68 */
69 property Gradient orangeGradient: Gradient {30 property Gradient orangeGradient: Gradient {
70 GradientStop { position: 0.0; color: "#DD4814" }31 GradientStop { position: 0.0; color: "#DD4814" }
71 GradientStop { position: 1.0; color: "#D9722D" }32 GradientStop { position: 1.0; color: "#D9722D" }
72 }33 }
73 /*!
74 Ubuntu grey gradient
75
76 \sa Button::gradient
77 */
78 property Gradient greyGradient: Gradient {34 property Gradient greyGradient: Gradient {
79 GradientStop { position: 0.0; color: "#888888" }35 GradientStop { position: 0.0; color: "#888888" }
80 GradientStop { position: 1.0; color: "#BBBBBB" }36 GradientStop { position: 1.0; color: "#BBBBBB" }
8137
=== modified file 'modules/Ubuntu/Components/ListItems/Empty.qml'
--- modules/Ubuntu/Components/ListItems/Empty.qml 2014-06-05 11:42:07 +0000
+++ modules/Ubuntu/Components/ListItems/Empty.qml 2014-07-18 18:17:44 +0000
@@ -175,6 +175,7 @@
175 function cancelItemRemoval()175 function cancelItemRemoval()
176 {176 {
177 priv.resetDrag()177 priv.resetDrag()
178 priv.removed = false
178 }179 }
179180
180 width: parent ? parent.width : units.gu(31)181 width: parent ? parent.width : units.gu(31)
181182
=== modified file 'modules/Ubuntu/Components/PageHeadConfiguration.qml'
--- modules/Ubuntu/Components/PageHeadConfiguration.qml 2014-07-01 11:27:29 +0000
+++ modules/Ubuntu/Components/PageHeadConfiguration.qml 2014-07-18 18:17:44 +0000
@@ -31,12 +31,42 @@
3131
32 /*!32 /*!
33 List of actions to show in the header.33 List of actions to show in the header.
34
35 Example:
36 \qml
37 Page {
38 title: "Custom header actions"
39 head.actions: [
40 Action {
41 iconName: "save"
42 text: i18n.tr("Save")
43 },
44 Action {
45 iconName: "add"
46 text: i18n.tr("Add")
47 }
48 ]
49 }
50 \endqml
34 */51 */
35 property list<Action> actions52 property list<Action> actions
3653
37 /*!54 /*!
38 Overrides the default \l PageStack back button and the55 Overrides the default \l PageStack back button and the
39 \l Tabs drawer button in the header.56 \l Tabs drawer button in the header.
57
58 Example:
59 \qml
60 Page {
61 title: "Back Action Page"
62 head.backAction: Action {
63 iconName: "close"
64 onTriggered: {
65 console.log("Run custom back action")
66 }
67 }
68 }
69 \endqml
40 */70 */
41 property Action backAction: null71 property Action backAction: null
4272
@@ -52,7 +82,7 @@
52 \qml82 \qml
53 Page {83 Page {
54 title: "Invisible title"84 title: "Invisible title"
55 contents: Rectangle {85 head.contents: Rectangle {
56 color: UbuntuColors.orange86 color: UbuntuColors.orange
57 height: units.gu(5)87 height: units.gu(5)
58 width: parent ? parent.width - units.gu(2) : undefined88 width: parent ? parent.width - units.gu(2) : undefined
5989
=== modified file 'modules/Ubuntu/Components/Pickers/DatePicker.qml'
--- modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-05-27 07:17:16 +0000
+++ modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-07-18 18:17:44 +0000
@@ -248,7 +248,7 @@
248 */248 */
249 property date maximum: {249 property date maximum: {
250 var d = Date.prototype.midnight.call(new Date());250 var d = Date.prototype.midnight.call(new Date());
251 d.setFullYear(d.getFullYear() + 50);251 d.setFullYear(d.getFullYear() + 15);
252 return d;252 return d;
253 }253 }
254254
255255
=== renamed file 'modules/Ubuntu/Components/ProgressBar.qml' => 'modules/Ubuntu/Components/ProgressBar10.qml'
=== added file 'modules/Ubuntu/Components/ProgressBar11.qdoc'
--- modules/Ubuntu/Components/ProgressBar11.qdoc 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/ProgressBar11.qdoc 2014-07-18 18:17:44 +0000
@@ -0,0 +1,6 @@
1/*!
2\qmlproperty bool ProgressBar::showProgressPercentage
3\since Ubuntu.Components 1.1
4
5Specifies if the value of the progress is visible
6*/
07
=== added file 'modules/Ubuntu/Components/ProgressBar11.qml'
--- modules/Ubuntu/Components/ProgressBar11.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/ProgressBar11.qml 2014-07-18 18:17:44 +0000
@@ -0,0 +1,21 @@
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
19ProgressBar {
20 property bool showProgressPercentage: true
21}
022
=== modified file 'modules/Ubuntu/Components/TextArea.qml'
--- modules/Ubuntu/Components/TextArea.qml 2014-06-28 17:26:49 +0000
+++ modules/Ubuntu/Components/TextArea.qml 2014-07-18 18:17:44 +0000
@@ -850,7 +850,7 @@
850 }850 }
851 color: control.__styleInstance.color851 color: control.__styleInstance.color
852 selectedTextColor: Theme.palette.selected.foregroundText852 selectedTextColor: Theme.palette.selected.foregroundText
853 selectionColor: Theme.palette.selected.foreground853 selectionColor: Theme.palette.selected.selection
854 font.pixelSize: FontUtils.sizeToPixels("medium")854 font.pixelSize: FontUtils.sizeToPixels("medium")
855 // forward keys to the root element so it can be captured outside of it855 // forward keys to the root element so it can be captured outside of it
856 // as well as to InputHandler to handle PageUp/PageDown keys856 // as well as to InputHandler to handle PageUp/PageDown keys
857857
=== modified file 'modules/Ubuntu/Components/TextField.qml'
--- modules/Ubuntu/Components/TextField.qml 2014-06-29 21:46:30 +0000
+++ modules/Ubuntu/Components/TextField.qml 2014-07-18 18:17:44 +0000
@@ -979,7 +979,7 @@
979 }979 }
980 color: control.__styleInstance.color980 color: control.__styleInstance.color
981 selectedTextColor: Theme.palette.selected.foregroundText981 selectedTextColor: Theme.palette.selected.foregroundText
982 selectionColor: Theme.palette.selected.foreground982 selectionColor: Theme.palette.selected.selection
983 font.pixelSize: FontUtils.sizeToPixels("medium")983 font.pixelSize: FontUtils.sizeToPixels("medium")
984 passwordCharacter: "\u2022"984 passwordCharacter: "\u2022"
985 // forward keys to the root element so it can be captured outside of it985 // forward keys to the root element so it can be captured outside of it
986986
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml 2014-05-22 13:04:58 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml 2014-07-18 18:17:44 +0000
@@ -28,7 +28,12 @@
28 verticalAlignment: Image.AlignVCenter28 verticalAlignment: Image.AlignVCenter
29 source: "artwork/spinner.png"29 source: "artwork/spinner.png"
3030
31 RotationAnimator on rotation {31 /*
32 Changed from RotationAnimator to RotationAnimation to
33 work around bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1338602
34 "Activity Indicator crashes in QML/Widget mixed applications"
35 */
36 RotationAnimation on rotation {
32 running: styledItem.running37 running: styledItem.running
33 from: 038 from: 0
34 to: 36039 to: 360
3540
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/Palette.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/Palette.qml 2013-07-05 12:21:32 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/Palette.qml 2014-07-18 18:17:44 +0000
@@ -15,6 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.1
18import Ubuntu.Components.Themes 0.119import Ubuntu.Components.Themes 0.1
1920
20Palette {21Palette {
@@ -22,13 +23,13 @@
22 background: "#EDEDED"23 background: "#EDEDED"
23 backgroundText: "#81888888"24 backgroundText: "#81888888"
24 base: "#1A000000"25 base: "#1A000000"
25 baseText: "#888888"26 baseText: UbuntuColors.lightGrey
26 foreground: "#888888"27 foreground: UbuntuColors.lightGrey
27 foregroundText: "#F3F3E7"28 foregroundText: "#F3F3E7"
28 overlay: "#FDFDFD"29 overlay: "#FDFDFD"
29 overlayText: "#888888"30 overlayText: UbuntuColors.lightGrey
30 field: "#1A000000"31 field: "#1A000000"
31 fieldText: "#888888"32 fieldText: UbuntuColors.darkGrey
32 }33 }
33 selected: PaletteValues {34 selected: PaletteValues {
34 /* FIXME: 'background' does not come from design35 /* FIXME: 'background' does not come from design
@@ -36,10 +37,11 @@
36 that will go away with the new design.37 that will go away with the new design.
37 */38 */
38 background: "#B2E6E6E6"39 background: "#B2E6E6E6"
39 backgroundText: "#888888"40 backgroundText: UbuntuColors.darkGrey
40 foreground: "#DD4814"41 selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.2)
41 foregroundText: "#F3F3E7"42 foreground: UbuntuColors.blue
43 foregroundText: UbuntuColors.darkGrey
42 field: "#FFFFFF"44 field: "#FFFFFF"
43 fieldText: "#888888"45 fieldText: UbuntuColors.darkGrey
44 }46 }
45}47}
4648
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml 2014-04-23 08:50:20 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml 2014-07-18 18:17:44 +0000
@@ -20,7 +20,7 @@
20Item {20Item {
21 id: progressBarStyle21 id: progressBarStyle
2222
23 property ProgressBar progressBar: styledItem23 property var progressBar: styledItem
2424
25 implicitWidth: units.gu(38)25 implicitWidth: units.gu(38)
26 implicitHeight: units.gu(4)26 implicitHeight: units.gu(4)
@@ -56,6 +56,7 @@
56 color: Theme.palette.normal.baseText56 color: Theme.palette.normal.baseText
57 text: progressBar.indeterminate ? i18n.tr("In Progress")57 text: progressBar.indeterminate ? i18n.tr("In Progress")
58 : "%1%".arg(Number(progressBarStyle.progress * 100.0).toFixed(0))58 : "%1%".arg(Number(progressBarStyle.progress * 100.0).toFixed(0))
59 visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage
5960
60 SequentialAnimation on opacity {61 SequentialAnimation on opacity {
61 loops: Animation.Infinite62 loops: Animation.Infinite
@@ -76,5 +77,6 @@
76 rightColor: Theme.palette.normal.baseText77 rightColor: Theme.palette.normal.baseText
77 progress: (progressBarStyle.progress * background.width - valueLabel.x) / valueLabel.width78 progress: (progressBarStyle.progress * background.width - valueLabel.x) / valueLabel.width
78 mirror: Qt.application.layoutDirection == Qt.RightToLeft79 mirror: Qt.application.layoutDirection == Qt.RightToLeft
80 visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage
79 }81 }
80}82}
8183
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-05-09 05:25:12 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-07-18 18:17:44 +0000
@@ -47,7 +47,7 @@
47 Component {47 Component {
48 id: delegate48 id: delegate
49 Rectangle {49 Rectangle {
50 width: units.dp(1)50 width: units.dp(2)
51 color: Theme.palette.selected.foreground51 color: Theme.palette.selected.foreground
52 visible: blinkTimer.timerShowCursor52 visible: blinkTimer.timerShowCursor
53 Timer {53 Timer {
@@ -70,7 +70,7 @@
70 // caretItem70 // caretItem
71 Image {71 Image {
72 id: caretItem72 id: caretItem
73 source: "artwork/teardrop-left.png"73 source: "artwork/caret_noshadow.png"
74 anchors {74 anchors {
75 top: parent.bottom75 top: parent.bottom
76 horizontalCenter: parent.horizontalCenter76 horizontalCenter: parent.horizontalCenter
7777
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-05-09 05:25:12 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-07-18 18:17:44 +0000
@@ -55,7 +55,7 @@
55 // caretItem55 // caretItem
56 Image {56 Image {
57 id: caretItem57 id: caretItem
58 source: "artwork/teardrop-left.png"58 source: "artwork/caret_noshadow.png"
59 anchors {59 anchors {
60 top: parent.bottom60 top: parent.bottom
61 horizontalCenter: parent.horizontalCenter61 horizontalCenter: parent.horizontalCenter
6262
=== modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml'
--- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-05-13 08:00:18 +0000
+++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-07-18 18:17:44 +0000
@@ -55,12 +55,13 @@
55 // caretItem55 // caretItem
56 Image {56 Image {
57 id: caretItem57 id: caretItem
58 source: "artwork/teardrop-right.png"58 source: "artwork/caret_noshadow.png"
59 anchors {59 anchors {
60 top: parent.bottom60 bottom: parent.top
61 horizontalCenter: parent.horizontalCenter61 horizontalCenter: parent.horizontalCenter
62 topMargin: -units.gu(0.5)62 topMargin: -units.gu(0.5)
63 horizontalCenterOffset: LayoutMirroring.enabled ? -(units.gu(0.7) - caretItem.width) : -units.gu(0.7)63 horizontalCenterOffset: LayoutMirroring.enabled ? -(units.gu(0.7) - caretItem.width) : -units.gu(0.7)
64 }64 }
65 rotation: 180
65 }66 }
66}67}
6768
=== added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png'
68Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2014-07-18 18:17:44 +0000 differ69Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 1970-01-01 00:00:00 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png 2014-07-18 18:17:44 +0000 differ
=== removed file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png'
69Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 1970-01-01 00:00:00 +0000 differ70Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png'
70Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 1970-01-01 00:00:00 +0000 differ71Binary files modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 2014-04-25 08:18:46 +0000 and modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png 1970-01-01 00:00:00 +0000 differ
=== modified file 'modules/Ubuntu/Components/Themes/PaletteValues.qml'
--- modules/Ubuntu/Components/Themes/PaletteValues.qml 2013-07-05 16:04:07 +0000
+++ modules/Ubuntu/Components/Themes/PaletteValues.qml 2014-07-18 18:17:44 +0000
@@ -69,4 +69,8 @@
69 Typically used for labels and images.69 Typically used for labels and images.
70 */70 */
71 property color fieldText71 property color fieldText
72 /*!
73 Color applied to selected text in editable components.
74 */
75 property color selection
72}76}
7377
=== modified file 'modules/Ubuntu/Components/Themes/SuruDark/Palette.qml'
--- modules/Ubuntu/Components/Themes/SuruDark/Palette.qml 2013-07-05 14:34:00 +0000
+++ modules/Ubuntu/Components/Themes/SuruDark/Palette.qml 2014-07-18 18:17:44 +0000
@@ -15,6 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.1
18import Ubuntu.Components.Themes 0.119import Ubuntu.Components.Themes 0.1
1920
20Palette {21Palette {
@@ -33,8 +34,9 @@
33 selected: PaletteValues {34 selected: PaletteValues {
34 background: "#88D6D6D6" // FIXME: not from design35 background: "#88D6D6D6" // FIXME: not from design
35 backgroundText: "#F3F3E7"36 backgroundText: "#F3F3E7"
36 foreground: "#DD4814"37 selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.2)
37 foregroundText: "#F3F3E7"38 foreground: UbuntuColors.blue
39 foregroundText: UbuntuColors.darkGrey
38 field: "#FFFFFF"40 field: "#FFFFFF"
39 fieldText: "#888888"41 fieldText: "#888888"
40 }42 }
4143
=== modified file 'modules/Ubuntu/Components/deployment.pri'
--- modules/Ubuntu/Components/deployment.pri 2014-04-29 05:39:04 +0000
+++ modules/Ubuntu/Components/deployment.pri 2014-07-18 18:17:44 +0000
@@ -52,6 +52,6 @@
52# Silence spam on stderr due to fonts52# Silence spam on stderr due to fonts
53# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/125699953# https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
54# https://bugreports.qt-project.org/browse/QTBUG-3624354# https://bugreports.qt-project.org/browse/QTBUG-36243
55plugins_qmltypes.extra = $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable Ubuntu.Components 0.1 ../../ 2>/dev/null > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes55plugins_qmltypes.extra = ALARM_BACKEND=memory $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable Ubuntu.Components 0.1 ../../ 2>/dev/null > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes
5656
57INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_artwork_files popups_files picker_files styles_files plugins_qmltypes57INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_artwork_files popups_files picker_files styles_files plugins_qmltypes
5858
=== modified file 'modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp'
--- modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-04-17 14:05:49 +0000
+++ modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-07-18 18:17:44 +0000
@@ -57,17 +57,14 @@
57 , fetchRequest(0)57 , fetchRequest(0)
58{58{
59 QString envManager(qgetenv("ALARM_BACKEND"));59 QString envManager(qgetenv("ALARM_BACKEND"));
60 if (!envManager.isEmpty() && QOrganizerManager::availableManagers().contains(envManager)) {60 if (envManager.isEmpty())
61 manager = new QOrganizerManager(envManager);61 envManager = ALARM_MANAGER;
62 } else {62 if (!QOrganizerManager::availableManagers().contains(envManager)) {
63 manager = QOrganizerManager::availableManagers().contains(ALARM_MANAGER) ?63 qWarning() << "WARNING: alarm manager" << envManager << "not installed, using" << QString(ALARM_MANAGER_FALLBACK);
64 new QOrganizerManager(ALARM_MANAGER) : new QOrganizerManager(ALARM_MANAGER_FALLBACK);64 envManager = ALARM_MANAGER_FALLBACK;
65 }65 }
66 manager = new QOrganizerManager(envManager);
66 manager->setParent(q_ptr);67 manager->setParent(q_ptr);
67 if (manager->managerName() != ALARM_MANAGER) {
68 qWarning() << "WARNING: default alarm manager not installed, using" << manager->managerName() << "manager.";
69 qWarning() << "This manager may not provide all the needed features.";
70 }
7168
72 QList<QOrganizerCollection> collections = manager->collections();69 QList<QOrganizerCollection> collections = manager->collections();
73 if (collections.count() > 0) {70 if (collections.count() > 0) {
7471
=== modified file 'modules/Ubuntu/Components/plugin/plugin.cpp'
--- modules/Ubuntu/Components/plugin/plugin.cpp 2014-06-10 11:47:09 +0000
+++ modules/Ubuntu/Components/plugin/plugin.cpp 2014-07-18 18:17:44 +0000
@@ -92,7 +92,14 @@
92 return uriHandler;92 return uriHandler;
93}93}
9494
95static QObject *registerUbuntuColors(QQmlEngine *engine, QJSEngine *scriptEngine)95static QObject *registerUbuntuColors10(QQmlEngine *engine, QJSEngine *scriptEngine)
96{
97 Q_UNUSED(scriptEngine)
98 return UbuntuComponentsPlugin::registerQmlSingletonType(engine,
99 "Ubuntu.Components", "Colors/UbuntuColors10.qml");
100}
101
102static QObject *registerUbuntuColors11(QQmlEngine *engine, QJSEngine *scriptEngine)
96{103{
97 Q_UNUSED(scriptEngine)104 Q_UNUSED(scriptEngine)
98 return UbuntuComponentsPlugin::registerQmlSingletonType(engine,105 return UbuntuComponentsPlugin::registerQmlSingletonType(engine,
@@ -154,7 +161,7 @@
154161
155void UbuntuComponentsPlugin::registerTypesToVersion(const char *uri, int major, int minor)162void UbuntuComponentsPlugin::registerTypesToVersion(const char *uri, int major, int minor)
156{163{
157 qmlRegisterSingletonType<QObject>(uri, major, minor, "UbuntuColors", registerUbuntuColors);164 qmlRegisterSingletonType<QObject>(uri, major, minor, "UbuntuColors", registerUbuntuColors10);
158 qmlRegisterUncreatableType<UbuntuI18n>(uri, major, minor, "i18n", "Singleton object");165 qmlRegisterUncreatableType<UbuntuI18n>(uri, major, minor, "i18n", "Singleton object");
159 qmlRegisterExtendedType<QQuickImageBase, UCQQuickImageExtension>(uri, major, minor, "QQuickImageBase");166 qmlRegisterExtendedType<QQuickImageBase, UCQQuickImageExtension>(uri, major, minor, "QQuickImageBase");
160 qmlRegisterUncreatableType<UCUnits>(uri, major, minor, "UCUnits", "Not instantiable");167 qmlRegisterUncreatableType<UCUnits>(uri, major, minor, "UCUnits", "Not instantiable");
@@ -184,6 +191,7 @@
184 // register 0.1 for backward compatibility191 // register 0.1 for backward compatibility
185 registerTypesToVersion(uri, 0, 1);192 registerTypesToVersion(uri, 0, 1);
186 registerTypesToVersion(uri, 1, 0);193 registerTypesToVersion(uri, 1, 0);
194 qmlRegisterSingletonType<QObject>(uri, 1, 1, "UbuntuColors", registerUbuntuColors11);
187195
188 // register custom event196 // register custom event
189 ForwardedEvent::registerForwardedEvent();197 ForwardedEvent::registerForwardedEvent();
190198
=== modified file 'modules/Ubuntu/Components/qmldir'
--- modules/Ubuntu/Components/qmldir 2014-07-03 13:59:52 +0000
+++ modules/Ubuntu/Components/qmldir 2014-07-18 18:17:44 +0000
@@ -15,7 +15,7 @@
15Label 0.1 Label.qml15Label 0.1 Label.qml
16AbstractButton 0.1 AbstractButton.qml16AbstractButton 0.1 AbstractButton.qml
17ActivityIndicator 0.1 ActivityIndicator.qml17ActivityIndicator 0.1 ActivityIndicator.qml
18ProgressBar 0.1 ProgressBar.qml18ProgressBar 0.1 ProgressBar10.qml
19TextField 0.1 TextField.qml19TextField 0.1 TextField.qml
20TextArea 0.1 TextArea.qml20TextArea 0.1 TextArea.qml
21Switch 0.1 Switch.qml21Switch 0.1 Switch.qml
@@ -65,7 +65,7 @@
65Label 1.0 Label.qml65Label 1.0 Label.qml
66AbstractButton 1.0 AbstractButton.qml66AbstractButton 1.0 AbstractButton.qml
67ActivityIndicator 1.0 ActivityIndicator.qml67ActivityIndicator 1.0 ActivityIndicator.qml
68ProgressBar 1.0 ProgressBar.qml68ProgressBar 1.0 ProgressBar10.qml
69TextField 1.0 TextField.qml69TextField 1.0 TextField.qml
70TextArea 1.0 TextArea.qml70TextArea 1.0 TextArea.qml
71Switch 1.0 Switch.qml71Switch 1.0 Switch.qml
@@ -93,6 +93,7 @@
9393
94#version 1.194#version 1.1
95ComboButton 1.1 ComboButton.qml95ComboButton 1.1 ComboButton.qml
96ProgressBar 1.1 ProgressBar11.qml
96CrossFadeImage 1.1 CrossFadeImage11.qml97CrossFadeImage 1.1 CrossFadeImage11.qml
97PullToRefresh 1.1 PullToRefresh.qml98PullToRefresh 1.1 PullToRefresh.qml
98UbuntuListView 1.1 UbuntuListView11.qml99UbuntuListView 1.1 UbuntuListView11.qml
99100
=== modified file 'modules/Ubuntu/Test/UbuntuTestCase.qml'
--- modules/Ubuntu/Test/UbuntuTestCase.qml 2014-06-19 08:15:49 +0000
+++ modules/Ubuntu/Test/UbuntuTestCase.qml 2014-07-18 18:17:44 +0000
@@ -223,5 +223,14 @@
223 throw new Error("QtQuickTest::fail")223 throw new Error("QtQuickTest::fail")
224 }224 }
225 }225 }
226} 226
227 /*!
228 Convenience function to allow typing a full string instead of single characters
229 */
230 function typeString(string) {
231 for (var i = 0; i < string.length; i++) {
232 keyClick(string[i]);
233 }
234 }
235}
227236
228237
=== modified file 'tests/autopilot/ubuntuuitoolkit/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/__init__.py 2014-06-30 10:49:51 +0000
+++ tests/autopilot/ubuntuuitoolkit/__init__.py 2014-07-18 18:17:44 +0000
@@ -41,6 +41,7 @@
41 'TextField',41 'TextField',
42 'Toolbar',42 'Toolbar',
43 'ToolkitException',43 'ToolkitException',
44 'ubuntu_scenarios',
44 'UbuntuListView11',45 'UbuntuListView11',
45 'UbuntuUIToolkitCustomProxyObjectBase',46 'UbuntuUIToolkitCustomProxyObjectBase',
46]47]
@@ -52,6 +53,7 @@
52 environment,53 environment,
53 fixture_setup,54 fixture_setup,
54 tests,55 tests,
56 ubuntu_scenarios
55)57)
56from ubuntuuitoolkit._custom_proxy_objects import (58from ubuntuuitoolkit._custom_proxy_objects import (
57 AppHeader,59 AppHeader,
5860
=== modified file 'tests/autopilot/ubuntuuitoolkit/base.py'
--- tests/autopilot/ubuntuuitoolkit/base.py 2014-01-14 00:44:05 +0000
+++ tests/autopilot/ubuntuuitoolkit/base.py 2014-07-18 18:17:44 +0000
@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Copyright (C) 2013 Canonical Ltd.3# Copyright (C) 2013, 2014 Canonical Ltd.
4#4#
5# This program is free software; you can redistribute it and/or modify5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
@@ -16,6 +16,7 @@
1616
17"""Base classes for Autopilot tests using the Ubuntu UI Toolkit."""17"""Base classes for Autopilot tests using the Ubuntu UI Toolkit."""
1818
19import os
19import subprocess20import subprocess
2021
21from autopilot import (22from autopilot import (
@@ -25,14 +26,21 @@
25)26)
2627
2728
29def get_host_multiarch():
30 if 'deb_host_multiarch' not in os.environ:
31 # Discard errors: the one known message is "GCC not installed"
32 os.environ['deb_host_multiarch'] = subprocess.check_output(
33 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
34 universal_newlines=True, stderr=subprocess.PIPE).strip()
35 return os.environ['deb_host_multiarch']
36
37
28def get_qmlscene_launch_command():38def get_qmlscene_launch_command():
29 """Return the command to launch qmlscene for autopilot tests."""39 """Return the command to launch qmlscene for autopilot tests."""
30 # We need to specify qt5 because qtchooser doesn't have a default40 # We need to specify qt5 because qtchooser doesn't have a default
31 # configuration on devices and it seems the environment variable41 # configuration on devices and it seems the environment variable
32 # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-0342 # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-03
33 arch = subprocess.check_output(43 arch = get_host_multiarch()
34 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
35 universal_newlines=True).strip()
36 return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch)44 return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch)
3745
3846
3947
=== modified file 'tests/autopilot/ubuntuuitoolkit/fixture_setup.py'
--- tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-05-26 06:40:24 +0000
+++ tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-07-18 18:17:44 +0000
@@ -15,11 +15,14 @@
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 copy17import copy
18import logging
18import os19import os
19import shutil20import shutil
20import tempfile21import tempfile
2122
22import fixtures23import fixtures
24from autopilot import display
25from gi.repository import Gio
2326
24from ubuntuuitoolkit import base, environment27from ubuntuuitoolkit import base, environment
2528
@@ -46,6 +49,9 @@
46}49}
4750
4851
52logger = logging.getLogger(__name__)
53
54
49class FakeApplication(fixtures.Fixture):55class FakeApplication(fixtures.Fixture):
5056
51 def __init__(57 def __init__(
@@ -163,3 +169,82 @@
163 shutil.copyfile(169 shutil.copyfile(
164 xauthority_file_path,170 xauthority_file_path,
165 os.path.join(directory, '.Xauthority'))171 os.path.join(directory, '.Xauthority'))
172
173
174class HideUnity7Launcher(fixtures.Fixture):
175
176 """Hide the Unity7 launcher if it is visible and restore it on clean up."""
177
178 _UNITYSHELL_GSETTINGS_SCHEMA = 'org.compiz.unityshell'
179 _UNITYSHELL_GSETTINGS_PATH = (
180 '/org/compiz/profiles/unity/plugins/unityshell/')
181 _UNITYSHELL_LAUNCHER_KEY = 'launcher-hide-mode'
182 _UNITYSHELL_LAUNCHER_HIDDEN_MODE = 1 # launcher hidden
183
184 def setUp(self):
185 super(HideUnity7Launcher, self).setUp()
186 self._hide_launcher()
187
188 def _hide_launcher(self):
189 if (self._UNITYSHELL_GSETTINGS_SCHEMA in
190 Gio.Settings.list_relocatable_schemas()):
191 unityshell_schema = Gio.Settings.new_with_path(
192 self._UNITYSHELL_GSETTINGS_SCHEMA,
193 self._UNITYSHELL_GSETTINGS_PATH)
194 self._hide_launcher_from_schema(unityshell_schema)
195 else:
196 logger.warning('Unity Shell gsettings schema not found.')
197
198 def _hide_launcher_from_schema(self, unityshell_schema):
199 original_mode = self._get_launcher_mode(unityshell_schema)
200 self.addCleanup(
201 self._set_launcher_mode, unityshell_schema, original_mode)
202 self._set_launcher_mode(
203 unityshell_schema, self._UNITYSHELL_LAUNCHER_HIDDEN_MODE)
204
205 def _get_launcher_mode(self, unityshell_schema):
206 return unityshell_schema.get_int(self._UNITYSHELL_LAUNCHER_KEY)
207
208 def _set_launcher_mode(self, unityshell_schema, mode):
209 unityshell_schema.set_int(self._UNITYSHELL_LAUNCHER_KEY, mode)
210
211
212class SimulateDevice(fixtures.Fixture):
213
214 def __init__(self, app_width, app_height, grid_unit_px):
215 super(SimulateDevice, self).__init__()
216 self.app_width = app_width
217 self.app_height = app_height
218 self.grid_unit_px = grid_unit_px
219 self._screen = None
220
221 def setUp(self):
222 super(SimulateDevice, self).setUp()
223 if self._is_geometry_larger_than_display(
224 self.app_width, self.app_height):
225 scale_divisor = self._get_scale_divisor()
226 self.grid_unit_px = self.grid_unit_px // scale_divisor
227 self.app_width = self.app_width // scale_divisor
228 self.app_height = self.app_height // scale_divisor
229 self.useFixture(
230 fixtures.EnvironmentVariable(
231 'GRID_UNIT_PX', str(self.grid_unit_px)))
232
233 def _get_scale_divisor(self):
234 scale_divisor = 2
235 while self._is_geometry_larger_than_display(
236 self.app_width // scale_divisor,
237 self.app_height // scale_divisor):
238 scale_divisor = scale_divisor * 2
239 return scale_divisor
240
241 def _is_geometry_larger_than_display(self, width, height):
242 screen = self._get_screen()
243 screen_width = screen.get_screen_width()
244 screen_height = screen.get_screen_height()
245 return (width > screen_width) or (height > screen_height)
246
247 def _get_screen(self):
248 if self._screen is None:
249 self._screen = display.Display.create()
250 return self._screen
166251
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-06-16 12:07:41 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-07-18 18:17:44 +0000
@@ -60,8 +60,8 @@
60 os.path.dirname(__file__), '..', '..', '..', '..'))60 os.path.dirname(__file__), '..', '..', '..', '..'))
6161
6262
63class QMLStringAppTestCase(base.UbuntuUIToolkitAppTestCase):63class UbuntuUIToolkitWithFakeAppRunningTestCase(
64 """Base test case for self tests that define the QML on an string."""64 base.UbuntuUIToolkitAppTestCase):
6565
66 test_qml = ("""66 test_qml = ("""
67import QtQuick 2.067import QtQuick 2.0
@@ -69,13 +69,12 @@
6969
70MainView {70MainView {
71 width: units.gu(48)71 width: units.gu(48)
72 height: units.gu(60)72 height: units.gu(80)
73}73}
74""")74""")
7575
76 def setUp(self):76 def setUp(self):
77 super(QMLStringAppTestCase, self).setUp()77 super(UbuntuUIToolkitWithFakeAppRunningTestCase, self).setUp()
78 self.pointing_device = Pointer(self.input_device_class.create())
79 self.launch_application()78 self.launch_application()
8079
81 def launch_application(self):80 def launch_application(self):
@@ -83,18 +82,24 @@
83 qml_file_contents=self.test_qml)82 qml_file_contents=self.test_qml)
84 self.useFixture(fake_application)83 self.useFixture(fake_application)
8584
86 self.app = self.launch_test_application(85 desktop_file_name = os.path.basename(
87 base.get_qmlscene_launch_command(),86 fake_application.desktop_file_path)
88 '-I' + _get_module_include_path(),87 application_name, _ = os.path.splitext(desktop_file_name)
89 fake_application.qml_file_path,88 self.app = self.launch_upstart_application(
90 '--desktop_file_hint={0}'.format(89 application_name,
91 fake_application.desktop_file_path),90 emulator_base=emulators.UbuntuUIToolkitEmulatorBase)
92 emulator_base=emulators.UbuntuUIToolkitEmulatorBase,91
93 app_type='qt')92
9493class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase):
94 """Base test case for self tests that define the QML on an string."""
95
96 def setUp(self):
97 super(QMLStringAppTestCase, self).setUp()
95 self.assertThat(98 self.assertThat(
96 self.main_view.visible, Eventually(Equals(True)))99 self.main_view.visible, Eventually(Equals(True)))
97100
101 self.pointing_device = Pointer(self.input_device_class.create())
102
98 @property103 @property
99 def main_view(self):104 def main_view(self):
100 return self.app.select_single(emulators.MainView)105 return self.app.select_single(emulators.MainView)
101106
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py'
--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-06-17 07:12:49 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-07-18 18:17:44 +0000
@@ -15,7 +15,6 @@
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 os17import os
18import subprocess
1918
20import testtools19import testtools
21import ubuntuuitoolkit20import ubuntuuitoolkit
@@ -207,9 +206,7 @@
207 if os.path.exists(path_to_local_launcher):206 if os.path.exists(path_to_local_launcher):
208 return path_to_local_launcher207 return path_to_local_launcher
209 else:208 else:
210 arch = subprocess.check_output(209 arch = ubuntuuitoolkit.base.get_host_multiarch()
211 ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
212 universal_newlines=True).strip()
213 path_to_installed_launcher = os.path.join(210 path_to_installed_launcher = os.path.join(
214 '/', 'usr', 'lib', arch, 'ubuntu-ui-toolkit', 'launcher')211 '/', 'usr', 'lib', arch, 'ubuntu-ui-toolkit', 'launcher')
215 return path_to_installed_launcher212 return path_to_installed_launcher
216213
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2014-06-04 18:45:04 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2014-07-18 18:17:44 +0000
@@ -19,24 +19,71 @@
19import os19import os
20import shutil20import shutil
2121
22from autopilot.matchers import Eventually
23from testtools.matchers import Equals
24
22import ubuntuuitoolkit25import ubuntuuitoolkit
26from ubuntuuitoolkit import fixture_setup
2327
2428
25class GalleryTestCase(ubuntuuitoolkit.tests.QMLFileAppTestCase):29class GalleryTestCase(ubuntuuitoolkit.tests.QMLFileAppTestCase):
30
26 """Base class for gallery test cases."""31 """Base class for gallery test cases."""
2732
28 local_desktop_file_path = None33 local_desktop_file_path = None
2934
30 def setUp(self):35 def setUp(self):
31 if self._application_source_exists():36 self.test_source_path = self._get_test_source_path()
32 self.test_source_path = self._get_path_to_gallery_source()
33 else:
34 self.test_source_path = self._get_path_to_installed_gallery()
35 assert os.path.exists(self.test_source_path)
36 self.test_qml_file_path = self._get_test_qml_file_path()37 self.test_qml_file_path = self._get_test_qml_file_path()
37 self.desktop_file_path = self._get_desktop_file_path()38 self.desktop_file_path = self._get_desktop_file_path()
39
40 if self.should_simulate_device():
41 # Hide the Unity7 launcher because it takes space that might be
42 # needed by the app with the simulated size.
43 self.useFixture(fixture_setup.HideUnity7Launcher())
44 # This sets the grid units, so it should be called before launching
45 # the app.
46 self.simulate_device()
47
38 super(GalleryTestCase, self).setUp()48 super(GalleryTestCase, self).setUp()
3949
50 if self.should_simulate_device():
51 # XXX Currently we have no way to launch the application with a
52 # specific size, so we must resize it after it's launched.
53 # --elopio - 2014-06-25
54 self.resize_window()
55
56 def should_simulate_device(self):
57 return (hasattr(self, 'app_width') and hasattr(self, 'app_height') and
58 hasattr(self, 'grid_unit_px'))
59
60 def simulate_device(self):
61 simulate_device_fixture = self.useFixture(fixture_setup.SimulateDevice(
62 self.app_width, self.app_height, self.grid_unit_px))
63 self.app_width = simulate_device_fixture.app_width
64 self.app_height = simulate_device_fixture.app_height
65
66 def resize_window(self):
67 application = self.process_manager.get_running_applications()[0]
68 window = application.get_windows()[0]
69 window.resize(self.app_width, self.app_height)
70
71 def get_window_size():
72 _, _, window_width, window_height = window.geometry
73 return window_width, window_height
74
75 self.assertThat(
76 get_window_size,
77 Eventually(Equals((self.app_width, self.app_height))))
78
79 def _get_test_source_path(self):
80 if self._application_source_exists():
81 test_source_path = self._get_path_to_gallery_source()
82 else:
83 test_source_path = self._get_path_to_installed_gallery()
84 assert os.path.exists(test_source_path)
85 return test_source_path
86
40 def _get_path_to_gallery_source(self):87 def _get_path_to_gallery_source(self):
41 return os.path.join(88 return os.path.join(
42 ubuntuuitoolkit.tests.get_path_to_source_root(), 'examples',89 ubuntuuitoolkit.tests.get_path_to_source_root(), 'examples',
4390
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-07-18 18:17:44 +0000
@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Copyright (C) 2012, 2013 Canonical Ltd.3# Copyright (C) 2012, 2013, 2014 Canonical Ltd.
4#4#
5# This program is free software; you can redistribute it and/or modify5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
@@ -16,14 +16,19 @@
1616
17"""Tests for the Ubuntu UI Toolkit Gallery - Button component"""17"""Tests for the Ubuntu UI Toolkit Gallery - Button component"""
1818
19import testscenarios
19from autopilot.matchers import Eventually20from autopilot.matchers import Eventually
20from testtools.matchers import Equals21from testtools.matchers import Equals
21from ubuntuuitoolkit.tests.gallery import GalleryTestCase22
2223from ubuntuuitoolkit import ubuntu_scenarios
2324from ubuntuuitoolkit.tests import gallery
24class ButtonsTestCase(GalleryTestCase):25
2526import os
26 scenarios = [27
28
29class ButtonsTestCase(gallery.GalleryTestCase):
30
31 buttons_scenarios = [
27 ('standard button', dict(32 ('standard button', dict(
28 button_name="button_text", is_enabled=True, color=None, icon=None,33 button_name="button_text", is_enabled=True, color=None, icon=None,
29 text="Call")),34 text="Call")),
@@ -44,6 +49,15 @@
44 icon=None, text="Call"))49 icon=None, text="Call"))
45 ]50 ]
4651
52 scenarios = testscenarios.multiply_scenarios(
53 ubuntu_scenarios.get_device_simulation_scenarios(),
54 buttons_scenarios)
55
56 def setUp(self):
57 # Reset the locale to English
58 os.environ['LANGUAGE'] = 'en'
59 super(ButtonsTestCase, self).setUp()
60
47 def test_buttons(self):61 def test_buttons(self):
48 self.open_page('buttonsElement')62 self.open_page('buttonsElement')
4963
5064
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-06-18 05:35:24 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-07-18 18:17:44 +0000
@@ -16,13 +16,18 @@
1616
17"""Tests for the Ubuntu UI Toolkit Gallery"""17"""Tests for the Ubuntu UI Toolkit Gallery"""
1818
19import testscenarios
20
19import ubuntuuitoolkit21import ubuntuuitoolkit
22from ubuntuuitoolkit import ubuntu_scenarios
20from ubuntuuitoolkit.tests import gallery23from ubuntuuitoolkit.tests import gallery
2124
2225
23class GalleryAppTestCase(gallery.GalleryTestCase):26class GalleryAppTestCase(gallery.GalleryTestCase):
24 """Generic tests for the Gallery"""27 """Generic tests for the Gallery"""
2528
29 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
30
26 def test_select_main_view_must_return_main_window_emulator(self):31 def test_select_main_view_must_return_main_window_emulator(self):
27 main_view = self.main_view32 main_view = self.main_view
28 self.assertIsInstance(main_view, ubuntuuitoolkit.MainView)33 self.assertIsInstance(main_view, ubuntuuitoolkit.MainView)
@@ -91,13 +96,17 @@
91 'sheets', 'animations'96 'sheets', 'animations'
92 ]97 ]
9398
94 scenarios = [99 pages_scenarios = [
95 (name, dict(100 (name, dict(
96 element_name=name+'Element',101 element_name=name+'Element',
97 template_name=name+'Template'))102 template_name=name+'Template'))
98 for name in names103 for name in names
99 ]104 ]
100105
106 scenarios = testscenarios.multiply_scenarios(
107 ubuntu_scenarios.get_device_simulation_scenarios(),
108 pages_scenarios)
109
101 def test_open_page(self):110 def test_open_page(self):
102 self.open_page(self.element_name)111 self.open_page(self.element_name)
103 element = self.main_view.select_single(112 element = self.main_view.select_single(
104113
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-07-18 18:17:44 +0000
@@ -17,14 +17,20 @@
17"""Tests for the Ubuntu UI Toolkit Gallery - OptionSelector component."""17"""Tests for the Ubuntu UI Toolkit Gallery - OptionSelector component."""
1818
19import ubuntuuitoolkit19import ubuntuuitoolkit
20from ubuntuuitoolkit import ubuntu_scenarios
20from ubuntuuitoolkit.tests.gallery import GalleryTestCase21from ubuntuuitoolkit.tests.gallery import GalleryTestCase
2122
2223
23class OptionSelectorTestCase(GalleryTestCase):24class OptionSelectorTestCase(GalleryTestCase):
2425
26 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
27
25 def setUp(self):28 def setUp(self):
26 super(OptionSelectorTestCase, self).setUp()29 super(OptionSelectorTestCase, self).setUp()
27 self.open_page('optionSelectorsElement')30 self.open_page('optionSelectorsElement')
31 # Start with the toolbar closed to make the full page visible and be
32 # able to swipe it.
33 self.main_view.close_toolbar()
2834
29 def test_select_option_from_collapsed_optionselector(self):35 def test_select_option_from_collapsed_optionselector(self):
30 collapsed_option_selector = self.main_view.select_single(36 collapsed_option_selector = self.main_view.select_single(
3137
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py 2014-06-09 17:20:43 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py 2014-07-18 18:17:44 +0000
@@ -16,11 +16,14 @@
1616
17from autopilot import platform17from autopilot import platform
1818
19from ubuntuuitoolkit import ubuntu_scenarios
19from ubuntuuitoolkit.tests import gallery20from ubuntuuitoolkit.tests import gallery
2021
2122
22class ScrollBarTestCase(gallery.GalleryTestCase):23class ScrollBarTestCase(gallery.GalleryTestCase):
2324
25 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
26
24 def setUp(self):27 def setUp(self):
25 super(ScrollBarTestCase, self).setUp()28 super(ScrollBarTestCase, self).setUp()
26 self.open_page('navigationElement')29 self.open_page('navigationElement')
@@ -30,9 +33,12 @@
30 def move_mouse_to_thumb(self):33 def move_mouse_to_thumb(self):
31 # TODO we need a helper to move the interactive thumb.34 # TODO we need a helper to move the interactive thumb.
32 # --elopio 2014-05-0635 # --elopio 2014-05-06
33 thumb = self.scrollbar.select_single(36 thumb = self.get_mouse_thumb()
37 self.pointing_device.move_to_object(thumb)
38
39 def get_mouse_thumb(self):
40 return self.scrollbar.select_single(
34 objectName='interactiveScrollbarThumb')41 objectName='interactiveScrollbarThumb')
35 self.pointing_device.move_to_object(thumb)
3642
37 def test_scrollbar_must_start_without_interactive_thumb(self):43 def test_scrollbar_must_start_without_interactive_thumb(self):
38 self.assertEqual(self.scrollbar.interactive, False)44 self.assertEqual(self.scrollbar.interactive, False)
@@ -57,7 +63,12 @@
57 self.assertEqual(flickable.is_child_visible(bottom_section), False)63 self.assertEqual(flickable.is_child_visible(bottom_section), False)
5864
59 self.move_mouse_to_thumb()65 self.move_mouse_to_thumb()
60 x, y = self.pointing_device.position()66 mouse_thumb = self.get_mouse_thumb()
61 self.pointing_device.drag(x, y, x, self.main_view.height)67 x, y, width, height = mouse_thumb.globalRect
68 start_x = stop_x = x + (width // 2)
69 start_y = y + (height // 0.8)
70
71 self.pointing_device.drag(
72 start_x, start_y, stop_x, self.main_view.height)
6273
63 self.assertEqual(flickable.is_child_visible(bottom_section), True)74 self.assertEqual(flickable.is_child_visible(bottom_section), True)
6475
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-07-18 18:17:44 +0000
@@ -16,7 +16,9 @@
1616
17"""Tests for the Ubuntu UI Toolkit Gallery - TextInput components"""17"""Tests for the Ubuntu UI Toolkit Gallery - TextInput components"""
1818
19from ubuntuuitoolkit import emulators19import testscenarios
20
21from ubuntuuitoolkit import emulators, ubuntu_scenarios
20from ubuntuuitoolkit.tests.gallery import GalleryTestCase22from ubuntuuitoolkit.tests.gallery import GalleryTestCase
21import locale23import locale
2224
@@ -31,7 +33,7 @@
3133
32 # text_to_write is a function to ensure34 # text_to_write is a function to ensure
33 # that locale is evaluated after setUp35 # that locale is evaluated after setUp
34 scenarios = [36 text_input_scenarios = [
35 ('standard textfield', dict(37 ('standard textfield', dict(
36 objectName='textfield_standard',38 objectName='textfield_standard',
37 text_to_write=text_to_write_string,39 text_to_write=text_to_write_string,
@@ -49,6 +51,10 @@
49 expected_text='-100123'))51 expected_text='-100123'))
50 ]52 ]
5153
54 scenarios = testscenarios.multiply_scenarios(
55 ubuntu_scenarios.get_device_simulation_scenarios(),
56 text_input_scenarios)
57
52 def setUp(self):58 def setUp(self):
53 super(WriteAndClearTextInputTestCase, self).setUp()59 super(WriteAndClearTextInputTestCase, self).setUp()
54 # Apply the user locale from the environment60 # Apply the user locale from the environment
@@ -74,6 +80,8 @@
7480
75class DisabledTextInputTestCase(GalleryTestCase):81class DisabledTextInputTestCase(GalleryTestCase):
7682
83 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
84
77 def setUp(self):85 def setUp(self):
78 super(DisabledTextInputTestCase, self).setUp()86 super(DisabledTextInputTestCase, self).setUp()
79 self.open_page('textinputsElement')87 self.open_page('textinputsElement')
8088
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py'
--- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2014-05-30 14:24:27 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2014-07-18 18:17:44 +0000
@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Copyright (C) 2012, 2013 Canonical Ltd.3# Copyright (C) 2012, 2013, 2014 Canonical Ltd.
4#4#
5# This program is free software; you can redistribute it and/or modify5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by6# it under the terms of the GNU Lesser General Public License as published by
@@ -14,15 +14,17 @@
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
17from ubuntuuitoolkit import emulators17import testscenarios
18
19from testtools.matchers import Equals
20
21from ubuntuuitoolkit import emulators, ubuntu_scenarios
18from ubuntuuitoolkit.tests import gallery22from ubuntuuitoolkit.tests import gallery
1923
20from testtools.matchers import Equals
21
2224
23class EnabledTogglesTestCase(gallery.GalleryTestCase):25class EnabledTogglesTestCase(gallery.GalleryTestCase):
2426
25 scenarios = [27 toggles_scenarios = [
26 ('checkbox unchecked', dict(28 ('checkbox unchecked', dict(
27 object_name='checkbox_unchecked', initial_state=False)),29 object_name='checkbox_unchecked', initial_state=False)),
28 ('checkbox checked', dict(30 ('checkbox checked', dict(
@@ -33,6 +35,10 @@
33 object_name='switch_checked', initial_state=True))35 object_name='switch_checked', initial_state=True))
34 ]36 ]
3537
38 scenarios = testscenarios.multiply_scenarios(
39 ubuntu_scenarios.get_device_simulation_scenarios(),
40 toggles_scenarios)
41
36 def setUp(self):42 def setUp(self):
37 super(EnabledTogglesTestCase, self).setUp()43 super(EnabledTogglesTestCase, self).setUp()
38 self.open_page('togglesElement')44 self.open_page('togglesElement')
@@ -49,7 +55,7 @@
4955
50class DisabledTogglesTestCase(gallery.GalleryTestCase):56class DisabledTogglesTestCase(gallery.GalleryTestCase):
5157
52 scenarios = [58 toggles_scenarios = [
53 ('checkbox disabled unchecked', dict(59 ('checkbox disabled unchecked', dict(
54 object_name='checkbox_disabled_unchecked', initial_state=False)),60 object_name='checkbox_disabled_unchecked', initial_state=False)),
55 ('checkbox disabled checked', dict(61 ('checkbox disabled checked', dict(
@@ -60,6 +66,10 @@
60 object_name='switch_disabled_checked', initial_state=True))66 object_name='switch_disabled_checked', initial_state=True))
61 ]67 ]
6268
69 scenarios = testscenarios.multiply_scenarios(
70 ubuntu_scenarios.get_device_simulation_scenarios(),
71 toggles_scenarios)
72
63 def setUp(self):73 def setUp(self):
64 super(DisabledTogglesTestCase, self).setUp()74 super(DisabledTogglesTestCase, self).setUp()
65 self.open_page('togglesElement')75 self.open_page('togglesElement')
6676
=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-06-03 20:10:53 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-07-18 18:17:44 +0000
@@ -24,10 +24,15 @@
24 # Python 2 add-on: python-mock.24 # Python 2 add-on: python-mock.
25 import mock25 import mock
26import testtools26import testtools
27from autopilot import testcase as autopilot_testcase27from autopilot import (
28from testtools.matchers import Contains, FileExists, Not28 display,
29 platform,
30 testcase as autopilot_testcase
31)
32from autopilot.matchers import Eventually
33from testtools.matchers import Contains, Equals, FileExists, Not
2934
30from ubuntuuitoolkit import base, environment, fixture_setup35from ubuntuuitoolkit import base, environment, fixture_setup, tests
3136
3237
33class FakeApplicationTestCase(testtools.TestCase):38class FakeApplicationTestCase(testtools.TestCase):
@@ -304,3 +309,99 @@
304 self.assertTrue(309 self.assertTrue(
305 os.path.exists(310 os.path.exists(
306 os.path.join(os.environ.get('HOME'), '.Xauthority')))311 os.path.join(os.environ.get('HOME'), '.Xauthority')))
312
313
314class HideUnity7LauncherTestCase(
315 tests.UbuntuUIToolkitWithFakeAppRunningTestCase):
316
317 def setUp(self):
318 if platform.model() != 'Desktop':
319 self.skipTest('Unity 7 runs only on desktop.')
320 self.useFixture(fixture_setup.HideUnity7Launcher())
321 super(HideUnity7LauncherTestCase, self).setUp()
322
323 def test_maximized_application_must_use_all_screen_width(self):
324 application = self.process_manager.get_running_applications()[0]
325 window = application.get_windows()[0]
326
327 # Maximize window.
328 screen = display.Display.create()
329 screen_width = screen.get_screen_width()
330 screen_height = screen.get_screen_height()
331 window.resize(screen_width, screen_height)
332
333 def get_window_width():
334 _, _, window_width, _ = window.geometry
335 return window_width
336
337 self.assertThat(
338 get_window_width,
339 Eventually(Equals(screen_width)))
340
341
342class FakeDisplay(object):
343
344 """Fake display with fixed widht and height for use in tests."""
345
346 def __init__(self, width, height):
347 super(FakeDisplay, self).__init__()
348 self.width = width
349 self.height = height
350
351 def get_screen_width(self):
352 return self.width
353
354 def get_screen_height(self):
355 return self.height
356
357
358class SimulateDeviceTestCase(autopilot_testcase.AutopilotTestCase):
359
360 scenarios = [
361 ('Device equal to screen', {
362 'device_width': 100, 'device_height': 100, 'device_grid_unit': 20,
363 'screen_width': 100, 'screen_height': 100,
364 'expected_width': 100, 'expected_height': 100,
365 'expected_grid_unit': 20}),
366 ('Device smaller than screen', {
367 'device_width': 100, 'device_height': 90, 'device_grid_unit': 20,
368 'screen_width': 110, 'screen_height': 100,
369 'expected_width': 100, 'expected_height': 90,
370 'expected_grid_unit': 20}),
371 ('Device wider than screen', {
372 'device_width': 200, 'device_height': 90, 'device_grid_unit': 20,
373 'screen_width': 110, 'screen_height': 100,
374 'expected_width': 100, 'expected_height': 45,
375 'expected_grid_unit': 10}),
376 ('Device taller than screen', {
377 'device_width': 100, 'device_height': 180, 'device_grid_unit': 20,
378 'screen_width': 110, 'screen_height': 100,
379 'expected_width': 50, 'expected_height': 90,
380 'expected_grid_unit': 10}),
381 ('Device bigger than screen', {
382 'device_width': 200, 'device_height': 180, 'device_grid_unit': 20,
383 'screen_width': 110, 'screen_height': 100,
384 'expected_width': 100, 'expected_height': 90,
385 'expected_grid_unit': 10}),
386 ]
387
388 def test_simulate_device_fixture_with_size_smaller_than_screen(self):
389 """Test the simulation of a device that fits the screen.
390
391 All the attributes of the fixture must remain the same.
392
393 """
394
395 simulate_device_fixture = fixture_setup.SimulateDevice(
396 self.device_width, self.device_height, self.device_grid_unit)
397 fake_display = FakeDisplay(self.screen_width, self.screen_height)
398 simulate_device_fixture._screen = fake_display
399
400 self.useFixture(simulate_device_fixture)
401
402 self.assertEqual(
403 int(os.environ.get('GRID_UNIT_PX')), self.expected_grid_unit)
404 self.assertEqual(
405 simulate_device_fixture.app_width, self.expected_width)
406 self.assertEqual(
407 simulate_device_fixture.app_height, self.expected_height)
307408
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py 2014-07-18 18:17:44 +0000
@@ -0,0 +1,70 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# 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/>.
16
17try:
18 from unittest import mock
19except ImportError:
20 import mock
21
22import testtools
23
24from ubuntuuitoolkit import ubuntu_scenarios
25
26
27class ScenariosTestCase(testtools.TestCase):
28
29 def test_get_nexus_4_scenario(self):
30 expected_scenarios = [
31 ('Simulating Nexus 4 in desktop',
32 dict(app_width=768, app_height=1280, grid_unit_px=18)),
33 ]
34 with mock.patch('autopilot.platform.model') as mock_model:
35 mock_model.return_value = 'Desktop'
36 scenarios = ubuntu_scenarios.get_device_simulation_scenarios(
37 devices=ubuntu_scenarios.NEXUS4_DEVICE)
38 self.assertEqual(expected_scenarios, scenarios)
39
40 def test_get_nexus_10_scenario(self):
41 expected_scenarios = [
42 ('Simulating Nexus 10 in desktop',
43 dict(app_width=2560, app_height=1600, grid_unit_px=20))
44 ]
45
46 with mock.patch('autopilot.platform.model') as mock_model:
47 mock_model.return_value = 'Desktop'
48 scenarios = ubuntu_scenarios.get_device_simulation_scenarios(
49 devices=ubuntu_scenarios.NEXUS10_DEVICE)
50 self.assertEqual(expected_scenarios, scenarios)
51
52 def test_get_default_scenarios_must_return_supported_devices(self):
53 expected_scenarios = [
54 ('Simulating Nexus 4 in desktop',
55 dict(app_width=768, app_height=1280, grid_unit_px=18)),
56 ('Simulating Nexus 10 in desktop',
57 dict(app_width=2560, app_height=1600, grid_unit_px=20))
58 ]
59
60 with mock.patch('autopilot.platform.model') as mock_model:
61 mock_model.return_value = 'Desktop'
62 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
63 self.assertEqual(expected_scenarios, scenarios)
64
65 def test_get_scenarios_on_device_must_return_no_simulation_scenarios(self):
66 with mock.patch('autopilot.platform.model') as mock_model:
67 mock_model.return_value = 'Not Desktop'
68 scenarios = ubuntu_scenarios.get_device_simulation_scenarios()
69
70 self.assertEqual([('Not Desktop', {})], scenarios)
071
=== added file 'tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py'
--- tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py 2014-07-18 18:17:44 +0000
@@ -0,0 +1,54 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2014 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# 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/>.
16
17from autopilot import platform
18
19
20NEXUS4_DEVICE = 'Nexus4'
21NEXUS10_DEVICE = 'Nexus10'
22DEFAULT_DEVICES = (NEXUS4_DEVICE, NEXUS10_DEVICE)
23
24
25def get_device_simulation_scenarios(devices=DEFAULT_DEVICES):
26 """Return a list of devices to be simulated on tests.
27
28 :param devices: The device or devices to simulate. Default value is all the
29 officially supported devices.
30 :type devices: string or sequence of strings.
31 :return: A list of scenarios to be used with the testscenarios python
32 module, with the values of app_width, app_height and grid_unit
33 corresponding to the selected device.
34
35 """
36 if platform.model() == 'Desktop':
37 return _get_device_simulation_scenarios_for_desktop(devices)
38 else:
39 return [(platform.model(), {})]
40
41
42def _get_device_simulation_scenarios_for_desktop(devices):
43 scenarios = []
44 if NEXUS4_DEVICE in devices:
45 scenarios.append(
46 ('Simulating Nexus 4 in desktop',
47 dict(app_width=768, app_height=1280, grid_unit_px=18))
48 )
49 if NEXUS10_DEVICE in devices:
50 scenarios.append(
51 ('Simulating Nexus 10 in desktop',
52 dict(app_width=2560, app_height=1600, grid_unit_px=20))
53 )
54 return scenarios
055
=== modified file 'tests/qmlapicheck.sh'
--- tests/qmlapicheck.sh 2014-06-19 07:21:53 +0000
+++ tests/qmlapicheck.sh 2014-07-18 18:17:44 +0000
@@ -25,7 +25,7 @@
25 # Silence spam on stderr due to fonts25 # Silence spam on stderr due to fonts
26 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/125699926 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
27 # https://bugreports.qt-project.org/browse/QTBUG-3624327 # https://bugreports.qt-project.org/browse/QTBUG-36243
28 qmlplugindump $i 0.1 modules 1>> plugins.qmltypes28 ALARM_BACKEND=memory qmlplugindump $i 0.1 modules 1>> plugins.qmltypes
29 test $? != 0 && ERRORS=129 test $? != 0 && ERRORS=1
30done30done
31test $ERRORS = 1 && echo Error: qmlplugindump failed && exit 131test $ERRORS = 1 && echo Error: qmlplugindump failed && exit 1
3232
=== modified file 'tests/unit/runtest.sh'
--- tests/unit/runtest.sh 2014-06-16 08:02:48 +0000
+++ tests/unit/runtest.sh 2014-07-18 18:17:44 +0000
@@ -45,6 +45,7 @@
45 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/125699945 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
46 # https://bugreports.qt-project.org/browse/QTBUG-3624346 # https://bugreports.qt-project.org/browse/QTBUG-36243
47 QML2_IMPORT_PATH=../../../modules:$QML2_IMPORT_PATH UBUNTU_UI_TOOLKIT_THEMES_PATH=../../../modules \47 QML2_IMPORT_PATH=../../../modules:$QML2_IMPORT_PATH UBUNTU_UI_TOOLKIT_THEMES_PATH=../../../modules \
48 ALARM_BACKEND=memory \
48 $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'49 $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'
49 # Note: Get first command before the pipe, $? would be ambiguous50 # Note: Get first command before the pipe, $? would be ambiguous
50 RESULT=${PIPESTATUS[0]}51 RESULT=${PIPESTATUS[0]}
5152
=== modified file 'tests/unit/tst_components/tst_progressbar.qml'
--- tests/unit/tst_components/tst_progressbar.qml 2014-04-23 08:50:20 +0000
+++ tests/unit/tst_components/tst_progressbar.qml 2014-07-18 18:17:44 +0000
@@ -16,7 +16,8 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import QtTest 1.018import QtTest 1.0
19import Ubuntu.Components 1.119// Note: See tst_progressbar11.qml for the newer API tests
20import Ubuntu.Components 1.0
2021
21TestCase {22TestCase {
22 name: "ProgressBarAPI"23 name: "ProgressBarAPI"
@@ -28,6 +29,10 @@
28 compare(progressBar.indeterminate,newIndeterminated,"can set/get")29 compare(progressBar.indeterminate,newIndeterminated,"can set/get")
29 }30 }
3031
32 function test_showProgressPercentageExists() {
33 verify(!progressBar.hasOwnProperty("showProgressPercentage"), "Property absent")
34 }
35
31 function test_maximumValue() {36 function test_maximumValue() {
32 compare(progressBar.maximumValue,1.0,"is set to 1.0 by default")37 compare(progressBar.maximumValue,1.0,"is set to 1.0 by default")
33 var newMaximumValue = 20.038 var newMaximumValue = 20.0
3439
=== added file 'tests/unit/tst_components/tst_progressbar11.qml'
--- tests/unit/tst_components/tst_progressbar11.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/tst_components/tst_progressbar11.qml 2014-07-18 18:17:44 +0000
@@ -0,0 +1,38 @@
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 QtTest 1.0
19import Ubuntu.Components 1.1
20
21TestCase {
22 name: "ProgressBarAPI"
23
24 function test_showProgressPercentageExists() {
25 verify(progressBar.hasOwnProperty("showProgressPercentage"), "Property missing")
26 }
27
28 function test_noLabel() {
29 compare(progressBar.showProgressPercentage,true, "is set by default")
30 var newShowProgressPercentage = false
31 progressBar.showProgressPercentage = newShowProgressPercentage
32 compare(progressBar.showProgressPercentage, newShowProgressPercentage, "can set/get")
33 }
34
35 ProgressBar {
36 id: progressBar
37 }
38}
039
=== added file 'tests/unit_x11/tst_components/tst_animator.qml'
--- tests/unit_x11/tst_components/tst_animator.qml 1970-01-01 00:00:00 +0000
+++ tests/unit_x11/tst_components/tst_animator.qml 2014-07-18 18:17:44 +0000
@@ -0,0 +1,75 @@
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
17
18/**
19 * Test to prevent regressions for bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1338602
20 * Activity Indicator crashes in QML/Widget mixed applications
21 */
22
23import QtQuick 2.2
24import QtQuick.Window 2.1
25import QtTest 1.0
26import Ubuntu.Components 1.1
27
28Item {
29 width: 360
30 height: 360
31 Window {
32 id: root
33 width: 360
34 height: 360
35
36 property int timeout: 500
37 property int runs: 20
38 property bool finished: false
39
40 TestCase {
41 name: "AnimatorRegressionTest"
42 when: windowShown
43
44 function test_show_hide () {
45 tryCompare(root,"finished",true,root.timeout * (root.runs+1));
46 }
47 }
48
49 Timer {
50 property int hits: 0
51 interval: root.timeout; running: !root.finished; repeat: !root.finished
52 onTriggered: {
53 hits++;
54 if (hits >= root.runs) {
55 root.visible = true;
56 root.finished = true;
57 return;
58 }
59
60 root.visible = !root.visible
61 }
62 }
63
64 Flow {
65 anchors.fill: parent
66 Repeater {
67 model: 3
68
69 ActivityIndicator {
70 running: true
71 }
72 }
73 }
74 }
75}
076
=== modified file 'tests/unit_x11/tst_components/tst_textinput_touch.qml'
--- tests/unit_x11/tst_components/tst_textinput_touch.qml 2014-06-24 08:42:47 +0000
+++ tests/unit_x11/tst_components/tst_textinput_touch.qml 2014-07-18 18:17:44 +0000
@@ -192,15 +192,15 @@
192 verify(selectedText !== "", "No text selected!");192 verify(selectedText !== "", "No text selected!");
193193
194 popupSpy.target = findChild(data.input, "input_handler");194 popupSpy.target = findChild(data.input, "input_handler");
195 TestExtras.touchLongPress(0, data.input, guPoint(1, 1));195 TestExtras.touchLongPress(0, data.input, guPoint(2, 2));
196 waitForRendering(data.input, 500);196 waitForRendering(data.input, 500);
197 popupSpy.wait();197 popupSpy.wait();
198 compare(data.input.selectedText, selectedText, "Text selection should be the same!");198 compare(data.input.selectedText, selectedText, "Text selection should be the same!");
199199
200 // cleanup200 // cleanup
201 TestExtras.touchRelease(0, data.input, guPoint(1, 1));201 TestExtras.touchRelease(0, data.input, guPoint(2, 2));
202 // dismiss popover202 // dismiss popover
203 TestExtras.touchClick(0, testMain, 0, 0);203 TestExtras.touchClick(0, testMain, guPoint(0, 0));
204 }204 }
205205
206 function test_drag_cursor_handler_data() {206 function test_drag_cursor_handler_data() {
@@ -275,9 +275,7 @@
275 flickerSpy.target = outerFlicker;275 flickerSpy.target = outerFlicker;
276 autoSizeTextArea.focus = data.focused;276 autoSizeTextArea.focus = data.focused;
277 var editor = findChild(autoSizeTextArea, "text_input");277 var editor = findChild(autoSizeTextArea, "text_input");
278 wait(5000)
279 TestExtras.touchDrag(0, editor, guPoint(0, 0), guPoint(0, 40));278 TestExtras.touchDrag(0, editor, guPoint(0, 0), guPoint(0, 40));
280 wait(5000)
281 flickerSpy.wait();279 flickerSpy.wait();
282 }280 }
283 }281 }
284282
=== modified file 'tests/unit_x11/tst_test/tst_ubuntutestcase.qml'
--- tests/unit_x11/tst_test/tst_ubuntutestcase.qml 2014-06-24 07:01:06 +0000
+++ tests/unit_x11/tst_test/tst_ubuntutestcase.qml 2014-07-18 18:17:44 +0000
@@ -17,11 +17,12 @@
17import QtQuick 2.017import QtQuick 2.0
18import QtTest 1.018import QtTest 1.0
19import Ubuntu.Test 1.019import Ubuntu.Test 1.0
20import Ubuntu.Components 1.0
2021
21Rectangle {22Rectangle {
22 id: root23 id: root
23 width: 80024 width: 800
24 height: 60025 height: 1000
2526
26 Column {27 Column {
27 anchors.fill: parent28 anchors.fill: parent
@@ -73,6 +74,9 @@
73 height: 100074 height: 1000
74 }75 }
75 }76 }
77 TextField {
78 id: textField
79 }
76 }80 }
77 81
78 UbuntuTestCase {82 UbuntuTestCase {
@@ -173,6 +177,11 @@
173 flick(flicker, flicker.width, flicker.height, -flicker.width, -flicker.height, 400, 100);177 flick(flicker, flicker.width, flicker.height, -flicker.width, -flicker.height, 400, 100);
174 movementSpy.wait();178 movementSpy.wait();
175 }179 }
180 function test_typeString() {
181 textField.forceActiveFocus();
182 typeString("Hello Ubuntu");
183 tryCompare(textField, "text", "Hello Ubuntu");
184 }
176185
177 SignalSpy {186 SignalSpy {
178 id: touchPressSpy187 id: touchPressSpy

Subscribers

People subscribed via source and target branches

to status/vote changes: