on xenial help sign in
Merge from trunk
commit5452aee3067f2c68ff15ccabadebe221a56f6805 authorMichael Terry <michael.terry@canonical.com> dateWed 30 Apr 2014, 14:09 (12 years ago) parent7f73158
43 files changed+339−245
CODING−4 cmake/modules/QmlTest.cmake+2−4 data/CMakeLists.txt+1−2 data/unity-scope-tool.desktop.in−8 data/unity8.conf+9−1 debian/changelog+33 debian/control+37−25 debian/unity-scope-tool.install−1 debian/unity8-common.install+5 debian/unity8-fake-env.install+1−1 debian/unity8-private.install+1−1 debian/unity8.install+1−6 plugins/Unity/Indicators/qml/MenuItemFactory.qml+1−1 po/ug.po+5−5 qml/Components/FilterGrid.qml+37−24 qml/Dash/CardFilterGrid.qml+3−8 qml/Dash/DashRenderer.qml+3−3 qml/Dash/GenericScopeView.qml+13−15 qml/Dash/Previews/PreviewRatingInput.qml+2−2 qml/Greeter/Clock.qml+3−6 qml/Shell.qml−1 tests/autopilot/unity8/shell/__init__.py+50−1 tests/autopilot/unity8/shell/tests/test_emulators.py+1−1 tests/autopilot/unity8/shell/tests/test_notifications.py+14−57 tests/autopilot/unity8/shell/tests/test_upstart.py+2−2 tests/mocks/liblightdm/Greeter.cpp+11 tests/mocks/liblightdm/Greeter.h+4 tests/plugins/DashViews/CMakeLists.txt+23−35 tests/plugins/DashViews/listviewwithpageheadertestsectionexternalmodel.cpp → tests/plugins/DashViews/listviewwithpageheadersectionexternalmodeltest.cpp+1−1 tests/plugins/DashViews/listviewwithpageheadertestsection.cpp → tests/plugins/DashViews/listviewwithpageheadersectiontest.cpp+1−1 tests/plugins/DashViews/tst_listviewwithpageheaderqml.qml → tests/plugins/DashViews/tst_ListViewWithPageHeaderQML.qml tests/plugins/Ubuntu/Gestures/CMakeLists.txt+1 tests/plugins/Utils/CMakeLists.txt+2−1 tests/qmltests/CMakeLists.txt+4−3 tests/qmltests/Components/CMakeLists.txt+1 tests/qmltests/Components/tst_FilterGrid.qml+1−1 tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+21−2 tests/qmltests/Dash/tst_GenericScopeView.qml+3−3 tests/qmltests/Greeter/tst_Clock.qml+3−3 tests/qmltests/Greeter/tst_Lockscreen.qml+1−1 tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+29−4 tests/qmltests/tst_GreeterShell.qml+9 tests/qmltests/tst_Shell.qml−11
CODING−4
@@ -167,10 +167,6 @@ NB: Manual test or interation doesn't make sense for all components or classes,
167167particularly the non-graphical ones. In such cases no "tryFoo" make target is
168168provided.
169169
170−NB: The tests expect the locale to be the C locale, they may fail if run
171−under a different locale, if you get failures others can not reproduce
172−prepend 'LC_ALL=C' to the 'make test' command
173−
174170Running autopilot tests
175171=======================
176172
cmake/modules/QmlTest.cmake+2−4
@@ -59,11 +59,11 @@ macro(add_manual_qml_test SUBPATH COMPONENT_NAME)
5959endmacro(add_manual_qml_test)
6060
6161macro(add_qml_benchmark SUBPATH COMPONENT_NAME ITERATIONS)
62− add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} ${ITERATIONS})
62+ add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} ${ITERATIONS} ${ARGN})
6363endmacro(add_qml_benchmark)
6464
6565macro(add_qml_test SUBPATH COMPONENT_NAME)
66− add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} 0)
66+ add_qml_test_internal(${SUBPATH} ${COMPONENT_NAME} 0 ${ARGN})
6767endmacro(add_qml_test)
6868
6969macro(add_qml_test_internal SUBPATH COMPONENT_NAME ITERATIONS)
@@ -156,8 +156,6 @@ macro(add_binary_qml_test CLASS_NAME LD_PATH DEPS)
156156
157157 add_qmltest_target(xvfbtest${CLASS_NAME} "${xvfbtestCommand}" FALSE TRUE)
158158 add_dependencies(qmluitests xvfbtest${CLASS_NAME})
159−
160− add_manual_qml_test(. ${CLASS_NAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
161159endmacro(add_binary_qml_test)
162160
163161macro(add_qmltest_target qmltest_TARGET qmltest_command qmltest_NO_TARGETS qmltest_NO_ADD_TEST)
data/CMakeLists.txt+1−2
@@ -1,10 +1,9 @@
11# generate desktop file
22configure_file(${SHELL_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop @ONLY)
33configure_file(${GREETER_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop @ONLY)
4−configure_file(${SCOPE_TOOL}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_TOOL}.desktop @ONLY)
54
65# install desktop files
7−install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop ${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_TOOL}.desktop
6+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop
87 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
98 )
109install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop
data/unity-scope-tool.desktop.indeleted−8
@@ -1,8 +0,0 @@
1−[Desktop Entry]
2−Type=Application
3−Name=Unity Scope Tool
4−Comment=Developer tool for Unity scopes.
5−Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/unity-scope-tool
6−Terminal=false
7−Icon=unity-scope-tool
8−X-Ubuntu-Touch=true
data/unity8.conf+9−1
@@ -12,6 +12,9 @@ respawn
1212expect stop
1313
1414pre-start script
15+ # Tell unity-mir to raise SIGSTOP after we start
16+ initctl set-env UNITY_MIR_EMITS_SIGSTOP=1
17+
1518 if [ -n "$MIR_SOCKET" ]; then
1619 if [ -z "$UNITY_MIR_SOCKET" ]; then
1720 # Save original value of MIR_SOCKET in case we are restarted,
@@ -42,7 +45,12 @@ pre-start script
4245 fi
4346
4447 initctl emit scope-ui-starting
45− initctl emit indicator-services-start
48+ initctl emit --no-wait indicator-services-start
4649end script
4750
4851exec ${BINARY:-unity8} $ARGS
52+
53+post-stop script
54+ initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
55+ initctl unset-env --global UNITY_MIR_SOCKET
56+end script
debian/changelog+33
@@ -1,3 +1,36 @@
1+unity8 (7.86+14.10.20140429.2-0ubuntu1) utopic; urgency=medium
2+
3+ [ Andrea Cimitan ]
4+ * Update upstart job to reflect latest unity-mir changes
5+ * Fix locale in qml tests and fixtimeformattertest (LP: #1301038)
6+ * Fix 1309135 (LP: #1309135)
7+
8+ [ Michał Sawicz ]
9+ * Split out unity8-common package
10+ * Don't wait for indicator services to start, and drop Scope Tool's
11+ .desktop file. (LP: #1310172)
12+
13+ [ Michael Terry ]
14+ * Stop clock from hiding when the 'show dash' button is pressed in
15+ greeter. (LP: #1308139)
16+ * Make swipe teases in the greeter more helpful and obvious (LP:
17+ #1267623)
18+
19+ [ Nick Dedekind ]
20+ * Fixed datetime indicator appointment colour (LP: #1307048)
21+
22+ [ Albert Astals ]
23+ * Improve Card creation time by adding loaders that make sure only
24+ what's needed is loaded (LP: #1297197)
25+ * CategoryDelegateRange: Fix condition for detecting overshooting
26+ * Make xvfbtests work in the DashView plugins
27+ * Fix binding loop in FilterGrid height
28+
29+ [ Victor R. Ruiz ]
30+ * Move autopilot notification code to a helper method.
31+
32+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 29 Apr 2014 15:21:33 +0000
33+
134unity8 (7.86+14.04.20140306-0ubuntu1) UNRELEASED; urgency=medium
235
336 * Bump version for Breaks due to unity8-greeter
debian/control+37−25
@@ -11,35 +11,35 @@ Build-Depends: cmake,
1111 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],
1212 libgl1-mesa-dri,
1313 libgles2-mesa-dev[armhf],
14+ libglib2.0-dev,
1415 libgsettings-qt-dev,
1516 libhud-client2-dev,
1617 liblightdm-qt5-3-dev,
1718 libpulse-dev,
1819 libqmenumodel-dev (>= 0.2.7),
20+ libqt5xmlpatterns5-dev,
1921 libunity-api-dev (>= 7.80.6),
2022 libunity-mir-dev,
2123 libusermetricsoutput1-dev,
2224 libxcb1-dev,
23− libglib2.0-dev,
2425 pkg-config,
25− python:any (>= 2.7),
2626 python-setuptools,
2727 python3-all:any,
2828 python3-setuptools,
29+ python:any (>= 2.7),
2930 qt5-default,
3031 qtbase5-dev,
3132 qtbase5-dev-tools,
3233 qtbase5-private-dev,
3334 qtdeclarative5-dev,
3435 qtdeclarative5-dev-tools,
35− qtdeclarative5-qtmultimedia-plugin,
3636 qtdeclarative5-private-dev,
37+ qtdeclarative5-qtmultimedia-plugin,
3738 qtdeclarative5-qtquick2-plugin,
3839 qtdeclarative5-test-plugin,
3940 qtdeclarative5-ubuntu-settings-components,
4041 qtdeclarative5-ubuntu-ui-toolkit-plugin,
4142 qtdeclarative5-xmllistmodel-plugin,
42− libqt5xmlpatterns5-dev,
4343 ttf-ubuntu-font-family,
4444Standards-Version: 3.9.4
4545Homepage: http://launchpad.net/unity
@@ -61,7 +61,8 @@ Description: Indicators client test application
6161
6262Package: unity-scope-tool
6363Architecture: any
64−Depends: unity8 (= ${binary:Version}),
64+Depends: unity8-common (= ${source:Version}),
65+ unity8-private (= ${binary:Version}),
6566 ${misc:Depends},
6667 ${shlibs:Depends},
6768Description: Development tool for Unity scopes
@@ -72,28 +73,19 @@ Package: unity8
7273Architecture: any
7374Provides: indicator-renderer,
7475Depends: gsettings-desktop-schemas,
76+ libcap2-bin,
7577 libglib2.0-bin,
76− libunity-mir1,
78+ libunity-mir1 (>= 0.4),
7779 qmenumodel-qml (>= 0.2.7),
7880 qtdeclarative5-dee-plugin,
7981 qtdeclarative5-gsettings1.0,
8082 qtdeclarative5-ubuntu-settings-components,
81− qtdeclarative5-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
82− ubuntu-thumbnailer-impl-0,
83− qtdeclarative5-ubuntu-ui-toolkit-plugin,
84− qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
8583 qtdeclarative5-xmllistmodel-plugin,
86− unity-application-impl-2,
8784 unity-greeter-session-broadcast,
8885 unity-launcher-impl-3,
89− unity-notifications-impl-2,
90− unity8-fake-env | unity-application-impl,
86+ unity8-common (= ${source:Version}),
9187 unity8-private (= ${binary:Version}),
9288 unity8-private | unity-launcher-impl,
93− unity-plugin-scopes | unity-scopes-impl,
94− unity-scopes-impl-0,
95−# for setcap:
96− libcap2-bin,
9789 ${misc:Depends},
9890 ${shlibs:Depends},
9991Recommends: unity-scope-click,
@@ -101,7 +93,7 @@ Recommends: unity-scope-click,
10193 unity-scope-scopes,
10294Breaks: indicator-network (<< 0.5.1),
10395 ubuntu-touch-session (<< 0.107),
104−Replaces: ubuntu-touch-session (<< 0.82~)
96+Replaces: ubuntu-touch-session (<< 0.82~),
10597Description: Unity 8 shell
10698 The Unity 8 shell is the primary user interface for Ubuntu devices.
10799
@@ -110,14 +102,34 @@ Architecture: any
110102Depends: dbus-x11,
111103 libglib2.0-bin,
112104 lightdm,
113− unity8 (>= ${source:Version}),
105+ unity8 (= ${source:Version}),
114106 ${misc:Depends},
115107 ${shlibs:Depends},
116−Replaces: unity8 (<< 7.86),
117108Breaks: unity8 (<< 7.86),
109+Replaces: unity8 (<< 7.86),
118110Description: Ubuntu QML greeter
119111 The Ubuntu QML greeter is the primary greeter for Ubuntu devices.
120112
113+Package: unity8-common
114+Architecture: all
115+Depends: qtdeclarative5-ubuntu-thumbnailer0.1 | ubuntu-thumbnailer-impl,
116+ qtdeclarative5-ubuntu-ui-toolkit-plugin,
117+ qtdeclarative5-unity-notifications-plugin | unity-notifications-impl,
118+ ubuntu-thumbnailer-impl-0,
119+ unity-application-impl-2,
120+ unity-notifications-impl-2,
121+ unity-plugin-scopes | unity-scopes-impl,
122+ unity-scopes-impl-0,
123+ unity8-fake-env | unity-application-impl,
124+ ${misc:Depends},
125+Breaks: unity8 (<< 7.86),
126+Replaces: unity8 (<< 7.86),
127+Description: Unity 8 shell (common files)
128+ The Unity 8 shell is the primary user interface for Ubuntu devices.
129+ .
130+ This package contains the QML, graphics and locale files shared between
131+ unity8 and unity-scope-tool.
132+
121133Package: unity8-autopilot
122134Architecture: all
123135Depends: gir1.2-glib-2.0,
@@ -134,13 +146,13 @@ Depends: gir1.2-glib-2.0,
134146 python3-fixtures,
135147 python3-gi,
136148 ubuntu-ui-toolkit-autopilot,
137− unity8 (>= ${source:Version}),
138− unity8-fake-env (>= ${source:Version}),
139− unity8-greeter (>= ${source:Version}),
149+ unity8 (= ${source:Version}),
150+ unity8-fake-env (= ${source:Version}),
151+ unity8-greeter (= ${source:Version}),
140152 url-dispatcher-tools,
141153 ${misc:Depends},
142− ${python:Depends},
143154 ${python3:Depends},
155+ ${python:Depends},
144156 ${shlibs:Depends},
145157Description: Test package for Unity 8 shell
146158 Autopilot tests for the unity8 package
@@ -162,9 +174,9 @@ Architecture: any
162174Multi-Arch: same
163175Pre-Depends: ${misc:Pre-Depends},
164176Depends: gsettings-ubuntu-schemas,
177+ libunity-core-6.0-9,
165178 ${misc:Depends},
166179 ${shlibs:Depends},
167− libunity-core-6.0-9,
168180Provides: unity-launcher-impl,
169181 unity-launcher-impl-3,
170182Description: Unity 8 private libs
debian/unity-scope-tool.install−1
@@ -1,3 +1,2 @@
11usr/bin/unity-scope-tool
2−usr/share/applications/unity-scope-tool.desktop
32usr/share/unity8/ScopeTool.qml
debian/unity8-common.installnew file+5
@@ -0,0 +1,5 @@
1+usr/share/locale
2+usr/share/unity8/Components
3+usr/share/unity8/Dash
4+usr/share/unity8/Notifications
5+usr/share/unity8/graphics
debian/unity8-fake-env.install+1−1
@@ -1,4 +1,4 @@
1−usr/lib/*/unity8/qml/nonmirplugins
21usr/lib/*/unity8/qml/mocks
2+usr/lib/*/unity8/qml/nonmirplugins
33usr/lib/*/unity8/qml/scopefakes
44usr/share/unity8/mocks
debian/unity8-private.install+1−1
@@ -1,7 +1,7 @@
11usr/lib/*/unity8/qml/AccountsService
2+usr/lib/*/unity8/qml/DashViews
23usr/lib/*/unity8/qml/HudClient
34usr/lib/*/unity8/qml/LightDM
4−usr/lib/*/unity8/qml/DashViews
55usr/lib/*/unity8/qml/Powerd
66usr/lib/*/unity8/qml/SessionBroadcast
77usr/lib/*/unity8/qml/SessionManager
debian/unity8.install+1−6
@@ -1,14 +1,9 @@
1+data/unity8.conf usr/share/upstart/sessions/
12usr/bin/unity8
23usr/share/applications/unity8.desktop
3−usr/share/locale
44usr/share/unity8/Bottombar
5−usr/share/unity8/Components
6−usr/share/unity8/Dash
75usr/share/unity8/Hud
86usr/share/unity8/Launcher
9−usr/share/unity8/Notifications
107usr/share/unity8/Panel
118usr/share/unity8/Shell.qml
129usr/share/unity8/Stages
13−usr/share/unity8/graphics
14−data/unity8.conf usr/share/upstart/sessions/
plugins/Unity/Indicators/qml/MenuItemFactory.qml+1−1
@@ -273,7 +273,7 @@ Item {
273273 text: menuData && menuData.label || ""
274274 iconSource: menuData && menuData.icon || "image://theme/calendar"
275275 time: timeFormatter.timeString
276− eventColor: menu && menu.ext.hasOwnProperty("xCanonicalColor") ? menu.ext.xCanonicalColor : Qt.rgba(0.0, 0.0, 0.0, 0.0)
276+ eventColor: getExtendedProperty(extendedData, "xCanonicalColor", Qt.rgba(0.0, 0.0, 0.0, 0.0))
277277 enabled: menuData && menuData.sensitive || false
278278
279279 onMenuModelChanged: {
po/ug.po+5−5
@@ -8,14 +8,14 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2014-03-25 16:48+0100\n"
11−"PO-Revision-Date: 2014-04-14 09:31+0000\n"
12−"Last-Translator: volkhan <Unknown>\n"
11+"PO-Revision-Date: 2014-04-22 05:46+0000\n"
12+"Last-Translator: abdurahman <Unknown>\n"
1313"Language-Team: Uyghur <ug@li.org>\n"
1414"MIME-Version: 1.0\n"
1515"Content-Type: text/plain; charset=UTF-8\n"
1616"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2014-04-15 07:57+0000\n"
18−"X-Generator: Launchpad (build 16976)\n"
17+"X-Launchpad-Export-Date: 2014-04-23 07:07+0000\n"
18+"X-Generator: Launchpad (build 16985)\n"
1919
2020#: plugins/Unity/Launcher/launcheritem.cpp:43
2121#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -93,7 +93,7 @@ msgstr "يېقىنقى"
9393#: qml/Dash/PreviewListView.qml:52
9494#, qt-format
9595msgid "%1 Preview"
96−msgstr ""
96+msgstr "%1 ئالدىن كۆرۈپ بىقىش"
9797
9898#: qml/Dash/Previews/PreviewActionCombo.qml:34
9999msgid "More..."
qml/Components/FilterGrid.qml+37−24
@@ -28,11 +28,6 @@ import "../Components"
2828Item {
2929 id: root
3030
31− /* If true, the number of elements displayed will be limited by collapsedRowCount.
32− If false, all elements will be displayed, effectively looking the same as a regular
33− ResponsiveGridView. */
34− property bool filter: true
35−
3631 /* Whether, when collapsed, a button should be displayed enabling the user to expand
3732 the grid to its full size. */
3833 readonly property bool expandable: model.count > rowsWhenCollapsed * iconTileGrid.columns
@@ -65,30 +60,48 @@ Item {
6560 readonly property alias pressDelay: iconTileGrid.pressDelay
6661 property alias highlightIndex: iconTileGrid.highlightIndex
6762 readonly property alias currentItem: iconTileGrid.currentItem
63+ readonly property alias filtered: d.filter
64+
65+ QtObject {
66+ id: d
67+ // We do have filter and collapsed properties because we need to decouple
68+ // the real filtering with the animation since the closing animation
69+ // i.e. setFilter(false. true) we still need to not be filtering until
70+ // the animation finishes otherwise we hide the items when the animation
71+ // is still running
72+ property bool filter: true
73+ property bool collapsed: true
74+ }
6875
69− height: !filterAnimation.running ? childrenRect.height : height
76+ height: d.collapsed ? root.collapsedHeight : root.uncollapsedHeight
7077 clip: filterAnimation.running
7178
72− NumberAnimation {
73− property bool filterEndValue
74− id: filterAnimation
75− target: root
76− property: "height"
77− to: filterEndValue ? root.collapsedHeight : root.uncollapsedHeight
78− // Duration and easing here match the ListViewWithPageHeader::m_contentYAnimation
79− // otherwise since both animations can run at the same time you'll get
80− // some visual weirdness.
81− duration: 200
82− easing.type: Easing.InOutQuad
83− onStopped: {
84− root.filter = filterEndValue;
79+ Behavior on height {
80+ id: heightBehaviour
81+ enabled: false
82+ NumberAnimation {
83+ id: filterAnimation
84+ // Duration and easing here match the ListViewWithPageHeader::m_contentYAnimation
85+ // otherwise since both animations can run at the same time you'll get
86+ // some visual weirdness.
87+ duration: 200
88+ easing.type: Easing.InOutQuad
89+ onRunningChanged: {
90+ if (!running) {
91+ d.filter = d.collapsed;
92+ }
93+ heightBehaviour.enabled = false;
94+ }
8595 }
8696 }
8797
88− function startFilterAnimation(filter) {
89− filterAnimation.filterEndValue = filter
90− filterAnimation.start();
91− }
98+ function setFilter(filter, animate) {
99+ heightBehaviour.enabled = animate;
100+ d.collapsed = filter;
101+ if (!animate || !filter) {
102+ d.filter = filter;
103+ }
104+ }
92105
93106 ResponsiveGridView {
94107 id: iconTileGrid
@@ -105,7 +118,7 @@ Item {
105118
106119 model: LimitProxyModel {
107120 model: root.model
108− limit: (filter && !filterAnimation.running) ? rowsWhenCollapsed * iconTileGrid.columns : -1
121+ limit: d.filter ? rowsWhenCollapsed * iconTileGrid.columns : -1
109122 }
110123 }
111124}
qml/Dash/CardFilterGrid.qml+3−8
@@ -28,9 +28,10 @@ DashRenderer {
2828 verticalSpacing: units.gu(1)
2929 currentItem: filterGrid.currentItem
3030 height: filterGrid.height
31+ filtered: filterGrid.filtered
3132
32− function startFilterAnimation(filter) {
33− filterGrid.startFilterAnimation(filter)
33+ function setFilter(filter, animate) {
34+ filterGrid.setFilter(filter, animate)
3435 }
3536
3637 FilterGrid {
@@ -41,7 +42,6 @@ DashRenderer {
4142 delegateHeight: cardTool.cardHeight
4243 verticalSpacing: genericFilterGrid.verticalSpacing
4344 model: genericFilterGrid.model
44− filter: genericFilterGrid.filter
4545 collapsedRowCount: Math.min(2, cardTool && cardTool.template && cardTool.template["collapsed-rows"] || 2)
4646 delegateCreationBegin: genericFilterGrid.delegateCreationBegin
4747 delegateCreationEnd: genericFilterGrid.delegateCreationEnd
@@ -66,10 +66,5 @@ DashRenderer {
6666 onPressAndHold: genericFilterGrid.pressAndHold(index, card.y)
6767 }
6868 }
69−
70− onFilterChanged: {
71− genericFilterGrid.filter = filter
72− filter = Qt.binding(function() { return genericFilterGrid.filter })
73− }
7469 }
7570}
qml/Dash/DashRenderer.qml+3−3
@@ -20,8 +20,8 @@ Item {
2020 // Can the item be expanded?
2121 property bool expandable: false
2222
23− // In case it can be expanded, should we filter it
24− property bool filter: true
23+ // In case it can be expanded, is it filtered
24+ property bool filtered: true
2525
2626 property int collapsedHeight: height
2727
@@ -58,6 +58,6 @@ Item {
5858 /// @param itemY is y of the held delegate
5959 signal pressAndHold(int index, real itemY)
6060
61− function startFilterAnimation(filter) {
61+ function setFilter(filter, animate) {
6262 }
6363}
qml/Dash/GenericScopeView.qml+13−15
@@ -122,7 +122,7 @@ FocusScope {
122122 showDivider: false
123123
124124 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
125− readonly property bool filtered: rendererLoader.item ? rendererLoader.item.filter : true
125+ readonly property bool filtered: rendererLoader.item ? rendererLoader.item.filtered : true
126126 readonly property string category: categoryId
127127 readonly property var item: rendererLoader.item
128128
@@ -168,9 +168,7 @@ FocusScope {
168168 item.objectName = Qt.binding(function() { return categoryId })
169169 if (item.expandable) {
170170 var shouldFilter = categoryId != categoryView.expandedCategoryId;
171− if (shouldFilter != item.filter) {
172− item.filter = shouldFilter;
173− }
171+ item.setFilter(shouldFilter, false /*animate*/);
174172 }
175173 updateDelegateCreationRange();
176174 item.cardTool = cardTool;
@@ -219,11 +217,8 @@ FocusScope {
219217 var shrinkingVisible = shouldFilter && y + item.collapsedHeight < categoryView.height;
220218 var growingVisible = !shouldFilter && y + height < categoryView.height;
221219 if (!previewListView.open || !shouldFilter) {
222− if (shrinkingVisible || growingVisible) {
223− item.startFilterAnimation(shouldFilter)
224− } else {
225− item.filter = shouldFilter;
226− }
220+ var animate = shrinkingVisible || growingVisible;
221+ item.setFilter(shouldFilter, animate)
227222 if (!shouldFilter && !previewListView.open) {
228223 categoryView.maximizeVisibleArea(index, item.uncollapsedHeight);
229224 }
@@ -238,12 +233,15 @@ FocusScope {
238233 }
239234
240235 function updateDelegateCreationRange() {
241− // Do not update the range if we are overshooting up or down, since we'll come back
242− // to the stable position and delete/create items without any reason
243− if (categoryView.contentY < categoryView.originY) {
244− return;
245− } else if (categoryView.contentHeight > categoryView.height && categoryView.contentY + categoryView.height > categoryView.contentHeight) {
246− return;
236+ if (categoryView.moving) {
237+ // Do not update the range if we are overshooting up or down, since we'll come back
238+ // to the stable position and delete/create items without any reason
239+ if (categoryView.contentY < categoryView.originY) {
240+ return;
241+ } else if (categoryView.contentHeight - categoryView.originY > categoryView.height &&
242+ categoryView.contentY + categoryView.height > categoryView.contentHeight) {
243+ return;
244+ }
247245 }
248246
249247 if (item && item.hasOwnProperty("delegateCreationBegin")) {
qml/Dash/Previews/PreviewRatingInput.qml+2−2
@@ -155,8 +155,8 @@ PreviewWidget {
155155 objectName: "submitButton"
156156
157157 readonly property bool readyToSubmit: {
158− if (reviewTextArea.text === "" ||
159− (widgetData["visible"] === "both" && rating.value < 0)) return false;
158+ if ((widgetData["required"] !== "review" && rating.value < 0) ||
159+ (widgetData["required"] !== "rating" && reviewTextArea.text === "")) return false;
160160 else return true;
161161 }
162162
qml/Greeter/Clock.qml+3−6
@@ -24,14 +24,11 @@ Item {
2424 implicitWidth: childrenRect.width
2525 implicitHeight: childrenRect.height
2626
27− // Allows to set the current Date. Will be overwritten if active
27+ // Allows to set the current Date. Will be overwritten if visible
2828 property date currentDate
2929
30− // If active, time will be updated through the indicators service
31− property bool active: clock.enabled && clock.visible
32−
3330 Component.onCompleted: {
34− if (active) {
31+ if (visible) {
3532 currentDate = new Date()
3633 }
3734 }
@@ -42,7 +39,7 @@ Item {
4239
4340 busName: "com.canonical.indicator.datetime"
4441 actionsObjectPath: "/com/canonical/indicator/datetime"
45− menuObjectPath: clock.active ? "/com/canonical/indicator/datetime/phone_greeter" : ""
42+ menuObjectPath: clock.visible ? "/com/canonical/indicator/datetime/phone_greeter" : ""
4643
4744 Indicators.RootActionState {
4845 menu: timeModel.model
qml/Shell.qml−1
@@ -217,7 +217,6 @@ BasicShell {
217217 shown = true;
218218 panel.indicators.hide();
219219 edgeDemo.stopDemo();
220− greeter.hide();
221220 if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
222221 ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
223222 }
tests/autopilot/unity8/shell/__init__.py+50−1
@@ -21,8 +21,9 @@
2121
2222from time import sleep
2323from functools import wraps
24−import logging
24+from gi.repository import Notify
2525
26+import logging
2627
2728logger = logging.getLogger(__name__)
2829
@@ -48,6 +49,7 @@ def disable_qml_mocking(fn):
4849 return fn(*args, **kwargs)
4950 return wrapper
5051
52+
5153class DragMixin(object):
5254 def _drag(self, x1, y1, x2, y2):
5355 # XXX This ugly code is here just temporarily, waiting for drag
@@ -69,3 +71,50 @@ class DragMixin(object):
6971 self.touch._finger_move(int(x2), int(y2))
7072 except AttributeError:
7173 self.touch._device.finger_move(int(x2), int(y2))
74+
75+
76+def create_ephemeral_notification(
77+ summary='',
78+ body='',
79+ icon=None,
80+ hints=[],
81+ urgency='NORMAL'
82+):
83+ """Create an ephemeral (non-interactive) notification
84+
85+ :param summary: Summary text for the notification
86+ :param body: Body text to display in the notification
87+ :param icon: Path string to the icon to use
88+ :param hint_strings: List of tuples containing the 'name' and value
89+ for setting the hint strings for the notification
90+ :param urgency: Urgency string for the noticiation, either: 'LOW',
91+ 'NORMAL', 'CRITICAL'
92+ """
93+ Notify.init('Unity8')
94+
95+ logger.info(
96+ "Creating ephemeral: summary(%s), body(%s), urgency(%r) "
97+ "and Icon(%s)",
98+ summary,
99+ body,
100+ urgency,
101+ icon
102+ )
103+
104+ notification = Notify.Notification.new(summary, body, icon)
105+
106+ for hint in hints:
107+ key, value = hint
108+ notification.set_hint_string(key, value)
109+ logger.info("Adding hint to notification: (%s, %s)", key, value)
110+ notification.set_urgency(_get_urgency(urgency))
111+
112+ return notification
113+
114+
115+def _get_urgency(urgency):
116+ """Translates urgency string to enum."""
117+ _urgency_enums = {'LOW': Notify.Urgency.LOW,
118+ 'NORMAL': Notify.Urgency.NORMAL,
119+ 'CRITICAL': Notify.Urgency.CRITICAL}
120+ return _urgency_enums.get(urgency.upper())
tests/autopilot/unity8/shell/tests/test_emulators.py+1−1
@@ -195,7 +195,7 @@ class DashAppsEmulatorTestCase(DashBaseTestCase):
195195 category)
196196 grid = category_element.select_single('CardFilterGrid')
197197 filtergrid = grid.select_single('FilterGrid')
198− if (grid.filter):
198+ if (grid.filtered):
199199 return filtergrid.collapsedRowCount * filtergrid.columns
200200 else:
201201 return filtergrid.uncollapsedRowCount * filtergrid.columns
tests/autopilot/unity8/shell/tests/test_notifications.py+14−57
@@ -21,6 +21,7 @@
2121
2222from __future__ import absolute_import
2323
24+from unity8 import shell
2425from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2526
2627from testtools.matchers import Equals, NotEquals
@@ -63,7 +64,8 @@ class NotificationsBase(UnityTestCase):
6364 if os.path.abspath(__file__).startswith('/usr/'):
6465 return '/usr/share/unity8/graphics/' + icon_name
6566 else:
66− return os.path.dirname(__file__) + "/../../../../../qml/graphics/" + icon_name
67+ return os.path.dirname(__file__) + (
68+ "/../../../../../qml/graphics/" + icon_name)
6769
6870 def _get_notifications_list(self):
6971 return self.main_window.select_single(
@@ -350,7 +352,7 @@ class EphemeralNotificationsTests(NotificationsBase):
350352 )
351353 ]
352354
353− notification = self._create_ephemeral_notification(
355+ notification = shell.create_ephemeral_notification(
354356 summary,
355357 body,
356358 icon_path,
@@ -386,7 +388,7 @@ class EphemeralNotificationsTests(NotificationsBase):
386388 )
387389 ]
388390
389− notification = self._create_ephemeral_notification(
391+ notification = shell.create_ephemeral_notification(
390392 summary,
391393 None,
392394 None,
@@ -427,7 +429,7 @@ class EphemeralNotificationsTests(NotificationsBase):
427429 body_critical = 'Dude, this is so urgent you have no idea :)'
428430 icon_path_critical = self._get_icon_path('avatars/anna_olsson.png')
429431
430− notification_normal = self._create_ephemeral_notification(
432+ notification_normal = shell.create_ephemeral_notification(
431433 summary_normal,
432434 body_normal,
433435 icon_path_normal,
@@ -435,7 +437,7 @@ class EphemeralNotificationsTests(NotificationsBase):
435437 )
436438 notification_normal.show()
437439
438− notification_low = self._create_ephemeral_notification(
440+ notification_low = shell.create_ephemeral_notification(
439441 summary_low,
440442 body_low,
441443 icon_path_low,
@@ -443,7 +445,7 @@ class EphemeralNotificationsTests(NotificationsBase):
443445 )
444446 notification_low.show()
445447
446− notification_critical = self._create_ephemeral_notification(
448+ notification_critical = shell.create_ephemeral_notification(
447449 summary_critical,
448450 body_critical,
449451 icon_path_critical,
@@ -503,7 +505,7 @@ class EphemeralNotificationsTests(NotificationsBase):
503505 summary = 'Summary-Body'
504506 body = 'This is a superfluous notification'
505507
506− notification = self._create_ephemeral_notification(summary, body)
508+ notification = shell.create_ephemeral_notification(summary, body)
507509 notification.show()
508510
509511 notification = notify_list.wait_select_single(
@@ -526,7 +528,7 @@ class EphemeralNotificationsTests(NotificationsBase):
526528
527529 summary = 'Summary-Only'
528530
529− notification = self._create_ephemeral_notification(summary)
531+ notification = shell.create_ephemeral_notification(summary)
530532 notification.show()
531533
532534 notification = notify_list.wait_select_single(
@@ -545,7 +547,7 @@ class EphemeralNotificationsTests(NotificationsBase):
545547 body = 'This is the original content of this notification-bubble.'
546548 icon_path = self._get_icon_path('avatars/funky.png')
547549
548− notification = self._create_ephemeral_notification(
550+ notification = shell.create_ephemeral_notification(
549551 summary,
550552 body,
551553 icon_path
@@ -584,7 +586,7 @@ class EphemeralNotificationsTests(NotificationsBase):
584586 icon_path = self._get_icon_path('avatars/anna_olsson.png')
585587 hint_icon = self._get_icon_path('applicationIcons/phone-app.png')
586588
587− notification = self._create_ephemeral_notification(
589+ notification = shell.create_ephemeral_notification(
588590 summary,
589591 body,
590592 icon_path
@@ -627,7 +629,7 @@ class EphemeralNotificationsTests(NotificationsBase):
627629 body = 'Hey Bro Coly!'
628630 icon_path = self._get_icon_path('avatars/amanda.png')
629631 body_sum = body
630− notification = self._create_ephemeral_notification(
632+ notification = shell.create_ephemeral_notification(
631633 summary,
632634 body,
633635 icon_path,
@@ -663,7 +665,7 @@ class EphemeralNotificationsTests(NotificationsBase):
663665 for new_body in bodies:
664666 body = new_body
665667 body_sum += '\n' + body
666− notification = self._create_ephemeral_notification(
668+ notification = shell.create_ephemeral_notification(
667669 summary,
668670 body,
669671 icon_path,
@@ -684,48 +686,3 @@ class EphemeralNotificationsTests(NotificationsBase):
684686 False,
685687 1.0
686688 )
687−
688− def _create_ephemeral_notification(
689− self,
690− summary="",
691− body="",
692− icon=None,
693− hints=[],
694− urgency="NORMAL"
695− ):
696− """Create an ephemeral (non-interactive) notification
697−
698− :param summary: Summary text for the notification
699− :param body: Body text to display in the notification
700− :param icon: Path string to the icon to use
701− :param hint_strings: List of tuples containing the 'name' and value
702− for setting the hint strings for the notification
703− :param urgency: Urgency string for the noticiation, either: 'LOW',
704− 'NORMAL', 'CRITICAL'
705−
706− """
707− logger.info(
708− "Creating ephemeral: summary(%s), body(%s), urgency(%r) "
709− "and Icon(%s)",
710− summary,
711− body,
712− urgency,
713− icon
714− )
715−
716− n = Notify.Notification.new(summary, body, icon)
717−
718− for hint in hints:
719− key, value = hint
720− n.set_hint_string(key, value)
721− logger.info("Adding hint to notification: (%s, %s)", key, value)
722− n.set_urgency(self._get_urgency(urgency))
723−
724− return n
725−
726− def _get_urgency(self, urgency):
727− """Translates urgency string to enum."""
728− _urgency_enums = {'LOW': Notify.Urgency.LOW,
729− 'NORMAL': Notify.Urgency.NORMAL,
730− 'CRITICAL': Notify.Urgency.CRITICAL}
731− return _urgency_enums.get(urgency.upper())
tests/autopilot/unity8/shell/tests/test_upstart.py+2−2
@@ -82,7 +82,7 @@ class UpstartIntegrationTests(UnityTestCase):
8282 ))
8383
8484 def test_no_sigstop(self):
85− self.patch_environment("UPSTART_JOB", "foo")
85+ self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "")
8686 self._launch_unity()
8787 self._set_proxy()
8888
@@ -91,7 +91,7 @@ class UpstartIntegrationTests(UnityTestCase):
9191 logger.debug("Unity loaded and ready.")
9292
9393 def test_expect_sigstop(self):
94− self.patch_environment("UPSTART_JOB", "unity8")
94+ self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "1")
9595 self._launch_unity()
9696 self.assertThat(lambda: os.WIFSTOPPED(self._get_status()), Eventually(Equals(True)), "Unity8 should raise SIGSTOP when ready")
9797
tests/mocks/liblightdm/Greeter.cpp+11
@@ -151,12 +151,23 @@ void Greeter::setLanguage (const QString &language)
151151 Q_UNUSED(language)
152152}
153153
154+void Greeter::setResettable (bool resettable)
155+{
156+ Q_UNUSED(resettable)
157+}
158+
154159bool Greeter::startSessionSync(const QString &session)
155160{
156161 Q_UNUSED(session)
157162 return true;
158163}
159164
165+QString Greeter::ensureSharedDataDirSync(const QString &username)
166+{
167+ Q_UNUSED(username)
168+ return "";
169+}
170+
160171void Greeter::respond(const QString &response)
161172{
162173 Q_D(Greeter);
tests/mocks/liblightdm/Greeter.h+4
@@ -88,13 +88,17 @@ public Q_SLOTS:
8888 void respond(const QString &response);
8989 void cancelAuthentication();
9090 void setLanguage (const QString &language);
91+ void setResettable (bool resettable);
9192 bool startSessionSync(const QString &session=QString());
93+ QString ensureSharedDataDirSync(const QString &username);
9294
9395Q_SIGNALS:
9496 void showMessage(QString text, QLightDM::Greeter::MessageType type);
9597 void showPrompt(QString text, QLightDM::Greeter::PromptType type);
9698 void authenticationComplete();
9799 void autologinTimerExpired();
100+ void idle();
101+ void reset();
98102
99103private:
100104 GreeterPrivate *d_ptr;
tests/plugins/DashViews/CMakeLists.txt+23−35
@@ -25,46 +25,41 @@ remove_definitions(-DQT_NO_KEYWORDS)
2525add_definitions(-DDASHVIEWSTEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
2626add_definitions(-DBUILT_PLUGINS_DIR="${CMAKE_BINARY_DIR}/plugins")
2727
28−add_executable(listviewwithpageheadertestExec listviewwithpageheadertest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
29−qt5_use_modules(listviewwithpageheadertestExec Test Core Qml)
30−target_link_libraries(listviewwithpageheadertestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
31−add_custom_target(testlistviewwithpageheader ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheader.xml,xunitxml -o -,txt)
28+macro(add_lvwph_test FILENAME TESTNAME)
29+ add_executable(${TESTNAME}TestExec
30+ ${FILENAME}test.cpp
31+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
32+ qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
33+ target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
3234
33−add_executable(listviewwithpageheadertestsectionExec listviewwithpageheadertestsection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
34−qt5_use_modules(listviewwithpageheadertestsectionExec Test Core Qml)
35−target_link_libraries(listviewwithpageheadertestsectionExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
36−add_custom_target(testlistviewwithpageheadersection ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersection.xml,xunitxml -o -,txt)
35+ add_binary_qml_test(${TESTNAME} "" "DashViews-qml")
36+endmacro()
3737
38−add_executable(listviewwithpageheadertestsectionexternalmodelExec listviewwithpageheadertestsectionexternalmodel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
39−qt5_use_modules(listviewwithpageheadertestsectionexternalmodelExec Test Core Qml)
40−target_link_libraries(listviewwithpageheadertestsectionexternalmodelExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
41−add_custom_target(testlistviewwithpageheadersectionexternalmodel ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionexternalmodelExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersectionexternalmodel.xml,xunitxml -o -,txt)
38+add_lvwph_test(listviewwithpageheader ListViewWithPageHeader)
39+add_lvwph_test(listviewwithpageheadersection ListViewWithPageHeaderSection)
40+add_lvwph_test(listviewwithpageheadersectionexternalmodel ListViewWithPageHeaderSectionExternalModel)
4241
4342macro(add_dashview_try_test FILENAME TESTNAME)
44− add_executable(${FILENAME}testExec
43+ add_executable(${TESTNAME}TestExec
4544 ${FILENAME}test.cpp
4645 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
4746 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/abstractdashview.cpp
4847 )
49− qt5_use_modules(${FILENAME}testExec Test Core Qml)
50− target_link_libraries(${FILENAME}testExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
51− add_custom_target(test${TESTNAME}
52− ${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}testExec
53− -o ${CMAKE_BINARY_DIR}/test${TESTNAME}.xml,xunitxml
54− -o -,txt
55− DEPENDS ${FILENAME}testExec DashViews-qml
56− )
48+ qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
49+ target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
5750
58− add_executable(${FILENAME}tryExec
51+ add_binary_qml_test(${TESTNAME} "" "DashViews-qml")
52+
53+ add_executable(${TESTNAME}tryExec
5954 ${FILENAME}try.cpp
6055 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
6156 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/abstractdashview.cpp
6257 )
63− qt5_use_modules(${FILENAME}tryExec Test Core Qml)
64− target_link_libraries(${FILENAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
58+ qt5_use_modules(${TESTNAME}tryExec Test Core Qml)
59+ target_link_libraries(${TESTNAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
6560 add_custom_target(try${TESTNAME}
66− ${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}tryExec
67− DEPENDS ${FILENAME}tryExec DashViews-qml
61+ ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}tryExec
62+ DEPENDS ${TESTNAME}tryExec DashViews-qml
6863 )
6964endmacro()
7065
@@ -72,13 +67,6 @@ add_dashview_try_test(verticaljournal VerticalJournal)
7267add_dashview_try_test(horizontaljournal HorizontalJournal)
7368add_dashview_try_test(organicgrid OrganicGrid)
7469
70+set(qmltest_DEFAULT_TARGETS qmluitests)
7571set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
76−add_qml_test(. listviewwithpageheaderqml IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
77−
78−add_dependencies(qmluitests testlistviewwithpageheader)
79−add_dependencies(qmluitests testlistviewwithpageheadersection)
80−add_dependencies(qmluitests testlistviewwithpageheadersectionexternalmodel)
81−add_dependencies(qmluitests testlistviewwithpageheaderqml)
82−add_dependencies(qmluitests testVerticalJournal)
83−add_dependencies(qmluitests testHorizontalJournal)
84−add_dependencies(qmluitests testOrganicGrid)
72+add_qml_test(. ListViewWithPageHeaderQML IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
tests/plugins/DashViews/listviewwithpageheadertestsectionexternalmodel.cpp → tests/plugins/DashViews/listviewwithpageheadersectionexternalmodeltest.cpprenamed+1−1
@@ -248,4 +248,4 @@ private:
248248
249249QTEST_MAIN(ListViewWithPageHeaderTestSection)
250250
251−#include "listviewwithpageheadertestsectionexternalmodel.moc"
251+#include "listviewwithpageheadersectionexternalmodeltest.moc"
tests/plugins/DashViews/listviewwithpageheadertestsection.cpp → tests/plugins/DashViews/listviewwithpageheadersectiontest.cpprenamed+1−1
@@ -2166,4 +2166,4 @@ private:
21662166
21672167QTEST_MAIN(ListViewWithPageHeaderTestSection)
21682168
2169−#include "listviewwithpageheadertestsection.moc"
2169+#include "listviewwithpageheadersectiontest.moc"
tests/plugins/DashViews/tst_listviewwithpageheaderqml.qml → tests/plugins/DashViews/tst_ListViewWithPageHeaderQML.qmlrenamed

The content is the same.

tests/plugins/Ubuntu/Gestures/CMakeLists.txt+1
@@ -20,6 +20,7 @@ macro(add_gesture_ui_test CLASSNAME)
2020 target_link_libraries(${CLASSNAME}TestExec UbuntuGestureQml)
2121
2222 add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles)
23+ add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
2324endmacro(add_gesture_ui_test)
2425
2526macro(add_gesture_test CLASSNAME)
tests/plugins/Utils/CMakeLists.txt+2−1
@@ -11,7 +11,8 @@ macro(run_tests)
1111 -o ${CMAKE_BINARY_DIR}/${_test}.xml,xunitxml
1212 -o -,txt)
1313 add_test(NAME ${_test} COMMAND ${testCommand})
14− add_custom_target(${_test} ${testCommand})
14+ set_tests_properties(${_test} PROPERTIES ENVIRONMENT "LC_ALL=C")
15+ add_custom_target(${_test} env "LC_ALL=C" ${testCommand})
1516 add_executable(${_test}Exec ${_test}.cpp modeltest.cpp)
1617 qt5_use_modules(${_test}Exec Test Core Qml)
1718 target_link_libraries(${_test}Exec
tests/qmltests/CMakeLists.txt+4−3
@@ -17,7 +17,7 @@ add_qml_test(utils/Unity/Test UnityTest)
1717
1818set(qmltest_DEFAULT_TARGETS qmluitests)
1919set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
20−set(qmltest_DEFAULT_PROPERTIES "")
20+set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LC_ALL=C")
2121
2222add_qml_test(. Shell)
2323add_qml_test(. GreeterShell ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/single")
@@ -70,6 +70,7 @@ add_qml_test(Panel Panel)
7070add_qml_test(Panel SearchIndicator)
7171add_qml_test(Panel/Indicators DefaultIndicatorWidget ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
7272add_qml_test(Panel/Indicators DefaultIndicatorPage ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
73−add_qml_test(Panel/Indicators MenuItemFactory)
74−add_qml_test(Panel/Indicators MessageMenuItemFactory)
73+# These MenuItemFactory tests need the test/mocks/ to come before plugins/
74+add_qml_test(Panel/Indicators MenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
75+add_qml_test(Panel/Indicators MessageMenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
7576add_qml_test(Stages PhoneStage)
tests/qmltests/Components/CMakeLists.txt+1
@@ -11,6 +11,7 @@ qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
1111target_link_libraries(DragHandleTestExec UbuntuGestureQml)
1212
1313add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "")
14+add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
1415
1516add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
1617add_definitions(-DTEST_DIR="${CMAKE_CURRENT_LIST_DIR}")
tests/qmltests/Components/tst_FilterGrid.qml+1−1
@@ -50,6 +50,7 @@ Rectangle {
5050 CheckBox {
5151 id: filterCheckBox
5252 checked: true
53+ onCheckedChanged: filterGrid.setFilter(checked, false /*animate*/)
5354 }
5455 }
5556 }
@@ -99,7 +100,6 @@ Rectangle {
99100 maximumNumberOfColumns: 3
100101 collapsedRowCount:
101102 collapsedRowCountSelector.values[collapsedRowCountSelector.selectedIndex]
102− filter: filterCheckBox.checked
103103 minimumHorizontalSpacing: units.gu(1)
104104 delegateWidth: units.gu(6)
105105 delegateHeight: units.gu(6)
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+21−2
@@ -36,6 +36,8 @@ Rectangle {
3636 property var triggeredDataReviewOnly: { "rating": invalidInputRating, "review": validInputText, "author": null }
3737
3838 property var widgetDataBoth: { "visible": "both", "required": "both" }
39+ property var widgetDataBothRequireRating: { "visible": "both", "required": "rating" }
40+ property var widgetDataBothRequireReview: { "visible": "both", "required": "review" }
3941 property var widgetDataRating: { "visible": "rating", "required": "rating" }
4042 property var widgetDataRatingBroken: { "visible": "rating", "required": "review" }
4143 property var widgetDataReview: { "visible": "review", "required": "review" }
@@ -85,6 +87,14 @@ Rectangle {
8587 {tag: "both, rating-only review", widgetData: widgetDataBoth, inputRating: validInputRating, inputText: invalidInputText, emitted: false},
8688 {tag: "both, review-only review", widgetData: widgetDataBoth, inputRating: invalidInputRating, inputText: validInputText, emitted: false},
8789 {tag: "both, complete review", widgetData: widgetDataBoth, inputRating: validInputRating, inputText: validInputText, emitted: true},
90+ {tag: "both require rating, null review", widgetData: widgetDataBothRequireRating, inputRating: invalidInputRating, inputText: invalidInputText, emitted: false},
91+ {tag: "both require rating, rating-only review", widgetData: widgetDataBothRequireRating, inputRating: validInputRating, inputText: invalidInputText, emitted: true},
92+ {tag: "both require rating, review-only review", widgetData: widgetDataBothRequireRating, inputRating: invalidInputRating, inputText: validInputText, emitted: false},
93+ {tag: "both require rating, complete review", widgetData: widgetDataBothRequireRating, inputRating: validInputRating, inputText: validInputText, emitted: true},
94+ {tag: "both require review, null review", widgetData: widgetDataBothRequireReview, inputRating: invalidInputRating, inputText: invalidInputText, emitted: false},
95+ {tag: "both require review, rating-only review", widgetData: widgetDataBothRequireReview, inputRating: validInputRating, inputText: invalidInputText, emitted: false},
96+ {tag: "both require review, review-only review", widgetData: widgetDataBothRequireReview, inputRating: invalidInputRating, inputText: validInputText, emitted: true},
97+ {tag: "both require review, complete review", widgetData: widgetDataBothRequireReview, inputRating: validInputRating, inputText: validInputText, emitted: true},
8898 {tag: "rating, null review", widgetData: widgetDataRating, inputRating: invalidInputRating, inputText: invalidInputText, emitted: false},
8999 {tag: "rating, rating-only review", widgetData: widgetDataRating, inputRating: validInputRating, inputText: invalidInputText, emitted: true},
90100 {tag: "rating, review-only review", widgetData: widgetDataRating, inputRating: invalidInputRating, inputText: validInputText, emitted: false},
@@ -114,7 +124,9 @@ Rectangle {
114124 verify(rating.visible === true);
115125
116126 rating.value = data.inputRating;
117− if (data.widgetData["required"] !== "rating" || data.inputRating < 0) {
127+ if (data.widgetData["required"] !== "rating" ||
128+ data.widgetData["visible"] !== "rating" ||
129+ data.inputRating < 0) {
118130 compare(spy.count, 0);
119131 } else {
120132 compare(spy.count, 1);
@@ -129,7 +141,14 @@ Rectangle {
129141 reviewTextArea.text = data.inputText;
130142 mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
131143 switch (data.widgetData["required"]) {
132− case "rating": compare(spy.count, 0); break;
144+ case "rating": {
145+ if (rating.visible === false || data.inputRating < 0) {
146+ compare(spy.count, 0);
147+ } else {
148+ compare(spy.count, 1);
149+ }
150+ break;
151+ }
133152 case "both":
134153 default: {
135154 if (data.inputRating < 0 || data.inputText === "") {
tests/qmltests/Dash/tst_GenericScopeView.qml+3−3
@@ -140,7 +140,7 @@ Item {
140140 mouseClick(header, header.width / 2, header.height / 2);
141141 tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
142142 tryCompare(category, "filtered", false);
143− verify(category.height > middleHeight);
143+ tryCompareFunction(function() { return category.height > middleHeight; }, true);
144144
145145 mouseClick(header, header.width / 2, header.height / 2);
146146 verify(category.expandable);
@@ -165,7 +165,7 @@ Item {
165165
166166 mouseClick(header2, header2.width / 2, header2.height / 2);
167167 tryCompare(category2, "filtered", false);
168− tryCompare(category2FilterGrid, "filter", false);
168+ tryCompare(category2FilterGrid, "filtered", false);
169169
170170 categoryListView.positionAtBeginning();
171171
@@ -182,7 +182,7 @@ Item {
182182 mouseClick(header0, header0.width / 2, header0.height / 2);
183183 tryCompare(category0, "filtered", false);
184184 tryCompare(category2, "filtered", true);
185− tryCompare(category2FilterGrid, "filter", true);
185+ tryCompare(category2FilterGrid, "filtered", true);
186186 mouseClick(header0, header0.width / 2, header0.height / 2);
187187 tryCompare(category0, "filtered", true);
188188 tryCompare(category2, "filtered", true);
tests/qmltests/Greeter/tst_Clock.qml+3−3
@@ -71,10 +71,10 @@ Rectangle {
7171 var dateString = Qt.formatDate(dateObj, Qt.DefaultLocaleLongDate)
7272 var timeString = Qt.formatTime(dateObj)
7373
74− clock.enabled = false
74+ clock.visible = false
7575 var timeModel = findInvisibleChild(clock, "timeModel")
7676
77− compare(timeModel.menuObjectPath, "", "Clock shouldn't be connected to Indicators when not active.")
77+ compare(timeModel.menuObjectPath, "", "Clock shouldn't be connected to Indicators when not visible.")
7878
7979 clock.currentDate = dateObj
8080
@@ -83,7 +83,7 @@ Rectangle {
8383 var timeLabel = findChild(clock, "timeLabel")
8484 compare(timeLabel.text, timeString, "Not the expected time")
8585
86− clock.enabled = true
86+ clock.visible = true
8787
8888 verify(timeModel.menuObjectPath != "", "Should be connected to Indicators.")
8989 }
tests/qmltests/Greeter/tst_Lockscreen.qml+1−1
@@ -17,7 +17,7 @@
1717import QtQuick 2.0
1818import QtTest 1.0
1919import ".."
20−import "../../../qml/Greeter"
20+import "../../../qml/Components"
2121import Ubuntu.Components 0.1
2222import LightDM 0.1 as LightDM
2323import Unity.Test 0.1 as UT
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+29−4
@@ -19,6 +19,7 @@ import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import QMenuModel 0.1
2121import Unity.Indicators 0.1 as Indicators
22+import Utils 0.1 as Utils
2223
2324Item {
2425 id: testView
@@ -42,6 +43,10 @@ Item {
4243 }
4344 }
4445
46+ Utils.GDateTimeFormatter {
47+ id: timeFormatter
48+ }
49+
4550 UT.UnityTestCase {
4651 name: "MenuItemFactory"
4752 when: windowShown
@@ -358,8 +363,10 @@ Item {
358363
359364 function test_create_alarmMenu_data() {
360365 return [
361− {label: "testLabel1", enabled: true, icon: "file:///testIcon1" },
362− {label: "testLabel2", enabled: false, icon: "file:///testIcon2" },
366+ {label: "testLabel1", enabled: true, icon: "file:///testIcon1", color: Qt.rgba(0, 0, 0, 0),
367+ time: new Date(2014, 04, 14).getTime()*1000, timeFormat: "%a %d %b %l:%M %p"},
368+ {label: "testLabel2", enabled: false, icon: "file:///testIcon2", color: Qt.rgba(1, 0, 0, 0),
369+ time: new Date(2015, 12, 31).getTime()*1000, timeFormat: "%A" },
363370 ];
364371 }
365372
@@ -368,6 +375,12 @@ Item {
368375 menuData.label = data.label;
369376 menuData.sensitive = data.enabled;
370377 menuData.icon = data.icon;
378+ menuData.ext = {
379+ 'xCanonicalTime': data.time,
380+ 'xCanonicalTimeFormat': data.timeFormat
381+ };
382+ timeFormatter.format = data.timeFormat;
383+ timeFormatter.time = data.time;
371384
372385 loader.data = menuData;
373386 loader.sourceComponent = factory.load(menuData);
@@ -376,13 +389,16 @@ Item {
376389
377390 compare(loader.item.text, data.label, "Label does not match data");
378391 compare(loader.item.iconSource, data.icon, "Icon does not match data");
392+ compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
379393 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
380394 }
381395
382396 function test_create_appointmentMenu_data() {
383397 return [
384− {label: "testLabel1", enabled: true, icon: "file:///testIcon1" },
385− {label: "testLabel2", enabled: false, icon: "file:///testIcon2" },
398+ {label: "testLabel1", enabled: true, icon: "file:///testIcon1", color: Qt.rgba(0, 0, 0, 0),
399+ time: new Date(2014, 04, 14).getTime()*1000, timeFormat: "%a %d %b %l:%M %p"},
400+ {label: "testLabel2", enabled: false, icon: "file:///testIcon2", color: Qt.rgba(1, 0, 0, 0),
401+ time: new Date(2015, 12, 31).getTime()*1000, timeFormat: "%A" },
386402 ];
387403 }
388404
@@ -391,6 +407,13 @@ Item {
391407 menuData.label = data.label;
392408 menuData.sensitive = data.enabled;
393409 menuData.icon = data.icon;
410+ menuData.ext = {
411+ 'xCanonicalColor': data.colour,
412+ 'xCanonicalTime': data.time,
413+ 'xCanonicalTimeFormat': data.timeFormat
414+ };
415+ timeFormatter.format = data.timeFormat;
416+ timeFormatter.time = data.time;
394417
395418 loader.data = menuData;
396419 loader.sourceComponent = factory.load(menuData);
@@ -399,6 +422,8 @@ Item {
399422
400423 compare(loader.item.text, data.label, "Label does not match data");
401424 compare(loader.item.iconSource, data.icon, "Icon does not match data");
425+ compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
426+ compare(loader.item.eventColor, data.color, "Colour does not match data");
402427 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
403428 }
404429
tests/qmltests/tst_GreeterShell.qml+9
@@ -24,6 +24,7 @@ import GSettings 1.0
2424import Unity.Application 0.1
2525import Unity.Test 0.1 as UT
2626import Powerd 0.1
27+import LightDM 0.1 as LightDM
2728
2829import "../../qml"
2930
@@ -75,5 +76,13 @@ Item {
7576 verify(greeterBackground.source.toString().indexOf(data.expected) !== -1)
7677 tryCompare(greeterBackground, "status", Image.Ready)
7778 }
79+
80+ function test_dispatchURLHidesGreeter() {
81+ var greeter = findChild(shell, "greeter")
82+ greeter.showNow()
83+ tryCompare(greeter, "showProgress", 1)
84+ LightDM.URLDispatcher.dispatchURL("application:///notes-app")
85+ tryCompare(greeter, "showProgress", 0)
86+ }
7887 }
7988}
tests/qmltests/tst_Shell.qml−11
@@ -511,16 +511,5 @@ Item {
511511
512512 tryCompare(searchIndicator, "opacity", 0);
513513 }
514−
515− function test_focusRequestedHidesGreeter() {
516− var greeter = findChild(shell, "greeter")
517−
518− greeter.show()
519− tryCompare(greeter, "showProgress", 1)
520−
521− ApplicationManager.focusRequested("notes-app")
522− tryCompare(greeter, "showProgress", 0)
523− waitUntilApplicationWindowIsFullyVisible()
524− }
525514 }
526515}