Merge lp:~nskaggs/ubuntu-ui-toolkit/fix-1328600 into lp:ubuntu-ui-toolkit
- fix-1328600
- Merge into trunk
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 | ||||
Related bugs: |
|
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
1 | === modified file 'components.api' | |||
2 | --- components.api 2014-07-10 11:50:13 +0000 | |||
3 | +++ components.api 2014-07-18 18:17:44 +0000 | |||
4 | @@ -46,6 +46,12 @@ | |||
5 | 46 | readonly property color coolGrey | 46 | readonly property color coolGrey |
6 | 47 | property Gradient orangeGradient | 47 | property Gradient orangeGradient |
7 | 48 | property Gradient greyGradient | 48 | property Gradient greyGradient |
8 | 49 | readonly property color lightGrey | ||
9 | 50 | readonly property color darkGrey | ||
10 | 51 | readonly property color red | ||
11 | 52 | readonly property color green | ||
12 | 53 | readonly property color blue | ||
13 | 54 | readonly property color purple | ||
14 | 49 | ComboButton 1.1 | 55 | ComboButton 1.1 |
15 | 50 | Button | 56 | Button |
16 | 51 | property bool expanded | 57 | property bool expanded |
17 | @@ -398,6 +404,9 @@ | |||
18 | 398 | property real minimumValue | 404 | property real minimumValue |
19 | 399 | property real maximumValue | 405 | property real maximumValue |
20 | 400 | property real value | 406 | property real value |
21 | 407 | ProgressBar 1.1 | ||
22 | 408 | ProgressBar | ||
23 | 409 | property bool showProgressPercentage | ||
24 | 401 | PullToRefresh 1.1 | 410 | PullToRefresh 1.1 |
25 | 402 | StyledItem | 411 | StyledItem |
26 | 403 | readonly property bool releaseToRefresh | 412 | readonly property bool releaseToRefresh |
27 | @@ -620,6 +629,7 @@ | |||
28 | 620 | property color overlayText | 629 | property color overlayText |
29 | 621 | property color field | 630 | property color field |
30 | 622 | property color fieldText | 631 | property color fieldText |
31 | 632 | property color selection | ||
32 | 623 | ToolbarButton 0.1 1.0 | 633 | ToolbarButton 0.1 1.0 |
33 | 624 | ActionItem | 634 | ActionItem |
34 | 625 | ToolbarItems 0.1 1.0 | 635 | ToolbarItems 0.1 1.0 |
35 | @@ -657,6 +667,7 @@ | |||
36 | 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) |
37 | 658 | function mouseLongPress(item, x, y, button, modifiers, delay) | 668 | function mouseLongPress(item, x, y, button, modifiers, delay) |
38 | 659 | function tryCompareFunction(func, expectedResult, timeout) | 669 | function tryCompareFunction(func, expectedResult, timeout) |
39 | 670 | function typeString(string) | ||
40 | 660 | plugins.qmltypes | 671 | plugins.qmltypes |
41 | 661 | name: "FilterBehavior" | 672 | name: "FilterBehavior" |
42 | 662 | prototype: "QObject" | 673 | prototype: "QObject" |
43 | 663 | 674 | ||
44 | === modified file 'debian/control' | |||
45 | --- debian/control 2014-07-09 17:37:43 +0000 | |||
46 | +++ debian/control 2014-07-18 18:17:44 +0000 | |||
47 | @@ -39,6 +39,7 @@ | |||
48 | 39 | xvfb, | 39 | xvfb, |
49 | 40 | libgl1-mesa-dri, | 40 | libgl1-mesa-dri, |
50 | 41 | locales, | 41 | locales, |
51 | 42 | suru-icon-theme, | ||
52 | 42 | Standards-Version: 3.9.4 | 43 | Standards-Version: 3.9.4 |
53 | 43 | Homepage: https://launchpad.net/ubuntu-ui-toolkit | 44 | Homepage: https://launchpad.net/ubuntu-ui-toolkit |
54 | 44 | # If you aren't a member of ~ubuntu-sdk-team but need to upload packaging | 45 | # If you aren't a member of ~ubuntu-sdk-team but need to upload packaging |
55 | @@ -135,10 +136,12 @@ | |||
56 | 135 | libqt5widgets5, | 136 | libqt5widgets5, |
57 | 136 | python-autopilot (>= 1.4), | 137 | python-autopilot (>= 1.4), |
58 | 137 | python-fixtures, | 138 | python-fixtures, |
59 | 139 | python-gi, | ||
60 | 138 | python-mock, | 140 | python-mock, |
61 | 139 | python-testscenarios, | 141 | python-testscenarios, |
62 | 140 | python-testtools, | 142 | python-testtools, |
63 | 141 | python3-fixtures, | 143 | python3-fixtures, |
64 | 144 | python3-gi, | ||
65 | 142 | python3-testscenarios, | 145 | python3-testscenarios, |
66 | 143 | python3-testtools, | 146 | python3-testtools, |
67 | 144 | python3-autopilot (>= 1.4), | 147 | python3-autopilot (>= 1.4), |
68 | 145 | 148 | ||
69 | === added file 'examples/ubuntu-ui-toolkit-gallery/Colors.qml' | |||
70 | --- examples/ubuntu-ui-toolkit-gallery/Colors.qml 1970-01-01 00:00:00 +0000 | |||
71 | +++ examples/ubuntu-ui-toolkit-gallery/Colors.qml 2014-07-18 18:17:44 +0000 | |||
72 | @@ -0,0 +1,72 @@ | |||
73 | 1 | /* | ||
74 | 2 | * Copyright 2014 Canonical Ltd. | ||
75 | 3 | * | ||
76 | 4 | * This program is free software; you can redistribute it and/or modify | ||
77 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
78 | 6 | * the Free Software Foundation; version 3. | ||
79 | 7 | * | ||
80 | 8 | * This program is distributed in the hope that it will be useful, | ||
81 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
82 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
83 | 11 | * GNU Lesser General Public License for more details. | ||
84 | 12 | * | ||
85 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
86 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
87 | 15 | */ | ||
88 | 16 | |||
89 | 17 | import QtQuick 2.2 | ||
90 | 18 | import Ubuntu.Components 1.1 | ||
91 | 19 | |||
92 | 20 | Template { | ||
93 | 21 | objectName: "colorsTemplate" | ||
94 | 22 | |||
95 | 23 | TemplateSection { | ||
96 | 24 | title: "UbuntuColors" | ||
97 | 25 | className: "UbuntuColors" | ||
98 | 26 | |||
99 | 27 | // Except orange, none of the colors from UbuntuComponents 1.0 | ||
100 | 28 | // are included because they may be deprecated soon. | ||
101 | 29 | TemplateRow { | ||
102 | 30 | title: i18n.tr("Orange") | ||
103 | 31 | UbuntuShape { | ||
104 | 32 | color: UbuntuColors.orange | ||
105 | 33 | } | ||
106 | 34 | } | ||
107 | 35 | TemplateRow { | ||
108 | 36 | title: i18n.tr("Light grey") | ||
109 | 37 | UbuntuShape { | ||
110 | 38 | color: UbuntuColors.lightGrey | ||
111 | 39 | } | ||
112 | 40 | } | ||
113 | 41 | TemplateRow { | ||
114 | 42 | title: i18n.tr("Dark grey") | ||
115 | 43 | UbuntuShape { | ||
116 | 44 | color: UbuntuColors.darkGrey | ||
117 | 45 | } | ||
118 | 46 | } | ||
119 | 47 | TemplateRow { | ||
120 | 48 | title: i18n.tr("Red") | ||
121 | 49 | UbuntuShape { | ||
122 | 50 | color: UbuntuColors.red | ||
123 | 51 | } | ||
124 | 52 | } | ||
125 | 53 | TemplateRow { | ||
126 | 54 | title: i18n.tr("Green") | ||
127 | 55 | UbuntuShape { | ||
128 | 56 | color: UbuntuColors.green | ||
129 | 57 | } | ||
130 | 58 | } | ||
131 | 59 | TemplateRow { | ||
132 | 60 | title: i18n.tr("Blue") | ||
133 | 61 | UbuntuShape { | ||
134 | 62 | color: UbuntuColors.blue | ||
135 | 63 | } | ||
136 | 64 | } | ||
137 | 65 | TemplateRow { | ||
138 | 66 | title: i18n.tr("Purple") | ||
139 | 67 | UbuntuShape { | ||
140 | 68 | color: UbuntuColors.purple | ||
141 | 69 | } | ||
142 | 70 | } | ||
143 | 71 | } | ||
144 | 72 | } | ||
145 | 0 | 73 | ||
146 | === modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml' | |||
147 | --- examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2014-05-07 11:40:37 +0000 | |||
148 | +++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2014-07-18 18:17:44 +0000 | |||
149 | @@ -50,7 +50,7 @@ | |||
150 | 50 | 50 | ||
151 | 51 | TemplateSection { | 51 | TemplateSection { |
152 | 52 | title: i18n.tr("ThinDivider") | 52 | title: i18n.tr("ThinDivider") |
154 | 53 | className: "ThinDivider" | 53 | className: "ListItems-ThinDivider" |
155 | 54 | 54 | ||
156 | 55 | Column { | 55 | Column { |
157 | 56 | anchors.left: parent.left | 56 | anchors.left: parent.left |
158 | @@ -198,6 +198,7 @@ | |||
159 | 198 | } | 198 | } |
160 | 199 | 199 | ||
161 | 200 | ListItemsSection { | 200 | ListItemsSection { |
162 | 201 | id: removableSection | ||
163 | 201 | title: i18n.tr("Removable") | 202 | title: i18n.tr("Removable") |
164 | 202 | className: "Standard" | 203 | className: "Standard" |
165 | 203 | delegate: ListItem.Standard { | 204 | delegate: ListItem.Standard { |
166 | @@ -209,11 +210,21 @@ | |||
167 | 209 | color: Theme.palette.normal.base | 210 | color: Theme.palette.normal.base |
168 | 210 | } | 211 | } |
169 | 211 | } | 212 | } |
170 | 213 | |||
171 | 214 | Toolkit.Button { | ||
172 | 215 | text: i18n.tr("Reset") | ||
173 | 216 | anchors.right: parent.right | ||
174 | 217 | onClicked: { | ||
175 | 218 | for (var i=0, iMax=removableSection.count; i < iMax; i++) { | ||
176 | 219 | removableSection.itemAt(i).cancelItemRemoval() | ||
177 | 220 | } | ||
178 | 221 | } | ||
179 | 222 | } | ||
180 | 212 | } | 223 | } |
181 | 213 | 224 | ||
182 | 214 | TemplateSection { | 225 | TemplateSection { |
183 | 215 | title: i18n.tr("Grouped list") | 226 | title: i18n.tr("Grouped list") |
185 | 216 | className: "Header" | 227 | className: "ListItems-Header" |
186 | 217 | 228 | ||
187 | 218 | Rectangle { | 229 | Rectangle { |
188 | 219 | color: Qt.rgba(0.0, 0.0, 0.0, 0.01) | 230 | color: Qt.rgba(0.0, 0.0, 0.0, 0.01) |
189 | 220 | 231 | ||
190 | === modified file 'examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml' | |||
191 | --- examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml 2014-04-23 09:39:11 +0000 | |||
192 | +++ examples/ubuntu-ui-toolkit-gallery/ListItemsSection.qml 2014-07-18 18:17:44 +0000 | |||
193 | @@ -20,7 +20,13 @@ | |||
194 | 20 | TemplateSection { | 20 | TemplateSection { |
195 | 21 | id: section | 21 | id: section |
196 | 22 | property alias delegate: repeater.delegate | 22 | property alias delegate: repeater.delegate |
198 | 23 | documentation: "qml-ubuntu-components-listitems0-%1.html".arg(className.toLowerCase()) | 23 | property alias count: repeater.count |
199 | 24 | documentation: "qml-ubuntu-components-listitems-%1.html".arg(className.toLowerCase()) | ||
200 | 25 | |||
201 | 26 | function itemAt(index) | ||
202 | 27 | { | ||
203 | 28 | return repeater.itemAt(index) | ||
204 | 29 | } | ||
205 | 24 | 30 | ||
206 | 25 | Column { | 31 | Column { |
207 | 26 | id: column | 32 | id: column |
208 | 27 | 33 | ||
209 | === modified file 'examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml' | |||
210 | --- examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2014-04-23 09:39:11 +0000 | |||
211 | +++ examples/ubuntu-ui-toolkit-gallery/ProgressBars.qml 2014-07-18 18:17:44 +0000 | |||
212 | @@ -15,7 +15,7 @@ | |||
213 | 15 | */ | 15 | */ |
214 | 16 | 16 | ||
215 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
217 | 18 | import Ubuntu.Components 0.1 | 18 | import Ubuntu.Components 1.1 |
218 | 19 | 19 | ||
219 | 20 | Template { | 20 | Template { |
220 | 21 | objectName: "progressBarsTemplate" | 21 | objectName: "progressBarsTemplate" |
221 | @@ -53,6 +53,27 @@ | |||
222 | 53 | indeterminate: true | 53 | indeterminate: true |
223 | 54 | } | 54 | } |
224 | 55 | } | 55 | } |
225 | 56 | |||
226 | 57 | TemplateRow { | ||
227 | 58 | title: i18n.tr("No label") | ||
228 | 59 | |||
229 | 60 | ProgressBar { | ||
230 | 61 | id: progressNoLabel | ||
231 | 62 | objectName: "progressbar_nolabel" | ||
232 | 63 | width: parent.width | ||
233 | 64 | showProgressPercentage: false | ||
234 | 65 | |||
235 | 66 | SequentialAnimation on value { | ||
236 | 67 | loops: Animation.Infinite | ||
237 | 68 | NumberAnimation { | ||
238 | 69 | from: progress.minimumValue | ||
239 | 70 | to: progress.maximumValue | ||
240 | 71 | duration: 2000 | ||
241 | 72 | } | ||
242 | 73 | PauseAnimation {duration: 1000} | ||
243 | 74 | } | ||
244 | 75 | } | ||
245 | 76 | } | ||
246 | 56 | } | 77 | } |
247 | 57 | 78 | ||
248 | 58 | TemplateSection { | 79 | TemplateSection { |
249 | 59 | 80 | ||
250 | === modified file 'examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml' | |||
251 | --- examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-07-02 13:39:29 +0000 | |||
252 | +++ examples/ubuntu-ui-toolkit-gallery/WidgetsModel.qml 2014-07-18 18:17:44 +0000 | |||
253 | @@ -28,7 +28,11 @@ | |||
254 | 28 | label: "Styles" | 28 | label: "Styles" |
255 | 29 | source: "Styles.qml" | 29 | source: "Styles.qml" |
256 | 30 | } | 30 | } |
258 | 31 | 31 | ListElement { | |
259 | 32 | objectName: "colorsElement" | ||
260 | 33 | label: "Colors" | ||
261 | 34 | source: "Colors.qml" | ||
262 | 35 | } | ||
263 | 32 | ListElement { | 36 | ListElement { |
264 | 33 | objectName: "togglesElement" | 37 | objectName: "togglesElement" |
265 | 34 | label: "Toggles" | 38 | label: "Toggles" |
266 | 35 | 39 | ||
267 | === modified file 'modules/Ubuntu/Components/Colors/FIXME' | |||
268 | --- modules/Ubuntu/Components/Colors/FIXME 2013-07-01 05:54:33 +0000 | |||
269 | +++ modules/Ubuntu/Components/Colors/FIXME 2014-07-18 18:17:44 +0000 | |||
270 | @@ -1,3 +1,7 @@ | |||
271 | 1 | UbuntuColors.qml is located in the Colors subdirectory because | 1 | UbuntuColors.qml is located in the Colors subdirectory because |
272 | 2 | QuickUtils::createQmlObject() fails if the QML file is located in a | 2 | QuickUtils::createQmlObject() fails if the QML file is located in a |
273 | 3 | folder that has a qmldir file with JavaScript modules. | 3 | folder that has a qmldir file with JavaScript modules. |
274 | 4 | |||
275 | 5 | UbuntuColors 1.1 is not in a file named UbuntuColors11.qml but in | ||
276 | 6 | UbuntuColors.qml so that qdoc can properly detect the component | ||
277 | 7 | name without a qmldir file. | ||
278 | 4 | 8 | ||
279 | === added file 'modules/Ubuntu/Components/Colors/UbuntuColors.qml' | |||
280 | --- modules/Ubuntu/Components/Colors/UbuntuColors.qml 1970-01-01 00:00:00 +0000 | |||
281 | +++ modules/Ubuntu/Components/Colors/UbuntuColors.qml 2014-07-18 18:17:44 +0000 | |||
282 | @@ -0,0 +1,131 @@ | |||
283 | 1 | /* | ||
284 | 2 | Copyright 2014 Canonical Ltd. | ||
285 | 3 | * | ||
286 | 4 | This program is free software; you can redistribute it and/or modify | ||
287 | 5 | it under the terms of the GNU Lesser General Public License as published by | ||
288 | 6 | the Free Software Foundation; version 3. | ||
289 | 7 | * | ||
290 | 8 | This program is distributed in the hope that it will be useful, | ||
291 | 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
292 | 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
293 | 11 | GNU Lesser General Public License for more details. | ||
294 | 12 | * | ||
295 | 13 | You should have received a copy of the GNU Lesser General Public License | ||
296 | 14 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
297 | 15 | */ | ||
298 | 16 | |||
299 | 17 | import QtQuick 2.2 | ||
300 | 18 | |||
301 | 19 | /*! | ||
302 | 20 | \qmltype UbuntuColors | ||
303 | 21 | \inqmlmodule Ubuntu.Components 1.1 | ||
304 | 22 | \ingroup ubuntu | ||
305 | 23 | \brief Singleton defining the Ubuntu color palette. | ||
306 | 24 | |||
307 | 25 | Each color of the Ubuntu color palette is accesible from it. | ||
308 | 26 | For more information on how to appropriately use the colors according to | ||
309 | 27 | the context, please refer to the | ||
310 | 28 | \l{http://design.ubuntu.com/brand/colour-palette}{Ubuntu brand guidelines}. | ||
311 | 29 | |||
312 | 30 | Example of use: | ||
313 | 31 | |||
314 | 32 | \qml | ||
315 | 33 | Rectangle { | ||
316 | 34 | color: UbuntuColors.orange | ||
317 | 35 | } | ||
318 | 36 | \endqml | ||
319 | 37 | */ | ||
320 | 38 | QtObject { | ||
321 | 39 | // old colors from UbuntuColors 1.0: | ||
322 | 40 | |||
323 | 41 | /*! | ||
324 | 42 | Orange. Recommended for branded elements, display progress | ||
325 | 43 | and intensity, textual links on light backgrounds. | ||
326 | 44 | */ | ||
327 | 45 | readonly property color orange: "#DD4814" | ||
328 | 46 | /*! | ||
329 | 47 | \deprecated | ||
330 | 48 | Ubuntu supporting color: light aubergine | ||
331 | 49 | */ | ||
332 | 50 | readonly property color lightAubergine: "#77216F" | ||
333 | 51 | /*! | ||
334 | 52 | \deprecated | ||
335 | 53 | Ubuntu supporting color: mid aubergine | ||
336 | 54 | */ | ||
337 | 55 | readonly property color midAubergine: "#5E2750" | ||
338 | 56 | /*! | ||
339 | 57 | \deprecated | ||
340 | 58 | Ubuntu supporting color: dark aubergine | ||
341 | 59 | */ | ||
342 | 60 | readonly property color darkAubergine: "#2C001E" | ||
343 | 61 | /*! | ||
344 | 62 | \deprecated | ||
345 | 63 | Ubuntu neutral color: warm grey | ||
346 | 64 | */ | ||
347 | 65 | readonly property color warmGrey: "#AEA79F" | ||
348 | 66 | /*! | ||
349 | 67 | \deprecated | ||
350 | 68 | Ubuntu neutral color: cool grey | ||
351 | 69 | */ | ||
352 | 70 | readonly property color coolGrey: "#333333" | ||
353 | 71 | |||
354 | 72 | /*! | ||
355 | 73 | Ubuntu orange gradient | ||
356 | 74 | |||
357 | 75 | \sa Button::gradient | ||
358 | 76 | */ | ||
359 | 77 | property Gradient orangeGradient: Gradient { | ||
360 | 78 | GradientStop { position: 0.0; color: "#DD4814" } | ||
361 | 79 | GradientStop { position: 1.0; color: "#D9722D" } | ||
362 | 80 | } | ||
363 | 81 | /*! | ||
364 | 82 | Ubuntu grey gradient | ||
365 | 83 | |||
366 | 84 | \sa Button::gradient | ||
367 | 85 | */ | ||
368 | 86 | property Gradient greyGradient: Gradient { | ||
369 | 87 | GradientStop { position: 0.0; color: "#888888" } | ||
370 | 88 | GradientStop { position: 1.0; color: "#BBBBBB" } | ||
371 | 89 | } | ||
372 | 90 | |||
373 | 91 | // New colors introduced in UbuntuColors 1.1: | ||
374 | 92 | |||
375 | 93 | /*! | ||
376 | 94 | Light grey. Recommended for neutral action buttons and | ||
377 | 95 | secondary text. | ||
378 | 96 | \since Ubuntu.Components 1.1 | ||
379 | 97 | */ | ||
380 | 98 | readonly property color lightGrey: "#888888" | ||
381 | 99 | |||
382 | 100 | /*! | ||
383 | 101 | Dark grey. Recommended for text and action icons. | ||
384 | 102 | \since Ubuntu.Components 1.1 | ||
385 | 103 | */ | ||
386 | 104 | readonly property color darkGrey: "#5d5d5d" | ||
387 | 105 | |||
388 | 106 | /*! | ||
389 | 107 | Red. Recommended for negative and irreversible action | ||
390 | 108 | buttons, errors and alerts. | ||
391 | 109 | \since Ubuntu.Components 1.1 | ||
392 | 110 | */ | ||
393 | 111 | readonly property color red: "#fc4949" | ||
394 | 112 | |||
395 | 113 | /*! | ||
396 | 114 | Green. Recommended for positive action buttons. | ||
397 | 115 | \since Ubuntu.Components 1.1 | ||
398 | 116 | */ | ||
399 | 117 | readonly property color green: "#3fb24f" | ||
400 | 118 | |||
401 | 119 | /*! | ||
402 | 120 | Blue. Recommended for text selection and text cursor. | ||
403 | 121 | \since Ubuntu.Components 1.1 | ||
404 | 122 | */ | ||
405 | 123 | readonly property color blue: "#1ab6ef" | ||
406 | 124 | |||
407 | 125 | /*! | ||
408 | 126 | Purple. Recommended for proper nouns in | ||
409 | 127 | list items. | ||
410 | 128 | \since Ubuntu.Components 1.1 | ||
411 | 129 | */ | ||
412 | 130 | readonly property color purple: "#762572" | ||
413 | 131 | } | ||
414 | 0 | 132 | ||
415 | === renamed file 'modules/Ubuntu/Components/Colors/UbuntuColors.qml' => 'modules/Ubuntu/Components/Colors/UbuntuColors10.qml' | |||
416 | --- modules/Ubuntu/Components/Colors/UbuntuColors.qml 2013-07-02 00:15:07 +0000 | |||
417 | +++ modules/Ubuntu/Components/Colors/UbuntuColors10.qml 2014-07-18 18:17:44 +0000 | |||
418 | @@ -1,5 +1,5 @@ | |||
419 | 1 | /* | 1 | /* |
421 | 2 | Copyright 2013 Canonical Ltd. | 2 | Copyright 2013-2014 Canonical Ltd. |
422 | 3 | * | 3 | * |
423 | 4 | This program is free software; you can redistribute it and/or modify | 4 | This program is free software; you can redistribute it and/or modify |
424 | 5 | it under the terms of the GNU Lesser General Public License as published by | 5 | it under the terms of the GNU Lesser General Public License as published by |
425 | @@ -14,67 +14,23 @@ | |||
426 | 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/>. |
427 | 15 | */ | 15 | */ |
428 | 16 | 16 | ||
430 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.2 |
431 | 18 | 18 | ||
432 | 19 | /*! | 19 | /*! |
450 | 20 | \qmltype UbuntuColors | 20 | \internal |
451 | 21 | \inqmlmodule Ubuntu.Components 0.1 | 21 | Documentation is in UbuntuColors.qml |
435 | 22 | \ingroup theming | ||
436 | 23 | \brief Singleton defining the Ubuntu color palette. | ||
437 | 24 | |||
438 | 25 | Each color of the Ubuntu color palette is accesible from it. | ||
439 | 26 | For more information on how to appropriately use the colors according to | ||
440 | 27 | the context, please refer to the | ||
441 | 28 | \l{http://design.ubuntu.com/brand/colour-palette}{Ubuntu brand guidelines}. | ||
442 | 29 | |||
443 | 30 | Example of use: | ||
444 | 31 | |||
445 | 32 | \qml | ||
446 | 33 | Rectangle { | ||
447 | 34 | color: UbuntuColors.orange | ||
448 | 35 | } | ||
449 | 36 | \endqml | ||
452 | 37 | */ | 22 | */ |
453 | 38 | QtObject { | 23 | QtObject { |
454 | 39 | /*! | ||
455 | 40 | Ubuntu core color: Ubuntu orange | ||
456 | 41 | */ | ||
457 | 42 | readonly property color orange: "#DD4814" | 24 | readonly property color orange: "#DD4814" |
458 | 43 | /*! | ||
459 | 44 | Ubuntu supporting color: light aubergine | ||
460 | 45 | */ | ||
461 | 46 | readonly property color lightAubergine: "#77216F" | 25 | readonly property color lightAubergine: "#77216F" |
462 | 47 | /*! | ||
463 | 48 | Ubuntu supporting color: mid aubergine | ||
464 | 49 | */ | ||
465 | 50 | readonly property color midAubergine: "#5E2750" | 26 | readonly property color midAubergine: "#5E2750" |
466 | 51 | /*! | ||
467 | 52 | Ubuntu supporting color: dark aubergine | ||
468 | 53 | */ | ||
469 | 54 | readonly property color darkAubergine: "#2C001E" | 27 | readonly property color darkAubergine: "#2C001E" |
470 | 55 | /*! | ||
471 | 56 | Ubuntu neutral color: warm grey | ||
472 | 57 | */ | ||
473 | 58 | readonly property color warmGrey: "#AEA79F" | 28 | readonly property color warmGrey: "#AEA79F" |
474 | 59 | /*! | ||
475 | 60 | Ubuntu neutral color: cool grey | ||
476 | 61 | */ | ||
477 | 62 | readonly property color coolGrey: "#333333" | 29 | readonly property color coolGrey: "#333333" |
478 | 63 | |||
479 | 64 | /*! | ||
480 | 65 | Ubuntu orange gradient | ||
481 | 66 | |||
482 | 67 | \sa Button::gradient | ||
483 | 68 | */ | ||
484 | 69 | property Gradient orangeGradient: Gradient { | 30 | property Gradient orangeGradient: Gradient { |
485 | 70 | GradientStop { position: 0.0; color: "#DD4814" } | 31 | GradientStop { position: 0.0; color: "#DD4814" } |
486 | 71 | GradientStop { position: 1.0; color: "#D9722D" } | 32 | GradientStop { position: 1.0; color: "#D9722D" } |
487 | 72 | } | 33 | } |
488 | 73 | /*! | ||
489 | 74 | Ubuntu grey gradient | ||
490 | 75 | |||
491 | 76 | \sa Button::gradient | ||
492 | 77 | */ | ||
493 | 78 | property Gradient greyGradient: Gradient { | 34 | property Gradient greyGradient: Gradient { |
494 | 79 | GradientStop { position: 0.0; color: "#888888" } | 35 | GradientStop { position: 0.0; color: "#888888" } |
495 | 80 | GradientStop { position: 1.0; color: "#BBBBBB" } | 36 | GradientStop { position: 1.0; color: "#BBBBBB" } |
496 | 81 | 37 | ||
497 | === modified file 'modules/Ubuntu/Components/ListItems/Empty.qml' | |||
498 | --- modules/Ubuntu/Components/ListItems/Empty.qml 2014-06-05 11:42:07 +0000 | |||
499 | +++ modules/Ubuntu/Components/ListItems/Empty.qml 2014-07-18 18:17:44 +0000 | |||
500 | @@ -175,6 +175,7 @@ | |||
501 | 175 | function cancelItemRemoval() | 175 | function cancelItemRemoval() |
502 | 176 | { | 176 | { |
503 | 177 | priv.resetDrag() | 177 | priv.resetDrag() |
504 | 178 | priv.removed = false | ||
505 | 178 | } | 179 | } |
506 | 179 | 180 | ||
507 | 180 | width: parent ? parent.width : units.gu(31) | 181 | width: parent ? parent.width : units.gu(31) |
508 | 181 | 182 | ||
509 | === modified file 'modules/Ubuntu/Components/PageHeadConfiguration.qml' | |||
510 | --- modules/Ubuntu/Components/PageHeadConfiguration.qml 2014-07-01 11:27:29 +0000 | |||
511 | +++ modules/Ubuntu/Components/PageHeadConfiguration.qml 2014-07-18 18:17:44 +0000 | |||
512 | @@ -31,12 +31,42 @@ | |||
513 | 31 | 31 | ||
514 | 32 | /*! | 32 | /*! |
515 | 33 | List of actions to show in the header. | 33 | List of actions to show in the header. |
516 | 34 | |||
517 | 35 | Example: | ||
518 | 36 | \qml | ||
519 | 37 | Page { | ||
520 | 38 | title: "Custom header actions" | ||
521 | 39 | head.actions: [ | ||
522 | 40 | Action { | ||
523 | 41 | iconName: "save" | ||
524 | 42 | text: i18n.tr("Save") | ||
525 | 43 | }, | ||
526 | 44 | Action { | ||
527 | 45 | iconName: "add" | ||
528 | 46 | text: i18n.tr("Add") | ||
529 | 47 | } | ||
530 | 48 | ] | ||
531 | 49 | } | ||
532 | 50 | \endqml | ||
533 | 34 | */ | 51 | */ |
534 | 35 | property list<Action> actions | 52 | property list<Action> actions |
535 | 36 | 53 | ||
536 | 37 | /*! | 54 | /*! |
537 | 38 | Overrides the default \l PageStack back button and the | 55 | Overrides the default \l PageStack back button and the |
538 | 39 | \l Tabs drawer button in the header. | 56 | \l Tabs drawer button in the header. |
539 | 57 | |||
540 | 58 | Example: | ||
541 | 59 | \qml | ||
542 | 60 | Page { | ||
543 | 61 | title: "Back Action Page" | ||
544 | 62 | head.backAction: Action { | ||
545 | 63 | iconName: "close" | ||
546 | 64 | onTriggered: { | ||
547 | 65 | console.log("Run custom back action") | ||
548 | 66 | } | ||
549 | 67 | } | ||
550 | 68 | } | ||
551 | 69 | \endqml | ||
552 | 40 | */ | 70 | */ |
553 | 41 | property Action backAction: null | 71 | property Action backAction: null |
554 | 42 | 72 | ||
555 | @@ -52,7 +82,7 @@ | |||
556 | 52 | \qml | 82 | \qml |
557 | 53 | Page { | 83 | Page { |
558 | 54 | title: "Invisible title" | 84 | title: "Invisible title" |
560 | 55 | contents: Rectangle { | 85 | head.contents: Rectangle { |
561 | 56 | color: UbuntuColors.orange | 86 | color: UbuntuColors.orange |
562 | 57 | height: units.gu(5) | 87 | height: units.gu(5) |
563 | 58 | width: parent ? parent.width - units.gu(2) : undefined | 88 | width: parent ? parent.width - units.gu(2) : undefined |
564 | 59 | 89 | ||
565 | === modified file 'modules/Ubuntu/Components/Pickers/DatePicker.qml' | |||
566 | --- modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-05-27 07:17:16 +0000 | |||
567 | +++ modules/Ubuntu/Components/Pickers/DatePicker.qml 2014-07-18 18:17:44 +0000 | |||
568 | @@ -248,7 +248,7 @@ | |||
569 | 248 | */ | 248 | */ |
570 | 249 | property date maximum: { | 249 | property date maximum: { |
571 | 250 | var d = Date.prototype.midnight.call(new Date()); | 250 | var d = Date.prototype.midnight.call(new Date()); |
573 | 251 | d.setFullYear(d.getFullYear() + 50); | 251 | d.setFullYear(d.getFullYear() + 15); |
574 | 252 | return d; | 252 | return d; |
575 | 253 | } | 253 | } |
576 | 254 | 254 | ||
577 | 255 | 255 | ||
578 | === renamed file 'modules/Ubuntu/Components/ProgressBar.qml' => 'modules/Ubuntu/Components/ProgressBar10.qml' | |||
579 | === added file 'modules/Ubuntu/Components/ProgressBar11.qdoc' | |||
580 | --- modules/Ubuntu/Components/ProgressBar11.qdoc 1970-01-01 00:00:00 +0000 | |||
581 | +++ modules/Ubuntu/Components/ProgressBar11.qdoc 2014-07-18 18:17:44 +0000 | |||
582 | @@ -0,0 +1,6 @@ | |||
583 | 1 | /*! | ||
584 | 2 | \qmlproperty bool ProgressBar::showProgressPercentage | ||
585 | 3 | \since Ubuntu.Components 1.1 | ||
586 | 4 | |||
587 | 5 | Specifies if the value of the progress is visible | ||
588 | 6 | */ | ||
589 | 0 | 7 | ||
590 | === added file 'modules/Ubuntu/Components/ProgressBar11.qml' | |||
591 | --- modules/Ubuntu/Components/ProgressBar11.qml 1970-01-01 00:00:00 +0000 | |||
592 | +++ modules/Ubuntu/Components/ProgressBar11.qml 2014-07-18 18:17:44 +0000 | |||
593 | @@ -0,0 +1,21 @@ | |||
594 | 1 | /* | ||
595 | 2 | * Copyright 2014 Canonical Ltd. | ||
596 | 3 | * | ||
597 | 4 | * This program is free software; you can redistribute it and/or modify | ||
598 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
599 | 6 | * the Free Software Foundation; version 3. | ||
600 | 7 | * | ||
601 | 8 | * This program is distributed in the hope that it will be useful, | ||
602 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
603 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
604 | 11 | * GNU Lesser General Public License for more details. | ||
605 | 12 | * | ||
606 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
607 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
608 | 15 | */ | ||
609 | 16 | |||
610 | 17 | import QtQuick 2.0 | ||
611 | 18 | |||
612 | 19 | ProgressBar { | ||
613 | 20 | property bool showProgressPercentage: true | ||
614 | 21 | } | ||
615 | 0 | 22 | ||
616 | === modified file 'modules/Ubuntu/Components/TextArea.qml' | |||
617 | --- modules/Ubuntu/Components/TextArea.qml 2014-06-28 17:26:49 +0000 | |||
618 | +++ modules/Ubuntu/Components/TextArea.qml 2014-07-18 18:17:44 +0000 | |||
619 | @@ -850,7 +850,7 @@ | |||
620 | 850 | } | 850 | } |
621 | 851 | color: control.__styleInstance.color | 851 | color: control.__styleInstance.color |
622 | 852 | selectedTextColor: Theme.palette.selected.foregroundText | 852 | selectedTextColor: Theme.palette.selected.foregroundText |
624 | 853 | selectionColor: Theme.palette.selected.foreground | 853 | selectionColor: Theme.palette.selected.selection |
625 | 854 | font.pixelSize: FontUtils.sizeToPixels("medium") | 854 | font.pixelSize: FontUtils.sizeToPixels("medium") |
626 | 855 | // forward keys to the root element so it can be captured outside of it | 855 | // forward keys to the root element so it can be captured outside of it |
627 | 856 | // as well as to InputHandler to handle PageUp/PageDown keys | 856 | // as well as to InputHandler to handle PageUp/PageDown keys |
628 | 857 | 857 | ||
629 | === modified file 'modules/Ubuntu/Components/TextField.qml' | |||
630 | --- modules/Ubuntu/Components/TextField.qml 2014-06-29 21:46:30 +0000 | |||
631 | +++ modules/Ubuntu/Components/TextField.qml 2014-07-18 18:17:44 +0000 | |||
632 | @@ -979,7 +979,7 @@ | |||
633 | 979 | } | 979 | } |
634 | 980 | color: control.__styleInstance.color | 980 | color: control.__styleInstance.color |
635 | 981 | selectedTextColor: Theme.palette.selected.foregroundText | 981 | selectedTextColor: Theme.palette.selected.foregroundText |
637 | 982 | selectionColor: Theme.palette.selected.foreground | 982 | selectionColor: Theme.palette.selected.selection |
638 | 983 | font.pixelSize: FontUtils.sizeToPixels("medium") | 983 | font.pixelSize: FontUtils.sizeToPixels("medium") |
639 | 984 | passwordCharacter: "\u2022" | 984 | passwordCharacter: "\u2022" |
640 | 985 | // forward keys to the root element so it can be captured outside of it | 985 | // forward keys to the root element so it can be captured outside of it |
641 | 986 | 986 | ||
642 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml' | |||
643 | --- modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml 2014-05-22 13:04:58 +0000 | |||
644 | +++ modules/Ubuntu/Components/Themes/Ambiance/ActivityIndicatorStyle.qml 2014-07-18 18:17:44 +0000 | |||
645 | @@ -28,7 +28,12 @@ | |||
646 | 28 | verticalAlignment: Image.AlignVCenter | 28 | verticalAlignment: Image.AlignVCenter |
647 | 29 | source: "artwork/spinner.png" | 29 | source: "artwork/spinner.png" |
648 | 30 | 30 | ||
650 | 31 | RotationAnimator on rotation { | 31 | /* |
651 | 32 | Changed from RotationAnimator to RotationAnimation to | ||
652 | 33 | work around bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1338602 | ||
653 | 34 | "Activity Indicator crashes in QML/Widget mixed applications" | ||
654 | 35 | */ | ||
655 | 36 | RotationAnimation on rotation { | ||
656 | 32 | running: styledItem.running | 37 | running: styledItem.running |
657 | 33 | from: 0 | 38 | from: 0 |
658 | 34 | to: 360 | 39 | to: 360 |
659 | 35 | 40 | ||
660 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/Palette.qml' | |||
661 | --- modules/Ubuntu/Components/Themes/Ambiance/Palette.qml 2013-07-05 12:21:32 +0000 | |||
662 | +++ modules/Ubuntu/Components/Themes/Ambiance/Palette.qml 2014-07-18 18:17:44 +0000 | |||
663 | @@ -15,6 +15,7 @@ | |||
664 | 15 | */ | 15 | */ |
665 | 16 | 16 | ||
666 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
667 | 18 | import Ubuntu.Components 1.1 | ||
668 | 18 | import Ubuntu.Components.Themes 0.1 | 19 | import Ubuntu.Components.Themes 0.1 |
669 | 19 | 20 | ||
670 | 20 | Palette { | 21 | Palette { |
671 | @@ -22,13 +23,13 @@ | |||
672 | 22 | background: "#EDEDED" | 23 | background: "#EDEDED" |
673 | 23 | backgroundText: "#81888888" | 24 | backgroundText: "#81888888" |
674 | 24 | base: "#1A000000" | 25 | base: "#1A000000" |
677 | 25 | baseText: "#888888" | 26 | baseText: UbuntuColors.lightGrey |
678 | 26 | foreground: "#888888" | 27 | foreground: UbuntuColors.lightGrey |
679 | 27 | foregroundText: "#F3F3E7" | 28 | foregroundText: "#F3F3E7" |
680 | 28 | overlay: "#FDFDFD" | 29 | overlay: "#FDFDFD" |
682 | 29 | overlayText: "#888888" | 30 | overlayText: UbuntuColors.lightGrey |
683 | 30 | field: "#1A000000" | 31 | field: "#1A000000" |
685 | 31 | fieldText: "#888888" | 32 | fieldText: UbuntuColors.darkGrey |
686 | 32 | } | 33 | } |
687 | 33 | selected: PaletteValues { | 34 | selected: PaletteValues { |
688 | 34 | /* FIXME: 'background' does not come from design | 35 | /* FIXME: 'background' does not come from design |
689 | @@ -36,10 +37,11 @@ | |||
690 | 36 | that will go away with the new design. | 37 | that will go away with the new design. |
691 | 37 | */ | 38 | */ |
692 | 38 | background: "#B2E6E6E6" | 39 | background: "#B2E6E6E6" |
696 | 39 | backgroundText: "#888888" | 40 | backgroundText: UbuntuColors.darkGrey |
697 | 40 | foreground: "#DD4814" | 41 | selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.2) |
698 | 41 | foregroundText: "#F3F3E7" | 42 | foreground: UbuntuColors.blue |
699 | 43 | foregroundText: UbuntuColors.darkGrey | ||
700 | 42 | field: "#FFFFFF" | 44 | field: "#FFFFFF" |
702 | 43 | fieldText: "#888888" | 45 | fieldText: UbuntuColors.darkGrey |
703 | 44 | } | 46 | } |
704 | 45 | } | 47 | } |
705 | 46 | 48 | ||
706 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml' | |||
707 | --- modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml 2014-04-23 08:50:20 +0000 | |||
708 | +++ modules/Ubuntu/Components/Themes/Ambiance/ProgressBarStyle.qml 2014-07-18 18:17:44 +0000 | |||
709 | @@ -20,7 +20,7 @@ | |||
710 | 20 | Item { | 20 | Item { |
711 | 21 | id: progressBarStyle | 21 | id: progressBarStyle |
712 | 22 | 22 | ||
714 | 23 | property ProgressBar progressBar: styledItem | 23 | property var progressBar: styledItem |
715 | 24 | 24 | ||
716 | 25 | implicitWidth: units.gu(38) | 25 | implicitWidth: units.gu(38) |
717 | 26 | implicitHeight: units.gu(4) | 26 | implicitHeight: units.gu(4) |
718 | @@ -56,6 +56,7 @@ | |||
719 | 56 | color: Theme.palette.normal.baseText | 56 | color: Theme.palette.normal.baseText |
720 | 57 | text: progressBar.indeterminate ? i18n.tr("In Progress") | 57 | text: progressBar.indeterminate ? i18n.tr("In Progress") |
721 | 58 | : "%1%".arg(Number(progressBarStyle.progress * 100.0).toFixed(0)) | 58 | : "%1%".arg(Number(progressBarStyle.progress * 100.0).toFixed(0)) |
722 | 59 | visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage | ||
723 | 59 | 60 | ||
724 | 60 | SequentialAnimation on opacity { | 61 | SequentialAnimation on opacity { |
725 | 61 | loops: Animation.Infinite | 62 | loops: Animation.Infinite |
726 | @@ -76,5 +77,6 @@ | |||
727 | 76 | rightColor: Theme.palette.normal.baseText | 77 | rightColor: Theme.palette.normal.baseText |
728 | 77 | progress: (progressBarStyle.progress * background.width - valueLabel.x) / valueLabel.width | 78 | progress: (progressBarStyle.progress * background.width - valueLabel.x) / valueLabel.width |
729 | 78 | mirror: Qt.application.layoutDirection == Qt.RightToLeft | 79 | mirror: Qt.application.layoutDirection == Qt.RightToLeft |
730 | 80 | visible: !progressBar.hasOwnProperty("showProgressPercentage") || progressBar.showProgressPercentage | ||
731 | 79 | } | 81 | } |
732 | 80 | } | 82 | } |
733 | 81 | 83 | ||
734 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml' | |||
735 | --- modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-05-09 05:25:12 +0000 | |||
736 | +++ modules/Ubuntu/Components/Themes/Ambiance/TextCursorStyle.qml 2014-07-18 18:17:44 +0000 | |||
737 | @@ -47,7 +47,7 @@ | |||
738 | 47 | Component { | 47 | Component { |
739 | 48 | id: delegate | 48 | id: delegate |
740 | 49 | Rectangle { | 49 | Rectangle { |
742 | 50 | width: units.dp(1) | 50 | width: units.dp(2) |
743 | 51 | color: Theme.palette.selected.foreground | 51 | color: Theme.palette.selected.foreground |
744 | 52 | visible: blinkTimer.timerShowCursor | 52 | visible: blinkTimer.timerShowCursor |
745 | 53 | Timer { | 53 | Timer { |
746 | @@ -70,7 +70,7 @@ | |||
747 | 70 | // caretItem | 70 | // caretItem |
748 | 71 | Image { | 71 | Image { |
749 | 72 | id: caretItem | 72 | id: caretItem |
751 | 73 | source: "artwork/teardrop-left.png" | 73 | source: "artwork/caret_noshadow.png" |
752 | 74 | anchors { | 74 | anchors { |
753 | 75 | top: parent.bottom | 75 | top: parent.bottom |
754 | 76 | horizontalCenter: parent.horizontalCenter | 76 | horizontalCenter: parent.horizontalCenter |
755 | 77 | 77 | ||
756 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml' | |||
757 | --- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-05-09 05:25:12 +0000 | |||
758 | +++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionEndCursorStyle.qml 2014-07-18 18:17:44 +0000 | |||
759 | @@ -55,7 +55,7 @@ | |||
760 | 55 | // caretItem | 55 | // caretItem |
761 | 56 | Image { | 56 | Image { |
762 | 57 | id: caretItem | 57 | id: caretItem |
764 | 58 | source: "artwork/teardrop-left.png" | 58 | source: "artwork/caret_noshadow.png" |
765 | 59 | anchors { | 59 | anchors { |
766 | 60 | top: parent.bottom | 60 | top: parent.bottom |
767 | 61 | horizontalCenter: parent.horizontalCenter | 61 | horizontalCenter: parent.horizontalCenter |
768 | 62 | 62 | ||
769 | === modified file 'modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml' | |||
770 | --- modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-05-13 08:00:18 +0000 | |||
771 | +++ modules/Ubuntu/Components/Themes/Ambiance/TextSelectionStartCursorStyle.qml 2014-07-18 18:17:44 +0000 | |||
772 | @@ -55,12 +55,13 @@ | |||
773 | 55 | // caretItem | 55 | // caretItem |
774 | 56 | Image { | 56 | Image { |
775 | 57 | id: caretItem | 57 | id: caretItem |
777 | 58 | source: "artwork/teardrop-right.png" | 58 | source: "artwork/caret_noshadow.png" |
778 | 59 | anchors { | 59 | anchors { |
780 | 60 | top: parent.bottom | 60 | bottom: parent.top |
781 | 61 | horizontalCenter: parent.horizontalCenter | 61 | horizontalCenter: parent.horizontalCenter |
782 | 62 | topMargin: -units.gu(0.5) | 62 | topMargin: -units.gu(0.5) |
783 | 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) |
784 | 64 | } | 64 | } |
785 | 65 | rotation: 180 | ||
786 | 65 | } | 66 | } |
787 | 66 | } | 67 | } |
788 | 67 | 68 | ||
789 | === added file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/caret_noshadow@27.png' | |||
790 | 68 | Binary 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 | 69 | Binary 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 |
791 | === removed file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-left@20.png' | |||
792 | 69 | Binary 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 | 70 | Binary 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 |
793 | === removed file 'modules/Ubuntu/Components/Themes/Ambiance/artwork/teardrop-right@20.png' | |||
794 | 70 | Binary 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 | 71 | Binary 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 |
795 | === modified file 'modules/Ubuntu/Components/Themes/PaletteValues.qml' | |||
796 | --- modules/Ubuntu/Components/Themes/PaletteValues.qml 2013-07-05 16:04:07 +0000 | |||
797 | +++ modules/Ubuntu/Components/Themes/PaletteValues.qml 2014-07-18 18:17:44 +0000 | |||
798 | @@ -69,4 +69,8 @@ | |||
799 | 69 | Typically used for labels and images. | 69 | Typically used for labels and images. |
800 | 70 | */ | 70 | */ |
801 | 71 | property color fieldText | 71 | property color fieldText |
802 | 72 | /*! | ||
803 | 73 | Color applied to selected text in editable components. | ||
804 | 74 | */ | ||
805 | 75 | property color selection | ||
806 | 72 | } | 76 | } |
807 | 73 | 77 | ||
808 | === modified file 'modules/Ubuntu/Components/Themes/SuruDark/Palette.qml' | |||
809 | --- modules/Ubuntu/Components/Themes/SuruDark/Palette.qml 2013-07-05 14:34:00 +0000 | |||
810 | +++ modules/Ubuntu/Components/Themes/SuruDark/Palette.qml 2014-07-18 18:17:44 +0000 | |||
811 | @@ -15,6 +15,7 @@ | |||
812 | 15 | */ | 15 | */ |
813 | 16 | 16 | ||
814 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
815 | 18 | import Ubuntu.Components 1.1 | ||
816 | 18 | import Ubuntu.Components.Themes 0.1 | 19 | import Ubuntu.Components.Themes 0.1 |
817 | 19 | 20 | ||
818 | 20 | Palette { | 21 | Palette { |
819 | @@ -33,8 +34,9 @@ | |||
820 | 33 | selected: PaletteValues { | 34 | selected: PaletteValues { |
821 | 34 | background: "#88D6D6D6" // FIXME: not from design | 35 | background: "#88D6D6D6" // FIXME: not from design |
822 | 35 | backgroundText: "#F3F3E7" | 36 | backgroundText: "#F3F3E7" |
825 | 36 | foreground: "#DD4814" | 37 | selection: Qt.rgba(UbuntuColors.blue.r, UbuntuColors.blue.g, UbuntuColors.blue.b, 0.2) |
826 | 37 | foregroundText: "#F3F3E7" | 38 | foreground: UbuntuColors.blue |
827 | 39 | foregroundText: UbuntuColors.darkGrey | ||
828 | 38 | field: "#FFFFFF" | 40 | field: "#FFFFFF" |
829 | 39 | fieldText: "#888888" | 41 | fieldText: "#888888" |
830 | 40 | } | 42 | } |
831 | 41 | 43 | ||
832 | === modified file 'modules/Ubuntu/Components/deployment.pri' | |||
833 | --- modules/Ubuntu/Components/deployment.pri 2014-04-29 05:39:04 +0000 | |||
834 | +++ modules/Ubuntu/Components/deployment.pri 2014-07-18 18:17:44 +0000 | |||
835 | @@ -52,6 +52,6 @@ | |||
836 | 52 | # Silence spam on stderr due to fonts | 52 | # Silence spam on stderr due to fonts |
837 | 53 | # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 | 53 | # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 |
838 | 54 | # https://bugreports.qt-project.org/browse/QTBUG-36243 | 54 | # https://bugreports.qt-project.org/browse/QTBUG-36243 |
840 | 55 | plugins_qmltypes.extra = $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable Ubuntu.Components 0.1 ../../ 2>/dev/null > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes | 55 | plugins_qmltypes.extra = ALARM_BACKEND=memory $$[QT_INSTALL_BINS]/qmlplugindump -notrelocatable Ubuntu.Components 0.1 ../../ 2>/dev/null > $(INSTALL_ROOT)/$$installPath/plugins.qmltypes |
841 | 56 | 56 | ||
842 | 57 | INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_artwork_files popups_files picker_files styles_files plugins_qmltypes | 57 | INSTALLS += qmldir_file qml_files js_files artwork_files listitems_files listitems_artwork_files popups_files picker_files styles_files plugins_qmltypes |
843 | 58 | 58 | ||
844 | === modified file 'modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp' | |||
845 | --- modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-04-17 14:05:49 +0000 | |||
846 | +++ modules/Ubuntu/Components/plugin/adapters/alarmsadapter_organizer.cpp 2014-07-18 18:17:44 +0000 | |||
847 | @@ -57,17 +57,14 @@ | |||
848 | 57 | , fetchRequest(0) | 57 | , fetchRequest(0) |
849 | 58 | { | 58 | { |
850 | 59 | QString envManager(qgetenv("ALARM_BACKEND")); | 59 | QString envManager(qgetenv("ALARM_BACKEND")); |
856 | 60 | if (!envManager.isEmpty() && QOrganizerManager::availableManagers().contains(envManager)) { | 60 | if (envManager.isEmpty()) |
857 | 61 | manager = new QOrganizerManager(envManager); | 61 | envManager = ALARM_MANAGER; |
858 | 62 | } else { | 62 | if (!QOrganizerManager::availableManagers().contains(envManager)) { |
859 | 63 | manager = QOrganizerManager::availableManagers().contains(ALARM_MANAGER) ? | 63 | qWarning() << "WARNING: alarm manager" << envManager << "not installed, using" << QString(ALARM_MANAGER_FALLBACK); |
860 | 64 | new QOrganizerManager(ALARM_MANAGER) : new QOrganizerManager(ALARM_MANAGER_FALLBACK); | 64 | envManager = ALARM_MANAGER_FALLBACK; |
861 | 65 | } | 65 | } |
862 | 66 | manager = new QOrganizerManager(envManager); | ||
863 | 66 | manager->setParent(q_ptr); | 67 | manager->setParent(q_ptr); |
864 | 67 | if (manager->managerName() != ALARM_MANAGER) { | ||
865 | 68 | qWarning() << "WARNING: default alarm manager not installed, using" << manager->managerName() << "manager."; | ||
866 | 69 | qWarning() << "This manager may not provide all the needed features."; | ||
867 | 70 | } | ||
868 | 71 | 68 | ||
869 | 72 | QList<QOrganizerCollection> collections = manager->collections(); | 69 | QList<QOrganizerCollection> collections = manager->collections(); |
870 | 73 | if (collections.count() > 0) { | 70 | if (collections.count() > 0) { |
871 | 74 | 71 | ||
872 | === modified file 'modules/Ubuntu/Components/plugin/plugin.cpp' | |||
873 | --- modules/Ubuntu/Components/plugin/plugin.cpp 2014-06-10 11:47:09 +0000 | |||
874 | +++ modules/Ubuntu/Components/plugin/plugin.cpp 2014-07-18 18:17:44 +0000 | |||
875 | @@ -92,7 +92,14 @@ | |||
876 | 92 | return uriHandler; | 92 | return uriHandler; |
877 | 93 | } | 93 | } |
878 | 94 | 94 | ||
880 | 95 | static QObject *registerUbuntuColors(QQmlEngine *engine, QJSEngine *scriptEngine) | 95 | static QObject *registerUbuntuColors10(QQmlEngine *engine, QJSEngine *scriptEngine) |
881 | 96 | { | ||
882 | 97 | Q_UNUSED(scriptEngine) | ||
883 | 98 | return UbuntuComponentsPlugin::registerQmlSingletonType(engine, | ||
884 | 99 | "Ubuntu.Components", "Colors/UbuntuColors10.qml"); | ||
885 | 100 | } | ||
886 | 101 | |||
887 | 102 | static QObject *registerUbuntuColors11(QQmlEngine *engine, QJSEngine *scriptEngine) | ||
888 | 96 | { | 103 | { |
889 | 97 | Q_UNUSED(scriptEngine) | 104 | Q_UNUSED(scriptEngine) |
890 | 98 | return UbuntuComponentsPlugin::registerQmlSingletonType(engine, | 105 | return UbuntuComponentsPlugin::registerQmlSingletonType(engine, |
891 | @@ -154,7 +161,7 @@ | |||
892 | 154 | 161 | ||
893 | 155 | void UbuntuComponentsPlugin::registerTypesToVersion(const char *uri, int major, int minor) | 162 | void UbuntuComponentsPlugin::registerTypesToVersion(const char *uri, int major, int minor) |
894 | 156 | { | 163 | { |
896 | 157 | qmlRegisterSingletonType<QObject>(uri, major, minor, "UbuntuColors", registerUbuntuColors); | 164 | qmlRegisterSingletonType<QObject>(uri, major, minor, "UbuntuColors", registerUbuntuColors10); |
897 | 158 | qmlRegisterUncreatableType<UbuntuI18n>(uri, major, minor, "i18n", "Singleton object"); | 165 | qmlRegisterUncreatableType<UbuntuI18n>(uri, major, minor, "i18n", "Singleton object"); |
898 | 159 | qmlRegisterExtendedType<QQuickImageBase, UCQQuickImageExtension>(uri, major, minor, "QQuickImageBase"); | 166 | qmlRegisterExtendedType<QQuickImageBase, UCQQuickImageExtension>(uri, major, minor, "QQuickImageBase"); |
899 | 160 | qmlRegisterUncreatableType<UCUnits>(uri, major, minor, "UCUnits", "Not instantiable"); | 167 | qmlRegisterUncreatableType<UCUnits>(uri, major, minor, "UCUnits", "Not instantiable"); |
900 | @@ -184,6 +191,7 @@ | |||
901 | 184 | // register 0.1 for backward compatibility | 191 | // register 0.1 for backward compatibility |
902 | 185 | registerTypesToVersion(uri, 0, 1); | 192 | registerTypesToVersion(uri, 0, 1); |
903 | 186 | registerTypesToVersion(uri, 1, 0); | 193 | registerTypesToVersion(uri, 1, 0); |
904 | 194 | qmlRegisterSingletonType<QObject>(uri, 1, 1, "UbuntuColors", registerUbuntuColors11); | ||
905 | 187 | 195 | ||
906 | 188 | // register custom event | 196 | // register custom event |
907 | 189 | ForwardedEvent::registerForwardedEvent(); | 197 | ForwardedEvent::registerForwardedEvent(); |
908 | 190 | 198 | ||
909 | === modified file 'modules/Ubuntu/Components/qmldir' | |||
910 | --- modules/Ubuntu/Components/qmldir 2014-07-03 13:59:52 +0000 | |||
911 | +++ modules/Ubuntu/Components/qmldir 2014-07-18 18:17:44 +0000 | |||
912 | @@ -15,7 +15,7 @@ | |||
913 | 15 | Label 0.1 Label.qml | 15 | Label 0.1 Label.qml |
914 | 16 | AbstractButton 0.1 AbstractButton.qml | 16 | AbstractButton 0.1 AbstractButton.qml |
915 | 17 | ActivityIndicator 0.1 ActivityIndicator.qml | 17 | ActivityIndicator 0.1 ActivityIndicator.qml |
917 | 18 | ProgressBar 0.1 ProgressBar.qml | 18 | ProgressBar 0.1 ProgressBar10.qml |
918 | 19 | TextField 0.1 TextField.qml | 19 | TextField 0.1 TextField.qml |
919 | 20 | TextArea 0.1 TextArea.qml | 20 | TextArea 0.1 TextArea.qml |
920 | 21 | Switch 0.1 Switch.qml | 21 | Switch 0.1 Switch.qml |
921 | @@ -65,7 +65,7 @@ | |||
922 | 65 | Label 1.0 Label.qml | 65 | Label 1.0 Label.qml |
923 | 66 | AbstractButton 1.0 AbstractButton.qml | 66 | AbstractButton 1.0 AbstractButton.qml |
924 | 67 | ActivityIndicator 1.0 ActivityIndicator.qml | 67 | ActivityIndicator 1.0 ActivityIndicator.qml |
926 | 68 | ProgressBar 1.0 ProgressBar.qml | 68 | ProgressBar 1.0 ProgressBar10.qml |
927 | 69 | TextField 1.0 TextField.qml | 69 | TextField 1.0 TextField.qml |
928 | 70 | TextArea 1.0 TextArea.qml | 70 | TextArea 1.0 TextArea.qml |
929 | 71 | Switch 1.0 Switch.qml | 71 | Switch 1.0 Switch.qml |
930 | @@ -93,6 +93,7 @@ | |||
931 | 93 | 93 | ||
932 | 94 | #version 1.1 | 94 | #version 1.1 |
933 | 95 | ComboButton 1.1 ComboButton.qml | 95 | ComboButton 1.1 ComboButton.qml |
934 | 96 | ProgressBar 1.1 ProgressBar11.qml | ||
935 | 96 | CrossFadeImage 1.1 CrossFadeImage11.qml | 97 | CrossFadeImage 1.1 CrossFadeImage11.qml |
936 | 97 | PullToRefresh 1.1 PullToRefresh.qml | 98 | PullToRefresh 1.1 PullToRefresh.qml |
937 | 98 | UbuntuListView 1.1 UbuntuListView11.qml | 99 | UbuntuListView 1.1 UbuntuListView11.qml |
938 | 99 | 100 | ||
939 | === modified file 'modules/Ubuntu/Test/UbuntuTestCase.qml' | |||
940 | --- modules/Ubuntu/Test/UbuntuTestCase.qml 2014-06-19 08:15:49 +0000 | |||
941 | +++ modules/Ubuntu/Test/UbuntuTestCase.qml 2014-07-18 18:17:44 +0000 | |||
942 | @@ -223,5 +223,14 @@ | |||
943 | 223 | throw new Error("QtQuickTest::fail") | 223 | throw new Error("QtQuickTest::fail") |
944 | 224 | } | 224 | } |
945 | 225 | } | 225 | } |
947 | 226 | } | 226 | |
948 | 227 | /*! | ||
949 | 228 | Convenience function to allow typing a full string instead of single characters | ||
950 | 229 | */ | ||
951 | 230 | function typeString(string) { | ||
952 | 231 | for (var i = 0; i < string.length; i++) { | ||
953 | 232 | keyClick(string[i]); | ||
954 | 233 | } | ||
955 | 234 | } | ||
956 | 235 | } | ||
957 | 227 | 236 | ||
958 | 228 | 237 | ||
959 | === modified file 'tests/autopilot/ubuntuuitoolkit/__init__.py' | |||
960 | --- tests/autopilot/ubuntuuitoolkit/__init__.py 2014-06-30 10:49:51 +0000 | |||
961 | +++ tests/autopilot/ubuntuuitoolkit/__init__.py 2014-07-18 18:17:44 +0000 | |||
962 | @@ -41,6 +41,7 @@ | |||
963 | 41 | 'TextField', | 41 | 'TextField', |
964 | 42 | 'Toolbar', | 42 | 'Toolbar', |
965 | 43 | 'ToolkitException', | 43 | 'ToolkitException', |
966 | 44 | 'ubuntu_scenarios', | ||
967 | 44 | 'UbuntuListView11', | 45 | 'UbuntuListView11', |
968 | 45 | 'UbuntuUIToolkitCustomProxyObjectBase', | 46 | 'UbuntuUIToolkitCustomProxyObjectBase', |
969 | 46 | ] | 47 | ] |
970 | @@ -52,6 +53,7 @@ | |||
971 | 52 | environment, | 53 | environment, |
972 | 53 | fixture_setup, | 54 | fixture_setup, |
973 | 54 | tests, | 55 | tests, |
974 | 56 | ubuntu_scenarios | ||
975 | 55 | ) | 57 | ) |
976 | 56 | from ubuntuuitoolkit._custom_proxy_objects import ( | 58 | from ubuntuuitoolkit._custom_proxy_objects import ( |
977 | 57 | AppHeader, | 59 | AppHeader, |
978 | 58 | 60 | ||
979 | === modified file 'tests/autopilot/ubuntuuitoolkit/base.py' | |||
980 | --- tests/autopilot/ubuntuuitoolkit/base.py 2014-01-14 00:44:05 +0000 | |||
981 | +++ tests/autopilot/ubuntuuitoolkit/base.py 2014-07-18 18:17:44 +0000 | |||
982 | @@ -1,6 +1,6 @@ | |||
983 | 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 -*- |
984 | 2 | # | 2 | # |
986 | 3 | # Copyright (C) 2013 Canonical Ltd. | 3 | # Copyright (C) 2013, 2014 Canonical Ltd. |
987 | 4 | # | 4 | # |
988 | 5 | # This program is free software; you can redistribute it and/or modify | 5 | # This program is free software; you can redistribute it and/or modify |
989 | 6 | # it under the terms of the GNU Lesser General Public License as published by | 6 | # it under the terms of the GNU Lesser General Public License as published by |
990 | @@ -16,6 +16,7 @@ | |||
991 | 16 | 16 | ||
992 | 17 | """Base classes for Autopilot tests using the Ubuntu UI Toolkit.""" | 17 | """Base classes for Autopilot tests using the Ubuntu UI Toolkit.""" |
993 | 18 | 18 | ||
994 | 19 | import os | ||
995 | 19 | import subprocess | 20 | import subprocess |
996 | 20 | 21 | ||
997 | 21 | from autopilot import ( | 22 | from autopilot import ( |
998 | @@ -25,14 +26,21 @@ | |||
999 | 25 | ) | 26 | ) |
1000 | 26 | 27 | ||
1001 | 27 | 28 | ||
1002 | 29 | def get_host_multiarch(): | ||
1003 | 30 | if 'deb_host_multiarch' not in os.environ: | ||
1004 | 31 | # Discard errors: the one known message is "GCC not installed" | ||
1005 | 32 | os.environ['deb_host_multiarch'] = subprocess.check_output( | ||
1006 | 33 | ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], | ||
1007 | 34 | universal_newlines=True, stderr=subprocess.PIPE).strip() | ||
1008 | 35 | return os.environ['deb_host_multiarch'] | ||
1009 | 36 | |||
1010 | 37 | |||
1011 | 28 | def get_qmlscene_launch_command(): | 38 | def get_qmlscene_launch_command(): |
1012 | 29 | """Return the command to launch qmlscene for autopilot tests.""" | 39 | """Return the command to launch qmlscene for autopilot tests.""" |
1013 | 30 | # We need to specify qt5 because qtchooser doesn't have a default | 40 | # We need to specify qt5 because qtchooser doesn't have a default |
1014 | 31 | # configuration on devices and it seems the environment variable | 41 | # configuration on devices and it seems the environment variable |
1015 | 32 | # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-03 | 42 | # QT_SELECT=qt5 doesn't work for autopilot tests. --Mirv - 2013-10-03 |
1019 | 33 | arch = subprocess.check_output( | 43 | arch = get_host_multiarch() |
1017 | 34 | ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], | ||
1018 | 35 | universal_newlines=True).strip() | ||
1020 | 36 | return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch) | 44 | return '/usr/lib/{}/qt5/bin/qmlscene'.format(arch) |
1021 | 37 | 45 | ||
1022 | 38 | 46 | ||
1023 | 39 | 47 | ||
1024 | === modified file 'tests/autopilot/ubuntuuitoolkit/fixture_setup.py' | |||
1025 | --- tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-05-26 06:40:24 +0000 | |||
1026 | +++ tests/autopilot/ubuntuuitoolkit/fixture_setup.py 2014-07-18 18:17:44 +0000 | |||
1027 | @@ -15,11 +15,14 @@ | |||
1028 | 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/>. |
1029 | 16 | 16 | ||
1030 | 17 | import copy | 17 | import copy |
1031 | 18 | import logging | ||
1032 | 18 | import os | 19 | import os |
1033 | 19 | import shutil | 20 | import shutil |
1034 | 20 | import tempfile | 21 | import tempfile |
1035 | 21 | 22 | ||
1036 | 22 | import fixtures | 23 | import fixtures |
1037 | 24 | from autopilot import display | ||
1038 | 25 | from gi.repository import Gio | ||
1039 | 23 | 26 | ||
1040 | 24 | from ubuntuuitoolkit import base, environment | 27 | from ubuntuuitoolkit import base, environment |
1041 | 25 | 28 | ||
1042 | @@ -46,6 +49,9 @@ | |||
1043 | 46 | } | 49 | } |
1044 | 47 | 50 | ||
1045 | 48 | 51 | ||
1046 | 52 | logger = logging.getLogger(__name__) | ||
1047 | 53 | |||
1048 | 54 | |||
1049 | 49 | class FakeApplication(fixtures.Fixture): | 55 | class FakeApplication(fixtures.Fixture): |
1050 | 50 | 56 | ||
1051 | 51 | def __init__( | 57 | def __init__( |
1052 | @@ -163,3 +169,82 @@ | |||
1053 | 163 | shutil.copyfile( | 169 | shutil.copyfile( |
1054 | 164 | xauthority_file_path, | 170 | xauthority_file_path, |
1055 | 165 | os.path.join(directory, '.Xauthority')) | 171 | os.path.join(directory, '.Xauthority')) |
1056 | 172 | |||
1057 | 173 | |||
1058 | 174 | class HideUnity7Launcher(fixtures.Fixture): | ||
1059 | 175 | |||
1060 | 176 | """Hide the Unity7 launcher if it is visible and restore it on clean up.""" | ||
1061 | 177 | |||
1062 | 178 | _UNITYSHELL_GSETTINGS_SCHEMA = 'org.compiz.unityshell' | ||
1063 | 179 | _UNITYSHELL_GSETTINGS_PATH = ( | ||
1064 | 180 | '/org/compiz/profiles/unity/plugins/unityshell/') | ||
1065 | 181 | _UNITYSHELL_LAUNCHER_KEY = 'launcher-hide-mode' | ||
1066 | 182 | _UNITYSHELL_LAUNCHER_HIDDEN_MODE = 1 # launcher hidden | ||
1067 | 183 | |||
1068 | 184 | def setUp(self): | ||
1069 | 185 | super(HideUnity7Launcher, self).setUp() | ||
1070 | 186 | self._hide_launcher() | ||
1071 | 187 | |||
1072 | 188 | def _hide_launcher(self): | ||
1073 | 189 | if (self._UNITYSHELL_GSETTINGS_SCHEMA in | ||
1074 | 190 | Gio.Settings.list_relocatable_schemas()): | ||
1075 | 191 | unityshell_schema = Gio.Settings.new_with_path( | ||
1076 | 192 | self._UNITYSHELL_GSETTINGS_SCHEMA, | ||
1077 | 193 | self._UNITYSHELL_GSETTINGS_PATH) | ||
1078 | 194 | self._hide_launcher_from_schema(unityshell_schema) | ||
1079 | 195 | else: | ||
1080 | 196 | logger.warning('Unity Shell gsettings schema not found.') | ||
1081 | 197 | |||
1082 | 198 | def _hide_launcher_from_schema(self, unityshell_schema): | ||
1083 | 199 | original_mode = self._get_launcher_mode(unityshell_schema) | ||
1084 | 200 | self.addCleanup( | ||
1085 | 201 | self._set_launcher_mode, unityshell_schema, original_mode) | ||
1086 | 202 | self._set_launcher_mode( | ||
1087 | 203 | unityshell_schema, self._UNITYSHELL_LAUNCHER_HIDDEN_MODE) | ||
1088 | 204 | |||
1089 | 205 | def _get_launcher_mode(self, unityshell_schema): | ||
1090 | 206 | return unityshell_schema.get_int(self._UNITYSHELL_LAUNCHER_KEY) | ||
1091 | 207 | |||
1092 | 208 | def _set_launcher_mode(self, unityshell_schema, mode): | ||
1093 | 209 | unityshell_schema.set_int(self._UNITYSHELL_LAUNCHER_KEY, mode) | ||
1094 | 210 | |||
1095 | 211 | |||
1096 | 212 | class SimulateDevice(fixtures.Fixture): | ||
1097 | 213 | |||
1098 | 214 | def __init__(self, app_width, app_height, grid_unit_px): | ||
1099 | 215 | super(SimulateDevice, self).__init__() | ||
1100 | 216 | self.app_width = app_width | ||
1101 | 217 | self.app_height = app_height | ||
1102 | 218 | self.grid_unit_px = grid_unit_px | ||
1103 | 219 | self._screen = None | ||
1104 | 220 | |||
1105 | 221 | def setUp(self): | ||
1106 | 222 | super(SimulateDevice, self).setUp() | ||
1107 | 223 | if self._is_geometry_larger_than_display( | ||
1108 | 224 | self.app_width, self.app_height): | ||
1109 | 225 | scale_divisor = self._get_scale_divisor() | ||
1110 | 226 | self.grid_unit_px = self.grid_unit_px // scale_divisor | ||
1111 | 227 | self.app_width = self.app_width // scale_divisor | ||
1112 | 228 | self.app_height = self.app_height // scale_divisor | ||
1113 | 229 | self.useFixture( | ||
1114 | 230 | fixtures.EnvironmentVariable( | ||
1115 | 231 | 'GRID_UNIT_PX', str(self.grid_unit_px))) | ||
1116 | 232 | |||
1117 | 233 | def _get_scale_divisor(self): | ||
1118 | 234 | scale_divisor = 2 | ||
1119 | 235 | while self._is_geometry_larger_than_display( | ||
1120 | 236 | self.app_width // scale_divisor, | ||
1121 | 237 | self.app_height // scale_divisor): | ||
1122 | 238 | scale_divisor = scale_divisor * 2 | ||
1123 | 239 | return scale_divisor | ||
1124 | 240 | |||
1125 | 241 | def _is_geometry_larger_than_display(self, width, height): | ||
1126 | 242 | screen = self._get_screen() | ||
1127 | 243 | screen_width = screen.get_screen_width() | ||
1128 | 244 | screen_height = screen.get_screen_height() | ||
1129 | 245 | return (width > screen_width) or (height > screen_height) | ||
1130 | 246 | |||
1131 | 247 | def _get_screen(self): | ||
1132 | 248 | if self._screen is None: | ||
1133 | 249 | self._screen = display.Display.create() | ||
1134 | 250 | return self._screen | ||
1135 | 166 | 251 | ||
1136 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/__init__.py' | |||
1137 | --- tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-06-16 12:07:41 +0000 | |||
1138 | +++ tests/autopilot/ubuntuuitoolkit/tests/__init__.py 2014-07-18 18:17:44 +0000 | |||
1139 | @@ -60,8 +60,8 @@ | |||
1140 | 60 | os.path.dirname(__file__), '..', '..', '..', '..')) | 60 | os.path.dirname(__file__), '..', '..', '..', '..')) |
1141 | 61 | 61 | ||
1142 | 62 | 62 | ||
1145 | 63 | class QMLStringAppTestCase(base.UbuntuUIToolkitAppTestCase): | 63 | class UbuntuUIToolkitWithFakeAppRunningTestCase( |
1146 | 64 | """Base test case for self tests that define the QML on an string.""" | 64 | base.UbuntuUIToolkitAppTestCase): |
1147 | 65 | 65 | ||
1148 | 66 | test_qml = (""" | 66 | test_qml = (""" |
1149 | 67 | import QtQuick 2.0 | 67 | import QtQuick 2.0 |
1150 | @@ -69,13 +69,12 @@ | |||
1151 | 69 | 69 | ||
1152 | 70 | MainView { | 70 | MainView { |
1153 | 71 | width: units.gu(48) | 71 | width: units.gu(48) |
1155 | 72 | height: units.gu(60) | 72 | height: units.gu(80) |
1156 | 73 | } | 73 | } |
1157 | 74 | """) | 74 | """) |
1158 | 75 | 75 | ||
1159 | 76 | def setUp(self): | 76 | def setUp(self): |
1162 | 77 | super(QMLStringAppTestCase, self).setUp() | 77 | super(UbuntuUIToolkitWithFakeAppRunningTestCase, self).setUp() |
1161 | 78 | self.pointing_device = Pointer(self.input_device_class.create()) | ||
1163 | 79 | self.launch_application() | 78 | self.launch_application() |
1164 | 80 | 79 | ||
1165 | 81 | def launch_application(self): | 80 | def launch_application(self): |
1166 | @@ -83,18 +82,24 @@ | |||
1167 | 83 | qml_file_contents=self.test_qml) | 82 | qml_file_contents=self.test_qml) |
1168 | 84 | self.useFixture(fake_application) | 83 | self.useFixture(fake_application) |
1169 | 85 | 84 | ||
1179 | 86 | self.app = self.launch_test_application( | 85 | desktop_file_name = os.path.basename( |
1180 | 87 | base.get_qmlscene_launch_command(), | 86 | fake_application.desktop_file_path) |
1181 | 88 | '-I' + _get_module_include_path(), | 87 | application_name, _ = os.path.splitext(desktop_file_name) |
1182 | 89 | fake_application.qml_file_path, | 88 | self.app = self.launch_upstart_application( |
1183 | 90 | '--desktop_file_hint={0}'.format( | 89 | application_name, |
1184 | 91 | fake_application.desktop_file_path), | 90 | emulator_base=emulators.UbuntuUIToolkitEmulatorBase) |
1185 | 92 | emulator_base=emulators.UbuntuUIToolkitEmulatorBase, | 91 | |
1186 | 93 | app_type='qt') | 92 | |
1187 | 94 | 93 | class QMLStringAppTestCase(UbuntuUIToolkitWithFakeAppRunningTestCase): | |
1188 | 94 | """Base test case for self tests that define the QML on an string.""" | ||
1189 | 95 | |||
1190 | 96 | def setUp(self): | ||
1191 | 97 | super(QMLStringAppTestCase, self).setUp() | ||
1192 | 95 | self.assertThat( | 98 | self.assertThat( |
1193 | 96 | self.main_view.visible, Eventually(Equals(True))) | 99 | self.main_view.visible, Eventually(Equals(True))) |
1194 | 97 | 100 | ||
1195 | 101 | self.pointing_device = Pointer(self.input_device_class.create()) | ||
1196 | 102 | |||
1197 | 98 | @property | 103 | @property |
1198 | 99 | def main_view(self): | 104 | def main_view(self): |
1199 | 100 | return self.app.select_single(emulators.MainView) | 105 | return self.app.select_single(emulators.MainView) |
1200 | 101 | 106 | ||
1201 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py' | |||
1202 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-06-17 07:12:49 +0000 | |||
1203 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-07-18 18:17:44 +0000 | |||
1204 | @@ -15,7 +15,6 @@ | |||
1205 | 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/>. |
1206 | 16 | 16 | ||
1207 | 17 | import os | 17 | import os |
1208 | 18 | import subprocess | ||
1209 | 19 | 18 | ||
1210 | 20 | import testtools | 19 | import testtools |
1211 | 21 | import ubuntuuitoolkit | 20 | import ubuntuuitoolkit |
1212 | @@ -207,9 +206,7 @@ | |||
1213 | 207 | if os.path.exists(path_to_local_launcher): | 206 | if os.path.exists(path_to_local_launcher): |
1214 | 208 | return path_to_local_launcher | 207 | return path_to_local_launcher |
1215 | 209 | else: | 208 | else: |
1219 | 210 | arch = subprocess.check_output( | 209 | arch = ubuntuuitoolkit.base.get_host_multiarch() |
1217 | 211 | ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], | ||
1218 | 212 | universal_newlines=True).strip() | ||
1220 | 213 | path_to_installed_launcher = os.path.join( | 210 | path_to_installed_launcher = os.path.join( |
1221 | 214 | '/', 'usr', 'lib', arch, 'ubuntu-ui-toolkit', 'launcher') | 211 | '/', 'usr', 'lib', arch, 'ubuntu-ui-toolkit', 'launcher') |
1222 | 215 | return path_to_installed_launcher | 212 | return path_to_installed_launcher |
1223 | 216 | 213 | ||
1224 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py' | |||
1225 | --- tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2014-06-04 18:45:04 +0000 | |||
1226 | +++ tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py 2014-07-18 18:17:44 +0000 | |||
1227 | @@ -19,24 +19,71 @@ | |||
1228 | 19 | import os | 19 | import os |
1229 | 20 | import shutil | 20 | import shutil |
1230 | 21 | 21 | ||
1231 | 22 | from autopilot.matchers import Eventually | ||
1232 | 23 | from testtools.matchers import Equals | ||
1233 | 24 | |||
1234 | 22 | import ubuntuuitoolkit | 25 | import ubuntuuitoolkit |
1235 | 26 | from ubuntuuitoolkit import fixture_setup | ||
1236 | 23 | 27 | ||
1237 | 24 | 28 | ||
1238 | 25 | class GalleryTestCase(ubuntuuitoolkit.tests.QMLFileAppTestCase): | 29 | class GalleryTestCase(ubuntuuitoolkit.tests.QMLFileAppTestCase): |
1239 | 30 | |||
1240 | 26 | """Base class for gallery test cases.""" | 31 | """Base class for gallery test cases.""" |
1241 | 27 | 32 | ||
1242 | 28 | local_desktop_file_path = None | 33 | local_desktop_file_path = None |
1243 | 29 | 34 | ||
1244 | 30 | def setUp(self): | 35 | def setUp(self): |
1250 | 31 | if self._application_source_exists(): | 36 | self.test_source_path = self._get_test_source_path() |
1246 | 32 | self.test_source_path = self._get_path_to_gallery_source() | ||
1247 | 33 | else: | ||
1248 | 34 | self.test_source_path = self._get_path_to_installed_gallery() | ||
1249 | 35 | assert os.path.exists(self.test_source_path) | ||
1251 | 36 | self.test_qml_file_path = self._get_test_qml_file_path() | 37 | self.test_qml_file_path = self._get_test_qml_file_path() |
1252 | 37 | self.desktop_file_path = self._get_desktop_file_path() | 38 | self.desktop_file_path = self._get_desktop_file_path() |
1253 | 39 | |||
1254 | 40 | if self.should_simulate_device(): | ||
1255 | 41 | # Hide the Unity7 launcher because it takes space that might be | ||
1256 | 42 | # needed by the app with the simulated size. | ||
1257 | 43 | self.useFixture(fixture_setup.HideUnity7Launcher()) | ||
1258 | 44 | # This sets the grid units, so it should be called before launching | ||
1259 | 45 | # the app. | ||
1260 | 46 | self.simulate_device() | ||
1261 | 47 | |||
1262 | 38 | super(GalleryTestCase, self).setUp() | 48 | super(GalleryTestCase, self).setUp() |
1263 | 39 | 49 | ||
1264 | 50 | if self.should_simulate_device(): | ||
1265 | 51 | # XXX Currently we have no way to launch the application with a | ||
1266 | 52 | # specific size, so we must resize it after it's launched. | ||
1267 | 53 | # --elopio - 2014-06-25 | ||
1268 | 54 | self.resize_window() | ||
1269 | 55 | |||
1270 | 56 | def should_simulate_device(self): | ||
1271 | 57 | return (hasattr(self, 'app_width') and hasattr(self, 'app_height') and | ||
1272 | 58 | hasattr(self, 'grid_unit_px')) | ||
1273 | 59 | |||
1274 | 60 | def simulate_device(self): | ||
1275 | 61 | simulate_device_fixture = self.useFixture(fixture_setup.SimulateDevice( | ||
1276 | 62 | self.app_width, self.app_height, self.grid_unit_px)) | ||
1277 | 63 | self.app_width = simulate_device_fixture.app_width | ||
1278 | 64 | self.app_height = simulate_device_fixture.app_height | ||
1279 | 65 | |||
1280 | 66 | def resize_window(self): | ||
1281 | 67 | application = self.process_manager.get_running_applications()[0] | ||
1282 | 68 | window = application.get_windows()[0] | ||
1283 | 69 | window.resize(self.app_width, self.app_height) | ||
1284 | 70 | |||
1285 | 71 | def get_window_size(): | ||
1286 | 72 | _, _, window_width, window_height = window.geometry | ||
1287 | 73 | return window_width, window_height | ||
1288 | 74 | |||
1289 | 75 | self.assertThat( | ||
1290 | 76 | get_window_size, | ||
1291 | 77 | Eventually(Equals((self.app_width, self.app_height)))) | ||
1292 | 78 | |||
1293 | 79 | def _get_test_source_path(self): | ||
1294 | 80 | if self._application_source_exists(): | ||
1295 | 81 | test_source_path = self._get_path_to_gallery_source() | ||
1296 | 82 | else: | ||
1297 | 83 | test_source_path = self._get_path_to_installed_gallery() | ||
1298 | 84 | assert os.path.exists(test_source_path) | ||
1299 | 85 | return test_source_path | ||
1300 | 86 | |||
1301 | 40 | def _get_path_to_gallery_source(self): | 87 | def _get_path_to_gallery_source(self): |
1302 | 41 | return os.path.join( | 88 | return os.path.join( |
1303 | 42 | ubuntuuitoolkit.tests.get_path_to_source_root(), 'examples', | 89 | ubuntuuitoolkit.tests.get_path_to_source_root(), 'examples', |
1304 | 43 | 90 | ||
1305 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py' | |||
1306 | --- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-05-30 14:24:27 +0000 | |||
1307 | +++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_buttons.py 2014-07-18 18:17:44 +0000 | |||
1308 | @@ -1,6 +1,6 @@ | |||
1309 | 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 -*- |
1310 | 2 | # | 2 | # |
1312 | 3 | # Copyright (C) 2012, 2013 Canonical Ltd. | 3 | # Copyright (C) 2012, 2013, 2014 Canonical Ltd. |
1313 | 4 | # | 4 | # |
1314 | 5 | # This program is free software; you can redistribute it and/or modify | 5 | # This program is free software; you can redistribute it and/or modify |
1315 | 6 | # it under the terms of the GNU Lesser General Public License as published by | 6 | # it under the terms of the GNU Lesser General Public License as published by |
1316 | @@ -16,14 +16,19 @@ | |||
1317 | 16 | 16 | ||
1318 | 17 | """Tests for the Ubuntu UI Toolkit Gallery - Button component""" | 17 | """Tests for the Ubuntu UI Toolkit Gallery - Button component""" |
1319 | 18 | 18 | ||
1320 | 19 | import testscenarios | ||
1321 | 19 | from autopilot.matchers import Eventually | 20 | from autopilot.matchers import Eventually |
1322 | 20 | from testtools.matchers import Equals | 21 | from testtools.matchers import Equals |
1329 | 21 | from ubuntuuitoolkit.tests.gallery import GalleryTestCase | 22 | |
1330 | 22 | 23 | from ubuntuuitoolkit import ubuntu_scenarios | |
1331 | 23 | 24 | from ubuntuuitoolkit.tests import gallery | |
1332 | 24 | class ButtonsTestCase(GalleryTestCase): | 25 | |
1333 | 25 | 26 | import os | |
1334 | 26 | scenarios = [ | 27 | |
1335 | 28 | |||
1336 | 29 | class ButtonsTestCase(gallery.GalleryTestCase): | ||
1337 | 30 | |||
1338 | 31 | buttons_scenarios = [ | ||
1339 | 27 | ('standard button', dict( | 32 | ('standard button', dict( |
1340 | 28 | button_name="button_text", is_enabled=True, color=None, icon=None, | 33 | button_name="button_text", is_enabled=True, color=None, icon=None, |
1341 | 29 | text="Call")), | 34 | text="Call")), |
1342 | @@ -44,6 +49,15 @@ | |||
1343 | 44 | icon=None, text="Call")) | 49 | icon=None, text="Call")) |
1344 | 45 | ] | 50 | ] |
1345 | 46 | 51 | ||
1346 | 52 | scenarios = testscenarios.multiply_scenarios( | ||
1347 | 53 | ubuntu_scenarios.get_device_simulation_scenarios(), | ||
1348 | 54 | buttons_scenarios) | ||
1349 | 55 | |||
1350 | 56 | def setUp(self): | ||
1351 | 57 | # Reset the locale to English | ||
1352 | 58 | os.environ['LANGUAGE'] = 'en' | ||
1353 | 59 | super(ButtonsTestCase, self).setUp() | ||
1354 | 60 | |||
1355 | 47 | def test_buttons(self): | 61 | def test_buttons(self): |
1356 | 48 | self.open_page('buttonsElement') | 62 | self.open_page('buttonsElement') |
1357 | 49 | 63 | ||
1358 | 50 | 64 | ||
1359 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py' | |||
1360 | --- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-06-18 05:35:24 +0000 | |||
1361 | +++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_gallery.py 2014-07-18 18:17:44 +0000 | |||
1362 | @@ -16,13 +16,18 @@ | |||
1363 | 16 | 16 | ||
1364 | 17 | """Tests for the Ubuntu UI Toolkit Gallery""" | 17 | """Tests for the Ubuntu UI Toolkit Gallery""" |
1365 | 18 | 18 | ||
1366 | 19 | import testscenarios | ||
1367 | 20 | |||
1368 | 19 | import ubuntuuitoolkit | 21 | import ubuntuuitoolkit |
1369 | 22 | from ubuntuuitoolkit import ubuntu_scenarios | ||
1370 | 20 | from ubuntuuitoolkit.tests import gallery | 23 | from ubuntuuitoolkit.tests import gallery |
1371 | 21 | 24 | ||
1372 | 22 | 25 | ||
1373 | 23 | class GalleryAppTestCase(gallery.GalleryTestCase): | 26 | class GalleryAppTestCase(gallery.GalleryTestCase): |
1374 | 24 | """Generic tests for the Gallery""" | 27 | """Generic tests for the Gallery""" |
1375 | 25 | 28 | ||
1376 | 29 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios() | ||
1377 | 30 | |||
1378 | 26 | def test_select_main_view_must_return_main_window_emulator(self): | 31 | def test_select_main_view_must_return_main_window_emulator(self): |
1379 | 27 | main_view = self.main_view | 32 | main_view = self.main_view |
1380 | 28 | self.assertIsInstance(main_view, ubuntuuitoolkit.MainView) | 33 | self.assertIsInstance(main_view, ubuntuuitoolkit.MainView) |
1381 | @@ -91,13 +96,17 @@ | |||
1382 | 91 | 'sheets', 'animations' | 96 | 'sheets', 'animations' |
1383 | 92 | ] | 97 | ] |
1384 | 93 | 98 | ||
1386 | 94 | scenarios = [ | 99 | pages_scenarios = [ |
1387 | 95 | (name, dict( | 100 | (name, dict( |
1388 | 96 | element_name=name+'Element', | 101 | element_name=name+'Element', |
1389 | 97 | template_name=name+'Template')) | 102 | template_name=name+'Template')) |
1390 | 98 | for name in names | 103 | for name in names |
1391 | 99 | ] | 104 | ] |
1392 | 100 | 105 | ||
1393 | 106 | scenarios = testscenarios.multiply_scenarios( | ||
1394 | 107 | ubuntu_scenarios.get_device_simulation_scenarios(), | ||
1395 | 108 | pages_scenarios) | ||
1396 | 109 | |||
1397 | 101 | def test_open_page(self): | 110 | def test_open_page(self): |
1398 | 102 | self.open_page(self.element_name) | 111 | self.open_page(self.element_name) |
1399 | 103 | element = self.main_view.select_single( | 112 | element = self.main_view.select_single( |
1400 | 104 | 113 | ||
1401 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py' | |||
1402 | --- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-05-30 14:24:27 +0000 | |||
1403 | +++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_optionselector.py 2014-07-18 18:17:44 +0000 | |||
1404 | @@ -17,14 +17,20 @@ | |||
1405 | 17 | """Tests for the Ubuntu UI Toolkit Gallery - OptionSelector component.""" | 17 | """Tests for the Ubuntu UI Toolkit Gallery - OptionSelector component.""" |
1406 | 18 | 18 | ||
1407 | 19 | import ubuntuuitoolkit | 19 | import ubuntuuitoolkit |
1408 | 20 | from ubuntuuitoolkit import ubuntu_scenarios | ||
1409 | 20 | from ubuntuuitoolkit.tests.gallery import GalleryTestCase | 21 | from ubuntuuitoolkit.tests.gallery import GalleryTestCase |
1410 | 21 | 22 | ||
1411 | 22 | 23 | ||
1412 | 23 | class OptionSelectorTestCase(GalleryTestCase): | 24 | class OptionSelectorTestCase(GalleryTestCase): |
1413 | 24 | 25 | ||
1414 | 26 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios() | ||
1415 | 27 | |||
1416 | 25 | def setUp(self): | 28 | def setUp(self): |
1417 | 26 | super(OptionSelectorTestCase, self).setUp() | 29 | super(OptionSelectorTestCase, self).setUp() |
1418 | 27 | self.open_page('optionSelectorsElement') | 30 | self.open_page('optionSelectorsElement') |
1419 | 31 | # Start with the toolbar closed to make the full page visible and be | ||
1420 | 32 | # able to swipe it. | ||
1421 | 33 | self.main_view.close_toolbar() | ||
1422 | 28 | 34 | ||
1423 | 29 | def test_select_option_from_collapsed_optionselector(self): | 35 | def test_select_option_from_collapsed_optionselector(self): |
1424 | 30 | collapsed_option_selector = self.main_view.select_single( | 36 | collapsed_option_selector = self.main_view.select_single( |
1425 | 31 | 37 | ||
1426 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py' | |||
1427 | --- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py 2014-06-09 17:20:43 +0000 | |||
1428 | +++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_scrollbar.py 2014-07-18 18:17:44 +0000 | |||
1429 | @@ -16,11 +16,14 @@ | |||
1430 | 16 | 16 | ||
1431 | 17 | from autopilot import platform | 17 | from autopilot import platform |
1432 | 18 | 18 | ||
1433 | 19 | from ubuntuuitoolkit import ubuntu_scenarios | ||
1434 | 19 | from ubuntuuitoolkit.tests import gallery | 20 | from ubuntuuitoolkit.tests import gallery |
1435 | 20 | 21 | ||
1436 | 21 | 22 | ||
1437 | 22 | class ScrollBarTestCase(gallery.GalleryTestCase): | 23 | class ScrollBarTestCase(gallery.GalleryTestCase): |
1438 | 23 | 24 | ||
1439 | 25 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios() | ||
1440 | 26 | |||
1441 | 24 | def setUp(self): | 27 | def setUp(self): |
1442 | 25 | super(ScrollBarTestCase, self).setUp() | 28 | super(ScrollBarTestCase, self).setUp() |
1443 | 26 | self.open_page('navigationElement') | 29 | self.open_page('navigationElement') |
1444 | @@ -30,9 +33,12 @@ | |||
1445 | 30 | def move_mouse_to_thumb(self): | 33 | def move_mouse_to_thumb(self): |
1446 | 31 | # TODO we need a helper to move the interactive thumb. | 34 | # TODO we need a helper to move the interactive thumb. |
1447 | 32 | # --elopio 2014-05-06 | 35 | # --elopio 2014-05-06 |
1449 | 33 | thumb = self.scrollbar.select_single( | 36 | thumb = self.get_mouse_thumb() |
1450 | 37 | self.pointing_device.move_to_object(thumb) | ||
1451 | 38 | |||
1452 | 39 | def get_mouse_thumb(self): | ||
1453 | 40 | return self.scrollbar.select_single( | ||
1454 | 34 | objectName='interactiveScrollbarThumb') | 41 | objectName='interactiveScrollbarThumb') |
1455 | 35 | self.pointing_device.move_to_object(thumb) | ||
1456 | 36 | 42 | ||
1457 | 37 | def test_scrollbar_must_start_without_interactive_thumb(self): | 43 | def test_scrollbar_must_start_without_interactive_thumb(self): |
1458 | 38 | self.assertEqual(self.scrollbar.interactive, False) | 44 | self.assertEqual(self.scrollbar.interactive, False) |
1459 | @@ -57,7 +63,12 @@ | |||
1460 | 57 | self.assertEqual(flickable.is_child_visible(bottom_section), False) | 63 | self.assertEqual(flickable.is_child_visible(bottom_section), False) |
1461 | 58 | 64 | ||
1462 | 59 | self.move_mouse_to_thumb() | 65 | self.move_mouse_to_thumb() |
1465 | 60 | x, y = self.pointing_device.position() | 66 | mouse_thumb = self.get_mouse_thumb() |
1466 | 61 | self.pointing_device.drag(x, y, x, self.main_view.height) | 67 | x, y, width, height = mouse_thumb.globalRect |
1467 | 68 | start_x = stop_x = x + (width // 2) | ||
1468 | 69 | start_y = y + (height // 0.8) | ||
1469 | 70 | |||
1470 | 71 | self.pointing_device.drag( | ||
1471 | 72 | start_x, start_y, stop_x, self.main_view.height) | ||
1472 | 62 | 73 | ||
1473 | 63 | self.assertEqual(flickable.is_child_visible(bottom_section), True) | 74 | self.assertEqual(flickable.is_child_visible(bottom_section), True) |
1474 | 64 | 75 | ||
1475 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py' | |||
1476 | --- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-05-30 14:24:27 +0000 | |||
1477 | +++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_textinput.py 2014-07-18 18:17:44 +0000 | |||
1478 | @@ -16,7 +16,9 @@ | |||
1479 | 16 | 16 | ||
1480 | 17 | """Tests for the Ubuntu UI Toolkit Gallery - TextInput components""" | 17 | """Tests for the Ubuntu UI Toolkit Gallery - TextInput components""" |
1481 | 18 | 18 | ||
1483 | 19 | from ubuntuuitoolkit import emulators | 19 | import testscenarios |
1484 | 20 | |||
1485 | 21 | from ubuntuuitoolkit import emulators, ubuntu_scenarios | ||
1486 | 20 | from ubuntuuitoolkit.tests.gallery import GalleryTestCase | 22 | from ubuntuuitoolkit.tests.gallery import GalleryTestCase |
1487 | 21 | import locale | 23 | import locale |
1488 | 22 | 24 | ||
1489 | @@ -31,7 +33,7 @@ | |||
1490 | 31 | 33 | ||
1491 | 32 | # text_to_write is a function to ensure | 34 | # text_to_write is a function to ensure |
1492 | 33 | # that locale is evaluated after setUp | 35 | # that locale is evaluated after setUp |
1494 | 34 | scenarios = [ | 36 | text_input_scenarios = [ |
1495 | 35 | ('standard textfield', dict( | 37 | ('standard textfield', dict( |
1496 | 36 | objectName='textfield_standard', | 38 | objectName='textfield_standard', |
1497 | 37 | text_to_write=text_to_write_string, | 39 | text_to_write=text_to_write_string, |
1498 | @@ -49,6 +51,10 @@ | |||
1499 | 49 | expected_text='-100123')) | 51 | expected_text='-100123')) |
1500 | 50 | ] | 52 | ] |
1501 | 51 | 53 | ||
1502 | 54 | scenarios = testscenarios.multiply_scenarios( | ||
1503 | 55 | ubuntu_scenarios.get_device_simulation_scenarios(), | ||
1504 | 56 | text_input_scenarios) | ||
1505 | 57 | |||
1506 | 52 | def setUp(self): | 58 | def setUp(self): |
1507 | 53 | super(WriteAndClearTextInputTestCase, self).setUp() | 59 | super(WriteAndClearTextInputTestCase, self).setUp() |
1508 | 54 | # Apply the user locale from the environment | 60 | # Apply the user locale from the environment |
1509 | @@ -74,6 +80,8 @@ | |||
1510 | 74 | 80 | ||
1511 | 75 | class DisabledTextInputTestCase(GalleryTestCase): | 81 | class DisabledTextInputTestCase(GalleryTestCase): |
1512 | 76 | 82 | ||
1513 | 83 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios() | ||
1514 | 84 | |||
1515 | 77 | def setUp(self): | 85 | def setUp(self): |
1516 | 78 | super(DisabledTextInputTestCase, self).setUp() | 86 | super(DisabledTextInputTestCase, self).setUp() |
1517 | 79 | self.open_page('textinputsElement') | 87 | self.open_page('textinputsElement') |
1518 | 80 | 88 | ||
1519 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py' | |||
1520 | --- tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2014-05-30 14:24:27 +0000 | |||
1521 | +++ tests/autopilot/ubuntuuitoolkit/tests/gallery/test_toggles.py 2014-07-18 18:17:44 +0000 | |||
1522 | @@ -1,6 +1,6 @@ | |||
1523 | 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 -*- |
1524 | 2 | # | 2 | # |
1526 | 3 | # Copyright (C) 2012, 2013 Canonical Ltd. | 3 | # Copyright (C) 2012, 2013, 2014 Canonical Ltd. |
1527 | 4 | # | 4 | # |
1528 | 5 | # This program is free software; you can redistribute it and/or modify | 5 | # This program is free software; you can redistribute it and/or modify |
1529 | 6 | # it under the terms of the GNU Lesser General Public License as published by | 6 | # it under the terms of the GNU Lesser General Public License as published by |
1530 | @@ -14,15 +14,17 @@ | |||
1531 | 14 | # You should have received a copy of the GNU Lesser General Public License | 14 | # You should have received a copy of the GNU Lesser General Public License |
1532 | 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/>. |
1533 | 16 | 16 | ||
1535 | 17 | from ubuntuuitoolkit import emulators | 17 | import testscenarios |
1536 | 18 | |||
1537 | 19 | from testtools.matchers import Equals | ||
1538 | 20 | |||
1539 | 21 | from ubuntuuitoolkit import emulators, ubuntu_scenarios | ||
1540 | 18 | from ubuntuuitoolkit.tests import gallery | 22 | from ubuntuuitoolkit.tests import gallery |
1541 | 19 | 23 | ||
1542 | 20 | from testtools.matchers import Equals | ||
1543 | 21 | |||
1544 | 22 | 24 | ||
1545 | 23 | class EnabledTogglesTestCase(gallery.GalleryTestCase): | 25 | class EnabledTogglesTestCase(gallery.GalleryTestCase): |
1546 | 24 | 26 | ||
1548 | 25 | scenarios = [ | 27 | toggles_scenarios = [ |
1549 | 26 | ('checkbox unchecked', dict( | 28 | ('checkbox unchecked', dict( |
1550 | 27 | object_name='checkbox_unchecked', initial_state=False)), | 29 | object_name='checkbox_unchecked', initial_state=False)), |
1551 | 28 | ('checkbox checked', dict( | 30 | ('checkbox checked', dict( |
1552 | @@ -33,6 +35,10 @@ | |||
1553 | 33 | object_name='switch_checked', initial_state=True)) | 35 | object_name='switch_checked', initial_state=True)) |
1554 | 34 | ] | 36 | ] |
1555 | 35 | 37 | ||
1556 | 38 | scenarios = testscenarios.multiply_scenarios( | ||
1557 | 39 | ubuntu_scenarios.get_device_simulation_scenarios(), | ||
1558 | 40 | toggles_scenarios) | ||
1559 | 41 | |||
1560 | 36 | def setUp(self): | 42 | def setUp(self): |
1561 | 37 | super(EnabledTogglesTestCase, self).setUp() | 43 | super(EnabledTogglesTestCase, self).setUp() |
1562 | 38 | self.open_page('togglesElement') | 44 | self.open_page('togglesElement') |
1563 | @@ -49,7 +55,7 @@ | |||
1564 | 49 | 55 | ||
1565 | 50 | class DisabledTogglesTestCase(gallery.GalleryTestCase): | 56 | class DisabledTogglesTestCase(gallery.GalleryTestCase): |
1566 | 51 | 57 | ||
1568 | 52 | scenarios = [ | 58 | toggles_scenarios = [ |
1569 | 53 | ('checkbox disabled unchecked', dict( | 59 | ('checkbox disabled unchecked', dict( |
1570 | 54 | object_name='checkbox_disabled_unchecked', initial_state=False)), | 60 | object_name='checkbox_disabled_unchecked', initial_state=False)), |
1571 | 55 | ('checkbox disabled checked', dict( | 61 | ('checkbox disabled checked', dict( |
1572 | @@ -60,6 +66,10 @@ | |||
1573 | 60 | object_name='switch_disabled_checked', initial_state=True)) | 66 | object_name='switch_disabled_checked', initial_state=True)) |
1574 | 61 | ] | 67 | ] |
1575 | 62 | 68 | ||
1576 | 69 | scenarios = testscenarios.multiply_scenarios( | ||
1577 | 70 | ubuntu_scenarios.get_device_simulation_scenarios(), | ||
1578 | 71 | toggles_scenarios) | ||
1579 | 72 | |||
1580 | 63 | def setUp(self): | 73 | def setUp(self): |
1581 | 64 | super(DisabledTogglesTestCase, self).setUp() | 74 | super(DisabledTogglesTestCase, self).setUp() |
1582 | 65 | self.open_page('togglesElement') | 75 | self.open_page('togglesElement') |
1583 | 66 | 76 | ||
1584 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py' | |||
1585 | --- tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-06-03 20:10:53 +0000 | |||
1586 | +++ tests/autopilot/ubuntuuitoolkit/tests/test_fixture_setup.py 2014-07-18 18:17:44 +0000 | |||
1587 | @@ -24,10 +24,15 @@ | |||
1588 | 24 | # Python 2 add-on: python-mock. | 24 | # Python 2 add-on: python-mock. |
1589 | 25 | import mock | 25 | import mock |
1590 | 26 | import testtools | 26 | import testtools |
1593 | 27 | from autopilot import testcase as autopilot_testcase | 27 | from autopilot import ( |
1594 | 28 | from testtools.matchers import Contains, FileExists, Not | 28 | display, |
1595 | 29 | platform, | ||
1596 | 30 | testcase as autopilot_testcase | ||
1597 | 31 | ) | ||
1598 | 32 | from autopilot.matchers import Eventually | ||
1599 | 33 | from testtools.matchers import Contains, Equals, FileExists, Not | ||
1600 | 29 | 34 | ||
1602 | 30 | from ubuntuuitoolkit import base, environment, fixture_setup | 35 | from ubuntuuitoolkit import base, environment, fixture_setup, tests |
1603 | 31 | 36 | ||
1604 | 32 | 37 | ||
1605 | 33 | class FakeApplicationTestCase(testtools.TestCase): | 38 | class FakeApplicationTestCase(testtools.TestCase): |
1606 | @@ -304,3 +309,99 @@ | |||
1607 | 304 | self.assertTrue( | 309 | self.assertTrue( |
1608 | 305 | os.path.exists( | 310 | os.path.exists( |
1609 | 306 | os.path.join(os.environ.get('HOME'), '.Xauthority'))) | 311 | os.path.join(os.environ.get('HOME'), '.Xauthority'))) |
1610 | 312 | |||
1611 | 313 | |||
1612 | 314 | class HideUnity7LauncherTestCase( | ||
1613 | 315 | tests.UbuntuUIToolkitWithFakeAppRunningTestCase): | ||
1614 | 316 | |||
1615 | 317 | def setUp(self): | ||
1616 | 318 | if platform.model() != 'Desktop': | ||
1617 | 319 | self.skipTest('Unity 7 runs only on desktop.') | ||
1618 | 320 | self.useFixture(fixture_setup.HideUnity7Launcher()) | ||
1619 | 321 | super(HideUnity7LauncherTestCase, self).setUp() | ||
1620 | 322 | |||
1621 | 323 | def test_maximized_application_must_use_all_screen_width(self): | ||
1622 | 324 | application = self.process_manager.get_running_applications()[0] | ||
1623 | 325 | window = application.get_windows()[0] | ||
1624 | 326 | |||
1625 | 327 | # Maximize window. | ||
1626 | 328 | screen = display.Display.create() | ||
1627 | 329 | screen_width = screen.get_screen_width() | ||
1628 | 330 | screen_height = screen.get_screen_height() | ||
1629 | 331 | window.resize(screen_width, screen_height) | ||
1630 | 332 | |||
1631 | 333 | def get_window_width(): | ||
1632 | 334 | _, _, window_width, _ = window.geometry | ||
1633 | 335 | return window_width | ||
1634 | 336 | |||
1635 | 337 | self.assertThat( | ||
1636 | 338 | get_window_width, | ||
1637 | 339 | Eventually(Equals(screen_width))) | ||
1638 | 340 | |||
1639 | 341 | |||
1640 | 342 | class FakeDisplay(object): | ||
1641 | 343 | |||
1642 | 344 | """Fake display with fixed widht and height for use in tests.""" | ||
1643 | 345 | |||
1644 | 346 | def __init__(self, width, height): | ||
1645 | 347 | super(FakeDisplay, self).__init__() | ||
1646 | 348 | self.width = width | ||
1647 | 349 | self.height = height | ||
1648 | 350 | |||
1649 | 351 | def get_screen_width(self): | ||
1650 | 352 | return self.width | ||
1651 | 353 | |||
1652 | 354 | def get_screen_height(self): | ||
1653 | 355 | return self.height | ||
1654 | 356 | |||
1655 | 357 | |||
1656 | 358 | class SimulateDeviceTestCase(autopilot_testcase.AutopilotTestCase): | ||
1657 | 359 | |||
1658 | 360 | scenarios = [ | ||
1659 | 361 | ('Device equal to screen', { | ||
1660 | 362 | 'device_width': 100, 'device_height': 100, 'device_grid_unit': 20, | ||
1661 | 363 | 'screen_width': 100, 'screen_height': 100, | ||
1662 | 364 | 'expected_width': 100, 'expected_height': 100, | ||
1663 | 365 | 'expected_grid_unit': 20}), | ||
1664 | 366 | ('Device smaller than screen', { | ||
1665 | 367 | 'device_width': 100, 'device_height': 90, 'device_grid_unit': 20, | ||
1666 | 368 | 'screen_width': 110, 'screen_height': 100, | ||
1667 | 369 | 'expected_width': 100, 'expected_height': 90, | ||
1668 | 370 | 'expected_grid_unit': 20}), | ||
1669 | 371 | ('Device wider than screen', { | ||
1670 | 372 | 'device_width': 200, 'device_height': 90, 'device_grid_unit': 20, | ||
1671 | 373 | 'screen_width': 110, 'screen_height': 100, | ||
1672 | 374 | 'expected_width': 100, 'expected_height': 45, | ||
1673 | 375 | 'expected_grid_unit': 10}), | ||
1674 | 376 | ('Device taller than screen', { | ||
1675 | 377 | 'device_width': 100, 'device_height': 180, 'device_grid_unit': 20, | ||
1676 | 378 | 'screen_width': 110, 'screen_height': 100, | ||
1677 | 379 | 'expected_width': 50, 'expected_height': 90, | ||
1678 | 380 | 'expected_grid_unit': 10}), | ||
1679 | 381 | ('Device bigger than screen', { | ||
1680 | 382 | 'device_width': 200, 'device_height': 180, 'device_grid_unit': 20, | ||
1681 | 383 | 'screen_width': 110, 'screen_height': 100, | ||
1682 | 384 | 'expected_width': 100, 'expected_height': 90, | ||
1683 | 385 | 'expected_grid_unit': 10}), | ||
1684 | 386 | ] | ||
1685 | 387 | |||
1686 | 388 | def test_simulate_device_fixture_with_size_smaller_than_screen(self): | ||
1687 | 389 | """Test the simulation of a device that fits the screen. | ||
1688 | 390 | |||
1689 | 391 | All the attributes of the fixture must remain the same. | ||
1690 | 392 | |||
1691 | 393 | """ | ||
1692 | 394 | |||
1693 | 395 | simulate_device_fixture = fixture_setup.SimulateDevice( | ||
1694 | 396 | self.device_width, self.device_height, self.device_grid_unit) | ||
1695 | 397 | fake_display = FakeDisplay(self.screen_width, self.screen_height) | ||
1696 | 398 | simulate_device_fixture._screen = fake_display | ||
1697 | 399 | |||
1698 | 400 | self.useFixture(simulate_device_fixture) | ||
1699 | 401 | |||
1700 | 402 | self.assertEqual( | ||
1701 | 403 | int(os.environ.get('GRID_UNIT_PX')), self.expected_grid_unit) | ||
1702 | 404 | self.assertEqual( | ||
1703 | 405 | simulate_device_fixture.app_width, self.expected_width) | ||
1704 | 406 | self.assertEqual( | ||
1705 | 407 | simulate_device_fixture.app_height, self.expected_height) | ||
1706 | 307 | 408 | ||
1707 | === added file 'tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py' | |||
1708 | --- tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py 1970-01-01 00:00:00 +0000 | |||
1709 | +++ tests/autopilot/ubuntuuitoolkit/tests/test_ubuntu_scenarios.py 2014-07-18 18:17:44 +0000 | |||
1710 | @@ -0,0 +1,70 @@ | |||
1711 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
1712 | 2 | # | ||
1713 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
1714 | 4 | # | ||
1715 | 5 | # This program is free software; you can redistribute it and/or modify | ||
1716 | 6 | # it under the terms of the GNU Lesser General Public License as published by | ||
1717 | 7 | # the Free Software Foundation; version 3. | ||
1718 | 8 | # | ||
1719 | 9 | # This program is distributed in the hope that it will be useful, | ||
1720 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1721 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1722 | 12 | # GNU Lesser General Public License for more details. | ||
1723 | 13 | # | ||
1724 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
1725 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1726 | 16 | |||
1727 | 17 | try: | ||
1728 | 18 | from unittest import mock | ||
1729 | 19 | except ImportError: | ||
1730 | 20 | import mock | ||
1731 | 21 | |||
1732 | 22 | import testtools | ||
1733 | 23 | |||
1734 | 24 | from ubuntuuitoolkit import ubuntu_scenarios | ||
1735 | 25 | |||
1736 | 26 | |||
1737 | 27 | class ScenariosTestCase(testtools.TestCase): | ||
1738 | 28 | |||
1739 | 29 | def test_get_nexus_4_scenario(self): | ||
1740 | 30 | expected_scenarios = [ | ||
1741 | 31 | ('Simulating Nexus 4 in desktop', | ||
1742 | 32 | dict(app_width=768, app_height=1280, grid_unit_px=18)), | ||
1743 | 33 | ] | ||
1744 | 34 | with mock.patch('autopilot.platform.model') as mock_model: | ||
1745 | 35 | mock_model.return_value = 'Desktop' | ||
1746 | 36 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios( | ||
1747 | 37 | devices=ubuntu_scenarios.NEXUS4_DEVICE) | ||
1748 | 38 | self.assertEqual(expected_scenarios, scenarios) | ||
1749 | 39 | |||
1750 | 40 | def test_get_nexus_10_scenario(self): | ||
1751 | 41 | expected_scenarios = [ | ||
1752 | 42 | ('Simulating Nexus 10 in desktop', | ||
1753 | 43 | dict(app_width=2560, app_height=1600, grid_unit_px=20)) | ||
1754 | 44 | ] | ||
1755 | 45 | |||
1756 | 46 | with mock.patch('autopilot.platform.model') as mock_model: | ||
1757 | 47 | mock_model.return_value = 'Desktop' | ||
1758 | 48 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios( | ||
1759 | 49 | devices=ubuntu_scenarios.NEXUS10_DEVICE) | ||
1760 | 50 | self.assertEqual(expected_scenarios, scenarios) | ||
1761 | 51 | |||
1762 | 52 | def test_get_default_scenarios_must_return_supported_devices(self): | ||
1763 | 53 | expected_scenarios = [ | ||
1764 | 54 | ('Simulating Nexus 4 in desktop', | ||
1765 | 55 | dict(app_width=768, app_height=1280, grid_unit_px=18)), | ||
1766 | 56 | ('Simulating Nexus 10 in desktop', | ||
1767 | 57 | dict(app_width=2560, app_height=1600, grid_unit_px=20)) | ||
1768 | 58 | ] | ||
1769 | 59 | |||
1770 | 60 | with mock.patch('autopilot.platform.model') as mock_model: | ||
1771 | 61 | mock_model.return_value = 'Desktop' | ||
1772 | 62 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios() | ||
1773 | 63 | self.assertEqual(expected_scenarios, scenarios) | ||
1774 | 64 | |||
1775 | 65 | def test_get_scenarios_on_device_must_return_no_simulation_scenarios(self): | ||
1776 | 66 | with mock.patch('autopilot.platform.model') as mock_model: | ||
1777 | 67 | mock_model.return_value = 'Not Desktop' | ||
1778 | 68 | scenarios = ubuntu_scenarios.get_device_simulation_scenarios() | ||
1779 | 69 | |||
1780 | 70 | self.assertEqual([('Not Desktop', {})], scenarios) | ||
1781 | 0 | 71 | ||
1782 | === added file 'tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py' | |||
1783 | --- tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py 1970-01-01 00:00:00 +0000 | |||
1784 | +++ tests/autopilot/ubuntuuitoolkit/ubuntu_scenarios.py 2014-07-18 18:17:44 +0000 | |||
1785 | @@ -0,0 +1,54 @@ | |||
1786 | 1 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- | ||
1787 | 2 | # | ||
1788 | 3 | # Copyright (C) 2014 Canonical Ltd. | ||
1789 | 4 | # | ||
1790 | 5 | # This program is free software; you can redistribute it and/or modify | ||
1791 | 6 | # it under the terms of the GNU Lesser General Public License as published by | ||
1792 | 7 | # the Free Software Foundation; version 3. | ||
1793 | 8 | # | ||
1794 | 9 | # This program is distributed in the hope that it will be useful, | ||
1795 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1796 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1797 | 12 | # GNU Lesser General Public License for more details. | ||
1798 | 13 | # | ||
1799 | 14 | # You should have received a copy of the GNU Lesser General Public License | ||
1800 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1801 | 16 | |||
1802 | 17 | from autopilot import platform | ||
1803 | 18 | |||
1804 | 19 | |||
1805 | 20 | NEXUS4_DEVICE = 'Nexus4' | ||
1806 | 21 | NEXUS10_DEVICE = 'Nexus10' | ||
1807 | 22 | DEFAULT_DEVICES = (NEXUS4_DEVICE, NEXUS10_DEVICE) | ||
1808 | 23 | |||
1809 | 24 | |||
1810 | 25 | def get_device_simulation_scenarios(devices=DEFAULT_DEVICES): | ||
1811 | 26 | """Return a list of devices to be simulated on tests. | ||
1812 | 27 | |||
1813 | 28 | :param devices: The device or devices to simulate. Default value is all the | ||
1814 | 29 | officially supported devices. | ||
1815 | 30 | :type devices: string or sequence of strings. | ||
1816 | 31 | :return: A list of scenarios to be used with the testscenarios python | ||
1817 | 32 | module, with the values of app_width, app_height and grid_unit | ||
1818 | 33 | corresponding to the selected device. | ||
1819 | 34 | |||
1820 | 35 | """ | ||
1821 | 36 | if platform.model() == 'Desktop': | ||
1822 | 37 | return _get_device_simulation_scenarios_for_desktop(devices) | ||
1823 | 38 | else: | ||
1824 | 39 | return [(platform.model(), {})] | ||
1825 | 40 | |||
1826 | 41 | |||
1827 | 42 | def _get_device_simulation_scenarios_for_desktop(devices): | ||
1828 | 43 | scenarios = [] | ||
1829 | 44 | if NEXUS4_DEVICE in devices: | ||
1830 | 45 | scenarios.append( | ||
1831 | 46 | ('Simulating Nexus 4 in desktop', | ||
1832 | 47 | dict(app_width=768, app_height=1280, grid_unit_px=18)) | ||
1833 | 48 | ) | ||
1834 | 49 | if NEXUS10_DEVICE in devices: | ||
1835 | 50 | scenarios.append( | ||
1836 | 51 | ('Simulating Nexus 10 in desktop', | ||
1837 | 52 | dict(app_width=2560, app_height=1600, grid_unit_px=20)) | ||
1838 | 53 | ) | ||
1839 | 54 | return scenarios | ||
1840 | 0 | 55 | ||
1841 | === modified file 'tests/qmlapicheck.sh' | |||
1842 | --- tests/qmlapicheck.sh 2014-06-19 07:21:53 +0000 | |||
1843 | +++ tests/qmlapicheck.sh 2014-07-18 18:17:44 +0000 | |||
1844 | @@ -25,7 +25,7 @@ | |||
1845 | 25 | # Silence spam on stderr due to fonts | 25 | # Silence spam on stderr due to fonts |
1846 | 26 | # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 | 26 | # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 |
1847 | 27 | # https://bugreports.qt-project.org/browse/QTBUG-36243 | 27 | # https://bugreports.qt-project.org/browse/QTBUG-36243 |
1849 | 28 | qmlplugindump $i 0.1 modules 1>> plugins.qmltypes | 28 | ALARM_BACKEND=memory qmlplugindump $i 0.1 modules 1>> plugins.qmltypes |
1850 | 29 | test $? != 0 && ERRORS=1 | 29 | test $? != 0 && ERRORS=1 |
1851 | 30 | done | 30 | done |
1852 | 31 | test $ERRORS = 1 && echo Error: qmlplugindump failed && exit 1 | 31 | test $ERRORS = 1 && echo Error: qmlplugindump failed && exit 1 |
1853 | 32 | 32 | ||
1854 | === modified file 'tests/unit/runtest.sh' | |||
1855 | --- tests/unit/runtest.sh 2014-06-16 08:02:48 +0000 | |||
1856 | +++ tests/unit/runtest.sh 2014-07-18 18:17:44 +0000 | |||
1857 | @@ -45,6 +45,7 @@ | |||
1858 | 45 | # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 | 45 | # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999 |
1859 | 46 | # https://bugreports.qt-project.org/browse/QTBUG-36243 | 46 | # https://bugreports.qt-project.org/browse/QTBUG-36243 |
1860 | 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 \ |
1861 | 48 | ALARM_BACKEND=memory \ | ||
1862 | 48 | $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory' | 49 | $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory' |
1863 | 49 | # Note: Get first command before the pipe, $? would be ambiguous | 50 | # Note: Get first command before the pipe, $? would be ambiguous |
1864 | 50 | RESULT=${PIPESTATUS[0]} | 51 | RESULT=${PIPESTATUS[0]} |
1865 | 51 | 52 | ||
1866 | === modified file 'tests/unit/tst_components/tst_progressbar.qml' | |||
1867 | --- tests/unit/tst_components/tst_progressbar.qml 2014-04-23 08:50:20 +0000 | |||
1868 | +++ tests/unit/tst_components/tst_progressbar.qml 2014-07-18 18:17:44 +0000 | |||
1869 | @@ -16,7 +16,8 @@ | |||
1870 | 16 | 16 | ||
1871 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
1872 | 18 | import QtTest 1.0 | 18 | import QtTest 1.0 |
1874 | 19 | import Ubuntu.Components 1.1 | 19 | // Note: See tst_progressbar11.qml for the newer API tests |
1875 | 20 | import Ubuntu.Components 1.0 | ||
1876 | 20 | 21 | ||
1877 | 21 | TestCase { | 22 | TestCase { |
1878 | 22 | name: "ProgressBarAPI" | 23 | name: "ProgressBarAPI" |
1879 | @@ -28,6 +29,10 @@ | |||
1880 | 28 | compare(progressBar.indeterminate,newIndeterminated,"can set/get") | 29 | compare(progressBar.indeterminate,newIndeterminated,"can set/get") |
1881 | 29 | } | 30 | } |
1882 | 30 | 31 | ||
1883 | 32 | function test_showProgressPercentageExists() { | ||
1884 | 33 | verify(!progressBar.hasOwnProperty("showProgressPercentage"), "Property absent") | ||
1885 | 34 | } | ||
1886 | 35 | |||
1887 | 31 | function test_maximumValue() { | 36 | function test_maximumValue() { |
1888 | 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") |
1889 | 33 | var newMaximumValue = 20.0 | 38 | var newMaximumValue = 20.0 |
1890 | 34 | 39 | ||
1891 | === added file 'tests/unit/tst_components/tst_progressbar11.qml' | |||
1892 | --- tests/unit/tst_components/tst_progressbar11.qml 1970-01-01 00:00:00 +0000 | |||
1893 | +++ tests/unit/tst_components/tst_progressbar11.qml 2014-07-18 18:17:44 +0000 | |||
1894 | @@ -0,0 +1,38 @@ | |||
1895 | 1 | /* | ||
1896 | 2 | * Copyright 2014 Canonical Ltd. | ||
1897 | 3 | * | ||
1898 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1899 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1900 | 6 | * the Free Software Foundation; version 3. | ||
1901 | 7 | * | ||
1902 | 8 | * This program is distributed in the hope that it will be useful, | ||
1903 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1904 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1905 | 11 | * GNU Lesser General Public License for more details. | ||
1906 | 12 | * | ||
1907 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1908 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1909 | 15 | */ | ||
1910 | 16 | |||
1911 | 17 | import QtQuick 2.0 | ||
1912 | 18 | import QtTest 1.0 | ||
1913 | 19 | import Ubuntu.Components 1.1 | ||
1914 | 20 | |||
1915 | 21 | TestCase { | ||
1916 | 22 | name: "ProgressBarAPI" | ||
1917 | 23 | |||
1918 | 24 | function test_showProgressPercentageExists() { | ||
1919 | 25 | verify(progressBar.hasOwnProperty("showProgressPercentage"), "Property missing") | ||
1920 | 26 | } | ||
1921 | 27 | |||
1922 | 28 | function test_noLabel() { | ||
1923 | 29 | compare(progressBar.showProgressPercentage,true, "is set by default") | ||
1924 | 30 | var newShowProgressPercentage = false | ||
1925 | 31 | progressBar.showProgressPercentage = newShowProgressPercentage | ||
1926 | 32 | compare(progressBar.showProgressPercentage, newShowProgressPercentage, "can set/get") | ||
1927 | 33 | } | ||
1928 | 34 | |||
1929 | 35 | ProgressBar { | ||
1930 | 36 | id: progressBar | ||
1931 | 37 | } | ||
1932 | 38 | } | ||
1933 | 0 | 39 | ||
1934 | === added file 'tests/unit_x11/tst_components/tst_animator.qml' | |||
1935 | --- tests/unit_x11/tst_components/tst_animator.qml 1970-01-01 00:00:00 +0000 | |||
1936 | +++ tests/unit_x11/tst_components/tst_animator.qml 2014-07-18 18:17:44 +0000 | |||
1937 | @@ -0,0 +1,75 @@ | |||
1938 | 1 | /* | ||
1939 | 2 | * Copyright 2014 Canonical Ltd. | ||
1940 | 3 | * | ||
1941 | 4 | * This program is free software; you can redistribute it and/or modify | ||
1942 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
1943 | 6 | * the Free Software Foundation; version 3. | ||
1944 | 7 | * | ||
1945 | 8 | * This program is distributed in the hope that it will be useful, | ||
1946 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1947 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1948 | 11 | * GNU Lesser General Public License for more details. | ||
1949 | 12 | * | ||
1950 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1951 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1952 | 15 | */ | ||
1953 | 16 | |||
1954 | 17 | |||
1955 | 18 | /** | ||
1956 | 19 | * Test to prevent regressions for bug: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1338602 | ||
1957 | 20 | * Activity Indicator crashes in QML/Widget mixed applications | ||
1958 | 21 | */ | ||
1959 | 22 | |||
1960 | 23 | import QtQuick 2.2 | ||
1961 | 24 | import QtQuick.Window 2.1 | ||
1962 | 25 | import QtTest 1.0 | ||
1963 | 26 | import Ubuntu.Components 1.1 | ||
1964 | 27 | |||
1965 | 28 | Item { | ||
1966 | 29 | width: 360 | ||
1967 | 30 | height: 360 | ||
1968 | 31 | Window { | ||
1969 | 32 | id: root | ||
1970 | 33 | width: 360 | ||
1971 | 34 | height: 360 | ||
1972 | 35 | |||
1973 | 36 | property int timeout: 500 | ||
1974 | 37 | property int runs: 20 | ||
1975 | 38 | property bool finished: false | ||
1976 | 39 | |||
1977 | 40 | TestCase { | ||
1978 | 41 | name: "AnimatorRegressionTest" | ||
1979 | 42 | when: windowShown | ||
1980 | 43 | |||
1981 | 44 | function test_show_hide () { | ||
1982 | 45 | tryCompare(root,"finished",true,root.timeout * (root.runs+1)); | ||
1983 | 46 | } | ||
1984 | 47 | } | ||
1985 | 48 | |||
1986 | 49 | Timer { | ||
1987 | 50 | property int hits: 0 | ||
1988 | 51 | interval: root.timeout; running: !root.finished; repeat: !root.finished | ||
1989 | 52 | onTriggered: { | ||
1990 | 53 | hits++; | ||
1991 | 54 | if (hits >= root.runs) { | ||
1992 | 55 | root.visible = true; | ||
1993 | 56 | root.finished = true; | ||
1994 | 57 | return; | ||
1995 | 58 | } | ||
1996 | 59 | |||
1997 | 60 | root.visible = !root.visible | ||
1998 | 61 | } | ||
1999 | 62 | } | ||
2000 | 63 | |||
2001 | 64 | Flow { | ||
2002 | 65 | anchors.fill: parent | ||
2003 | 66 | Repeater { | ||
2004 | 67 | model: 3 | ||
2005 | 68 | |||
2006 | 69 | ActivityIndicator { | ||
2007 | 70 | running: true | ||
2008 | 71 | } | ||
2009 | 72 | } | ||
2010 | 73 | } | ||
2011 | 74 | } | ||
2012 | 75 | } | ||
2013 | 0 | 76 | ||
2014 | === modified file 'tests/unit_x11/tst_components/tst_textinput_touch.qml' | |||
2015 | --- tests/unit_x11/tst_components/tst_textinput_touch.qml 2014-06-24 08:42:47 +0000 | |||
2016 | +++ tests/unit_x11/tst_components/tst_textinput_touch.qml 2014-07-18 18:17:44 +0000 | |||
2017 | @@ -192,15 +192,15 @@ | |||
2018 | 192 | verify(selectedText !== "", "No text selected!"); | 192 | verify(selectedText !== "", "No text selected!"); |
2019 | 193 | 193 | ||
2020 | 194 | popupSpy.target = findChild(data.input, "input_handler"); | 194 | popupSpy.target = findChild(data.input, "input_handler"); |
2022 | 195 | TestExtras.touchLongPress(0, data.input, guPoint(1, 1)); | 195 | TestExtras.touchLongPress(0, data.input, guPoint(2, 2)); |
2023 | 196 | waitForRendering(data.input, 500); | 196 | waitForRendering(data.input, 500); |
2024 | 197 | popupSpy.wait(); | 197 | popupSpy.wait(); |
2025 | 198 | compare(data.input.selectedText, selectedText, "Text selection should be the same!"); | 198 | compare(data.input.selectedText, selectedText, "Text selection should be the same!"); |
2026 | 199 | 199 | ||
2027 | 200 | // cleanup | 200 | // cleanup |
2029 | 201 | TestExtras.touchRelease(0, data.input, guPoint(1, 1)); | 201 | TestExtras.touchRelease(0, data.input, guPoint(2, 2)); |
2030 | 202 | // dismiss popover | 202 | // dismiss popover |
2032 | 203 | TestExtras.touchClick(0, testMain, 0, 0); | 203 | TestExtras.touchClick(0, testMain, guPoint(0, 0)); |
2033 | 204 | } | 204 | } |
2034 | 205 | 205 | ||
2035 | 206 | function test_drag_cursor_handler_data() { | 206 | function test_drag_cursor_handler_data() { |
2036 | @@ -275,9 +275,7 @@ | |||
2037 | 275 | flickerSpy.target = outerFlicker; | 275 | flickerSpy.target = outerFlicker; |
2038 | 276 | autoSizeTextArea.focus = data.focused; | 276 | autoSizeTextArea.focus = data.focused; |
2039 | 277 | var editor = findChild(autoSizeTextArea, "text_input"); | 277 | var editor = findChild(autoSizeTextArea, "text_input"); |
2040 | 278 | wait(5000) | ||
2041 | 279 | TestExtras.touchDrag(0, editor, guPoint(0, 0), guPoint(0, 40)); | 278 | TestExtras.touchDrag(0, editor, guPoint(0, 0), guPoint(0, 40)); |
2042 | 280 | wait(5000) | ||
2043 | 281 | flickerSpy.wait(); | 279 | flickerSpy.wait(); |
2044 | 282 | } | 280 | } |
2045 | 283 | } | 281 | } |
2046 | 284 | 282 | ||
2047 | === modified file 'tests/unit_x11/tst_test/tst_ubuntutestcase.qml' | |||
2048 | --- tests/unit_x11/tst_test/tst_ubuntutestcase.qml 2014-06-24 07:01:06 +0000 | |||
2049 | +++ tests/unit_x11/tst_test/tst_ubuntutestcase.qml 2014-07-18 18:17:44 +0000 | |||
2050 | @@ -17,11 +17,12 @@ | |||
2051 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.0 |
2052 | 18 | import QtTest 1.0 | 18 | import QtTest 1.0 |
2053 | 19 | import Ubuntu.Test 1.0 | 19 | import Ubuntu.Test 1.0 |
2054 | 20 | import Ubuntu.Components 1.0 | ||
2055 | 20 | 21 | ||
2056 | 21 | Rectangle { | 22 | Rectangle { |
2057 | 22 | id: root | 23 | id: root |
2058 | 23 | width: 800 | 24 | width: 800 |
2060 | 24 | height: 600 | 25 | height: 1000 |
2061 | 25 | 26 | ||
2062 | 26 | Column { | 27 | Column { |
2063 | 27 | anchors.fill: parent | 28 | anchors.fill: parent |
2064 | @@ -73,6 +74,9 @@ | |||
2065 | 73 | height: 1000 | 74 | height: 1000 |
2066 | 74 | } | 75 | } |
2067 | 75 | } | 76 | } |
2068 | 77 | TextField { | ||
2069 | 78 | id: textField | ||
2070 | 79 | } | ||
2071 | 76 | } | 80 | } |
2072 | 77 | 81 | ||
2073 | 78 | UbuntuTestCase { | 82 | UbuntuTestCase { |
2074 | @@ -173,6 +177,11 @@ | |||
2075 | 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); |
2076 | 174 | movementSpy.wait(); | 178 | movementSpy.wait(); |
2077 | 175 | } | 179 | } |
2078 | 180 | function test_typeString() { | ||
2079 | 181 | textField.forceActiveFocus(); | ||
2080 | 182 | typeString("Hello Ubuntu"); | ||
2081 | 183 | tryCompare(textField, "text", "Hello Ubuntu"); | ||
2082 | 184 | } | ||
2083 | 176 | 185 | ||
2084 | 177 | SignalSpy { | 186 | SignalSpy { |
2085 | 178 | id: touchPressSpy | 187 | id: touchPressSpy |