on xenial help sign in
Merge from trunk
5452aeeMichael Terry
@@ -167,10 +167,6 @@ NB: Manual test or interation doesn't make sense for all components or classes,
167particularly the non-graphical ones. In such cases no "tryFoo" make target is
167particularly the non-graphical ones. In such cases no "tryFoo" make target is
168provided.
168provided.
169
169
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−
174Running autopilot tests
170Running autopilot tests
175=======================
171=======================
176
172
cmake/modules/QmlTest.cmake+2−4
@@ -59,11 +59,11 @@ macro(add_manual_qml_test SUBPATH COMPONENT_NAME)
59endmacro(add_manual_qml_test)
59endmacro(add_manual_qml_test)
60
60
61macro(add_qml_benchmark SUBPATH COMPONENT_NAME ITERATIONS)
61macro(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})
63endmacro(add_qml_benchmark)
63endmacro(add_qml_benchmark)
64
64
65macro(add_qml_test SUBPATH COMPONENT_NAME)
65macro(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})
67endmacro(add_qml_test)
67endmacro(add_qml_test)
68
68
69macro(add_qml_test_internal SUBPATH COMPONENT_NAME ITERATIONS)
69macro(add_qml_test_internal SUBPATH COMPONENT_NAME ITERATIONS)
@@ -156,8 +156,6 @@ macro(add_binary_qml_test CLASS_NAME LD_PATH DEPS)
156
156
157 add_qmltest_target(xvfbtest${CLASS_NAME} "${xvfbtestCommand}" FALSE TRUE)
157 add_qmltest_target(xvfbtest${CLASS_NAME} "${xvfbtestCommand}" FALSE TRUE)
158 add_dependencies(qmluitests xvfbtest${CLASS_NAME})
158 add_dependencies(qmluitests xvfbtest${CLASS_NAME})
159−
160− add_manual_qml_test(. ${CLASS_NAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
161endmacro(add_binary_qml_test)
159endmacro(add_binary_qml_test)
162
160
163macro(add_qmltest_target qmltest_TARGET qmltest_command qmltest_NO_TARGETS qmltest_NO_ADD_TEST)
161macro(add_qmltest_target qmltest_TARGET qmltest_command qmltest_NO_TARGETS qmltest_NO_ADD_TEST)
data/CMakeLists.txt+1−2
@@ -1,10 +1,9 @@
1# generate desktop file
1# generate desktop file
2configure_file(${SHELL_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop @ONLY)
2configure_file(${SHELL_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${SHELL_APP}.desktop @ONLY)
3configure_file(${GREETER_APP}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop @ONLY)
3configure_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)
5
4
6# install desktop files
5# 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
8 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
7 DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
9 )
8 )
10install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GREETER_APP}.desktop
9install(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
12expect stop
12expect stop
13
13
14pre-start script
14pre-start script
15+ # Tell unity-mir to raise SIGSTOP after we start
16+ initctl set-env UNITY_MIR_EMITS_SIGSTOP=1
17+
15 if [ -n "$MIR_SOCKET" ]; then
18 if [ -n "$MIR_SOCKET" ]; then
16 if [ -z "$UNITY_MIR_SOCKET" ]; then
19 if [ -z "$UNITY_MIR_SOCKET" ]; then
17 # Save original value of MIR_SOCKET in case we are restarted,
20 # Save original value of MIR_SOCKET in case we are restarted,
@@ -42,7 +45,12 @@ pre-start script
42 fi
45 fi
43
46
44 initctl emit scope-ui-starting
47 initctl emit scope-ui-starting
45− initctl emit indicator-services-start
48+ initctl emit --no-wait indicator-services-start
46end script
49end script
47
50
48exec ${BINARY:-unity8} $ARGS
51exec ${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+
1unity8 (7.86+14.04.20140306-0ubuntu1) UNRELEASED; urgency=medium
34unity8 (7.86+14.04.20140306-0ubuntu1) UNRELEASED; urgency=medium
2
35
3 * Bump version for Breaks due to unity8-greeter
36 * Bump version for Breaks due to unity8-greeter
debian/control+37−25
@@ -11,35 +11,35 @@ Build-Depends: cmake,
11 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],
11 libgl1-mesa-dev[!armhf] | libgl-dev[!armhf],
12 libgl1-mesa-dri,
12 libgl1-mesa-dri,
13 libgles2-mesa-dev[armhf],
13 libgles2-mesa-dev[armhf],
14+ libglib2.0-dev,
14 libgsettings-qt-dev,
15 libgsettings-qt-dev,
15 libhud-client2-dev,
16 libhud-client2-dev,
16 liblightdm-qt5-3-dev,
17 liblightdm-qt5-3-dev,
17 libpulse-dev,
18 libpulse-dev,
18 libqmenumodel-dev (>= 0.2.7),
19 libqmenumodel-dev (>= 0.2.7),
20+ libqt5xmlpatterns5-dev,
19 libunity-api-dev (>= 7.80.6),
21 libunity-api-dev (>= 7.80.6),
20 libunity-mir-dev,
22 libunity-mir-dev,
21 libusermetricsoutput1-dev,
23 libusermetricsoutput1-dev,
22 libxcb1-dev,
24 libxcb1-dev,
23− libglib2.0-dev,
24 pkg-config,
25 pkg-config,
25− python:any (>= 2.7),
26 python-setuptools,
26 python-setuptools,
27 python3-all:any,
27 python3-all:any,
28 python3-setuptools,
28 python3-setuptools,
29+ python:any (>= 2.7),
29 qt5-default,
30 qt5-default,
30 qtbase5-dev,
31 qtbase5-dev,
31 qtbase5-dev-tools,
32 qtbase5-dev-tools,
32 qtbase5-private-dev,
33 qtbase5-private-dev,
33 qtdeclarative5-dev,
34 qtdeclarative5-dev,
34 qtdeclarative5-dev-tools,
35 qtdeclarative5-dev-tools,
35− qtdeclarative5-qtmultimedia-plugin,
36 qtdeclarative5-private-dev,
36 qtdeclarative5-private-dev,
37+ qtdeclarative5-qtmultimedia-plugin,
37 qtdeclarative5-qtquick2-plugin,
38 qtdeclarative5-qtquick2-plugin,
38 qtdeclarative5-test-plugin,
39 qtdeclarative5-test-plugin,
39 qtdeclarative5-ubuntu-settings-components,
40 qtdeclarative5-ubuntu-settings-components,
40 qtdeclarative5-ubuntu-ui-toolkit-plugin,
41 qtdeclarative5-ubuntu-ui-toolkit-plugin,
41 qtdeclarative5-xmllistmodel-plugin,
42 qtdeclarative5-xmllistmodel-plugin,
42− libqt5xmlpatterns5-dev,
43 ttf-ubuntu-font-family,
43 ttf-ubuntu-font-family,
44Standards-Version: 3.9.4
44Standards-Version: 3.9.4
45Homepage: http://launchpad.net/unity
45Homepage: http://launchpad.net/unity
@@ -61,7 +61,8 @@ Description: Indicators client test application
61
61
62Package: unity-scope-tool
62Package: unity-scope-tool
63Architecture: any
63Architecture: any
64+Depends: unity8-common (= ${source:Version}),
64−Depends: unity8 (= ${binary:Version}),
65+ unity8-private (= ${binary:Version}),
65 ${misc:Depends},
66 ${misc:Depends},
66 ${shlibs:Depends},
67 ${shlibs:Depends},
67Description: Development tool for Unity scopes
68Description: Development tool for Unity scopes
@@ -72,28 +73,19 @@ Package: unity8
72Architecture: any
73Architecture: any
73Provides: indicator-renderer,
74Provides: indicator-renderer,
74Depends: gsettings-desktop-schemas,
75Depends: gsettings-desktop-schemas,
76+ libcap2-bin,
75 libglib2.0-bin,
77 libglib2.0-bin,
76− libunity-mir1,
78+ libunity-mir1 (>= 0.4),
77 qmenumodel-qml (>= 0.2.7),
79 qmenumodel-qml (>= 0.2.7),
78 qtdeclarative5-dee-plugin,
80 qtdeclarative5-dee-plugin,
79 qtdeclarative5-gsettings1.0,
81 qtdeclarative5-gsettings1.0,
80 qtdeclarative5-ubuntu-settings-components,
82 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,
85 qtdeclarative5-xmllistmodel-plugin,
83 qtdeclarative5-xmllistmodel-plugin,
86− unity-application-impl-2,
87 unity-greeter-session-broadcast,
84 unity-greeter-session-broadcast,
88 unity-launcher-impl-3,
85 unity-launcher-impl-3,
89− unity-notifications-impl-2,
86+ unity8-common (= ${source:Version}),
90− unity8-fake-env | unity-application-impl,
91 unity8-private (= ${binary:Version}),
87 unity8-private (= ${binary:Version}),
92 unity8-private | unity-launcher-impl,
88 unity8-private | unity-launcher-impl,
93− unity-plugin-scopes | unity-scopes-impl,
94− unity-scopes-impl-0,
95−# for setcap:
96− libcap2-bin,
97 ${misc:Depends},
89 ${misc:Depends},
98 ${shlibs:Depends},
90 ${shlibs:Depends},
99Recommends: unity-scope-click,
91Recommends: unity-scope-click,
@@ -101,7 +93,7 @@ Recommends: unity-scope-click,
101 unity-scope-scopes,
93 unity-scope-scopes,
102Breaks: indicator-network (<< 0.5.1),
94Breaks: indicator-network (<< 0.5.1),
103 ubuntu-touch-session (<< 0.107),
95 ubuntu-touch-session (<< 0.107),
104−Replaces: ubuntu-touch-session (<< 0.82~)
96+Replaces: ubuntu-touch-session (<< 0.82~),
105Description: Unity 8 shell
97Description: Unity 8 shell
106 The Unity 8 shell is the primary user interface for Ubuntu devices.
98 The Unity 8 shell is the primary user interface for Ubuntu devices.
107
99
@@ -110,14 +102,34 @@ Architecture: any
110Depends: dbus-x11,
102Depends: dbus-x11,
111 libglib2.0-bin,
103 libglib2.0-bin,
112 lightdm,
104 lightdm,
113− unity8 (>= ${source:Version}),
105+ unity8 (= ${source:Version}),
114 ${misc:Depends},
106 ${misc:Depends},
115 ${shlibs:Depends},
107 ${shlibs:Depends},
116−Replaces: unity8 (<< 7.86),
117Breaks: unity8 (<< 7.86),
108Breaks: unity8 (<< 7.86),
109+Replaces: unity8 (<< 7.86),
118Description: Ubuntu QML greeter
110Description: Ubuntu QML greeter
119 The Ubuntu QML greeter is the primary greeter for Ubuntu devices.
111 The Ubuntu QML greeter is the primary greeter for Ubuntu devices.
120
112
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+
121Package: unity8-autopilot
133Package: unity8-autopilot
122Architecture: all
134Architecture: all
123Depends: gir1.2-glib-2.0,
135Depends: gir1.2-glib-2.0,
@@ -134,13 +146,13 @@ Depends: gir1.2-glib-2.0,
134 python3-fixtures,
146 python3-fixtures,
135 python3-gi,
147 python3-gi,
136 ubuntu-ui-toolkit-autopilot,
148 ubuntu-ui-toolkit-autopilot,
137− unity8 (>= ${source:Version}),
149+ unity8 (= ${source:Version}),
138− unity8-fake-env (>= ${source:Version}),
150+ unity8-fake-env (= ${source:Version}),
139− unity8-greeter (>= ${source:Version}),
151+ unity8-greeter (= ${source:Version}),
140 url-dispatcher-tools,
152 url-dispatcher-tools,
141 ${misc:Depends},
153 ${misc:Depends},
142− ${python:Depends},
143 ${python3:Depends},
154 ${python3:Depends},
155+ ${python:Depends},
144 ${shlibs:Depends},
156 ${shlibs:Depends},
145Description: Test package for Unity 8 shell
157Description: Test package for Unity 8 shell
146 Autopilot tests for the unity8 package
158 Autopilot tests for the unity8 package
@@ -162,9 +174,9 @@ Architecture: any
162Multi-Arch: same
174Multi-Arch: same
163Pre-Depends: ${misc:Pre-Depends},
175Pre-Depends: ${misc:Pre-Depends},
164Depends: gsettings-ubuntu-schemas,
176Depends: gsettings-ubuntu-schemas,
177+ libunity-core-6.0-9,
165 ${misc:Depends},
178 ${misc:Depends},
166 ${shlibs:Depends},
179 ${shlibs:Depends},
167− libunity-core-6.0-9,
168Provides: unity-launcher-impl,
180Provides: unity-launcher-impl,
169 unity-launcher-impl-3,
181 unity-launcher-impl-3,
170Description: Unity 8 private libs
182Description: Unity 8 private libs
debian/unity-scope-tool.install−1
@@ -1,3 +1,2 @@
1usr/bin/unity-scope-tool
1usr/bin/unity-scope-tool
2−usr/share/applications/unity-scope-tool.desktop
3usr/share/unity8/ScopeTool.qml
2usr/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
2usr/lib/*/unity8/qml/mocks
1usr/lib/*/unity8/qml/mocks
2+usr/lib/*/unity8/qml/nonmirplugins
3usr/lib/*/unity8/qml/scopefakes
3usr/lib/*/unity8/qml/scopefakes
4usr/share/unity8/mocks
4usr/share/unity8/mocks
debian/unity8-private.install+1−1
@@ -1,7 +1,7 @@
1usr/lib/*/unity8/qml/AccountsService
1usr/lib/*/unity8/qml/AccountsService
2+usr/lib/*/unity8/qml/DashViews
2usr/lib/*/unity8/qml/HudClient
3usr/lib/*/unity8/qml/HudClient
3usr/lib/*/unity8/qml/LightDM
4usr/lib/*/unity8/qml/LightDM
4−usr/lib/*/unity8/qml/DashViews
5usr/lib/*/unity8/qml/Powerd
5usr/lib/*/unity8/qml/Powerd
6usr/lib/*/unity8/qml/SessionBroadcast
6usr/lib/*/unity8/qml/SessionBroadcast
7usr/lib/*/unity8/qml/SessionManager
7usr/lib/*/unity8/qml/SessionManager
debian/unity8.install+1−6
@@ -1,14 +1,9 @@
1+data/unity8.conf usr/share/upstart/sessions/
1usr/bin/unity8
2usr/bin/unity8
2usr/share/applications/unity8.desktop
3usr/share/applications/unity8.desktop
3−usr/share/locale
4usr/share/unity8/Bottombar
4usr/share/unity8/Bottombar
5−usr/share/unity8/Components
6−usr/share/unity8/Dash
7usr/share/unity8/Hud
5usr/share/unity8/Hud
8usr/share/unity8/Launcher
6usr/share/unity8/Launcher
9−usr/share/unity8/Notifications
10usr/share/unity8/Panel
7usr/share/unity8/Panel
11usr/share/unity8/Shell.qml
8usr/share/unity8/Shell.qml
12usr/share/unity8/Stages
9usr/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 {
273 text: menuData && menuData.label || ""
273 text: menuData && menuData.label || ""
274 iconSource: menuData && menuData.icon || "image://theme/calendar"
274 iconSource: menuData && menuData.icon || "image://theme/calendar"
275 time: timeFormatter.timeString
275 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))
277 enabled: menuData && menuData.sensitive || false
277 enabled: menuData && menuData.sensitive || false
278
278
279 onMenuModelChanged: {
279 onMenuModelChanged: {
po/ug.po+5−5
@@ -8,14 +8,14 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2014-03-25 16:48+0100\n"
10"POT-Creation-Date: 2014-03-25 16:48+0100\n"
11−"PO-Revision-Date: 2014-04-14 09:31+0000\n"
11+"PO-Revision-Date: 2014-04-22 05:46+0000\n"
12−"Last-Translator: volkhan <Unknown>\n"
12+"Last-Translator: abdurahman <Unknown>\n"
13"Language-Team: Uyghur <ug@li.org>\n"
13"Language-Team: Uyghur <ug@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17−"X-Launchpad-Export-Date: 2014-04-15 07:57+0000\n"
17+"X-Launchpad-Export-Date: 2014-04-23 07:07+0000\n"
18−"X-Generator: Launchpad (build 16976)\n"
18+"X-Generator: Launchpad (build 16985)\n"
19
19
20#: plugins/Unity/Launcher/launcheritem.cpp:43
20#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:73
21#: plugins/Unity/Launcher/launcheritem.cpp:73
@@ -93,7 +93,7 @@ msgstr "يېقىنقى"
93#: qml/Dash/PreviewListView.qml:52
93#: qml/Dash/PreviewListView.qml:52
94#, qt-format
94#, qt-format
95msgid "%1 Preview"
95msgid "%1 Preview"
96−msgstr ""
96+msgstr "%1 ئالدىن كۆرۈپ بىقىش"
97
97
98#: qml/Dash/Previews/PreviewActionCombo.qml:34
98#: qml/Dash/Previews/PreviewActionCombo.qml:34
99msgid "More..."
99msgid "More..."
qml/Components/FilterGrid.qml+37−24
@@ -28,11 +28,6 @@ import "../Components"
28Item {
28Item {
29 id: root
29 id: root
30
30
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−
36 /* Whether, when collapsed, a button should be displayed enabling the user to expand
31 /* Whether, when collapsed, a button should be displayed enabling the user to expand
37 the grid to its full size. */
32 the grid to its full size. */
38 readonly property bool expandable: model.count > rowsWhenCollapsed * iconTileGrid.columns
33 readonly property bool expandable: model.count > rowsWhenCollapsed * iconTileGrid.columns
@@ -65,30 +60,48 @@ Item {
65 readonly property alias pressDelay: iconTileGrid.pressDelay
60 readonly property alias pressDelay: iconTileGrid.pressDelay
66 property alias highlightIndex: iconTileGrid.highlightIndex
61 property alias highlightIndex: iconTileGrid.highlightIndex
67 readonly property alias currentItem: iconTileGrid.currentItem
62 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+ }
68
75
69− height: !filterAnimation.running ? childrenRect.height : height
76+ height: d.collapsed ? root.collapsedHeight : root.uncollapsedHeight
70 clip: filterAnimation.running
77 clip: filterAnimation.running
71
78
79+ Behavior on height {
80+ id: heightBehaviour
81+ enabled: false
72− NumberAnimation {
82+ NumberAnimation {
73− property bool filterEndValue
74− id: filterAnimation
83+ 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
84+ // Duration and easing here match the ListViewWithPageHeader::m_contentYAnimation
79− // otherwise since both animations can run at the same time you'll get
85+ // otherwise since both animations can run at the same time you'll get
80− // some visual weirdness.
86+ // some visual weirdness.
81− duration: 200
87+ duration: 200
82− easing.type: Easing.InOutQuad
88+ easing.type: Easing.InOutQuad
83− onStopped: {
89+ onRunningChanged: {
84− root.filter = filterEndValue;
90+ if (!running) {
91+ d.filter = d.collapsed;
92+ }
93+ heightBehaviour.enabled = false;
94+ }
85 }
95 }
86 }
96 }
87
97
88− function startFilterAnimation(filter) {
98+ function setFilter(filter, animate) {
89− filterAnimation.filterEndValue = filter
99+ heightBehaviour.enabled = animate;
90− filterAnimation.start();
100+ d.collapsed = filter;
101+ if (!animate || !filter) {
102+ d.filter = filter;
103+ }
91− }
104+ }
92
105
93 ResponsiveGridView {
106 ResponsiveGridView {
94 id: iconTileGrid
107 id: iconTileGrid
@@ -105,7 +118,7 @@ Item {
105
118
106 model: LimitProxyModel {
119 model: LimitProxyModel {
107 model: root.model
120 model: root.model
108− limit: (filter && !filterAnimation.running) ? rowsWhenCollapsed * iconTileGrid.columns : -1
121+ limit: d.filter ? rowsWhenCollapsed * iconTileGrid.columns : -1
109 }
122 }
110 }
123 }
111}
124}
qml/Dash/CardFilterGrid.qml+3−8
@@ -28,9 +28,10 @@ DashRenderer {
28 verticalSpacing: units.gu(1)
28 verticalSpacing: units.gu(1)
29 currentItem: filterGrid.currentItem
29 currentItem: filterGrid.currentItem
30 height: filterGrid.height
30 height: filterGrid.height
31+ filtered: filterGrid.filtered
31
32
32− function startFilterAnimation(filter) {
33+ function setFilter(filter, animate) {
33− filterGrid.startFilterAnimation(filter)
34+ filterGrid.setFilter(filter, animate)
34 }
35 }
35
36
36 FilterGrid {
37 FilterGrid {
@@ -41,7 +42,6 @@ DashRenderer {
41 delegateHeight: cardTool.cardHeight
42 delegateHeight: cardTool.cardHeight
42 verticalSpacing: genericFilterGrid.verticalSpacing
43 verticalSpacing: genericFilterGrid.verticalSpacing
43 model: genericFilterGrid.model
44 model: genericFilterGrid.model
44− filter: genericFilterGrid.filter
45 collapsedRowCount: Math.min(2, cardTool && cardTool.template && cardTool.template["collapsed-rows"] || 2)
45 collapsedRowCount: Math.min(2, cardTool && cardTool.template && cardTool.template["collapsed-rows"] || 2)
46 delegateCreationBegin: genericFilterGrid.delegateCreationBegin
46 delegateCreationBegin: genericFilterGrid.delegateCreationBegin
47 delegateCreationEnd: genericFilterGrid.delegateCreationEnd
47 delegateCreationEnd: genericFilterGrid.delegateCreationEnd
@@ -66,10 +66,5 @@ DashRenderer {
66 onPressAndHold: genericFilterGrid.pressAndHold(index, card.y)
66 onPressAndHold: genericFilterGrid.pressAndHold(index, card.y)
67 }
67 }
68 }
68 }
69−
70− onFilterChanged: {
71− genericFilterGrid.filter = filter
72− filter = Qt.binding(function() { return genericFilterGrid.filter })
73− }
74 }
69 }
75}
70}
qml/Dash/DashRenderer.qml+3−3
@@ -20,8 +20,8 @@ Item {
20 // Can the item be expanded?
20 // Can the item be expanded?
21 property bool expandable: false
21 property bool expandable: false
22
22
23− // In case it can be expanded, should we filter it
23+ // In case it can be expanded, is it filtered
24− property bool filter: true
24+ property bool filtered: true
25
25
26 property int collapsedHeight: height
26 property int collapsedHeight: height
27
27
@@ -58,6 +58,6 @@ Item {
58 /// @param itemY is y of the held delegate
58 /// @param itemY is y of the held delegate
59 signal pressAndHold(int index, real itemY)
59 signal pressAndHold(int index, real itemY)
60
60
61− function startFilterAnimation(filter) {
61+ function setFilter(filter, animate) {
62 }
62 }
63}
63}
qml/Dash/GenericScopeView.qml+13−15
@@ -122,7 +122,7 @@ FocusScope {
122 showDivider: false
122 showDivider: false
123
123
124 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
124 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
126 readonly property string category: categoryId
126 readonly property string category: categoryId
127 readonly property var item: rendererLoader.item
127 readonly property var item: rendererLoader.item
128
128
@@ -168,9 +168,7 @@ FocusScope {
168 item.objectName = Qt.binding(function() { return categoryId })
168 item.objectName = Qt.binding(function() { return categoryId })
169 if (item.expandable) {
169 if (item.expandable) {
170 var shouldFilter = categoryId != categoryView.expandedCategoryId;
170 var shouldFilter = categoryId != categoryView.expandedCategoryId;
171− if (shouldFilter != item.filter) {
171+ item.setFilter(shouldFilter, false /*animate*/);
172− item.filter = shouldFilter;
173− }
174 }
172 }
175 updateDelegateCreationRange();
173 updateDelegateCreationRange();
176 item.cardTool = cardTool;
174 item.cardTool = cardTool;
@@ -219,11 +217,8 @@ FocusScope {
219 var shrinkingVisible = shouldFilter && y + item.collapsedHeight < categoryView.height;
217 var shrinkingVisible = shouldFilter && y + item.collapsedHeight < categoryView.height;
220 var growingVisible = !shouldFilter && y + height < categoryView.height;
218 var growingVisible = !shouldFilter && y + height < categoryView.height;
221 if (!previewListView.open || !shouldFilter) {
219 if (!previewListView.open || !shouldFilter) {
222− if (shrinkingVisible || growingVisible) {
220+ var animate = shrinkingVisible || growingVisible;
223− item.startFilterAnimation(shouldFilter)
221+ item.setFilter(shouldFilter, animate)
224− } else {
225− item.filter = shouldFilter;
226− }
227 if (!shouldFilter && !previewListView.open) {
222 if (!shouldFilter && !previewListView.open) {
228 categoryView.maximizeVisibleArea(index, item.uncollapsedHeight);
223 categoryView.maximizeVisibleArea(index, item.uncollapsedHeight);
229 }
224 }
@@ -238,12 +233,15 @@ FocusScope {
238 }
233 }
239
234
240 function updateDelegateCreationRange() {
235 function updateDelegateCreationRange() {
236+ if (categoryView.moving) {
241− // Do not update the range if we are overshooting up or down, since we'll come back
237+ // 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
238+ // to the stable position and delete/create items without any reason
243− if (categoryView.contentY < categoryView.originY) {
239+ if (categoryView.contentY < categoryView.originY) {
244− return;
240+ return;
241+ } else if (categoryView.contentHeight - categoryView.originY > categoryView.height &&
245− } else if (categoryView.contentHeight > categoryView.height && categoryView.contentY + categoryView.height > categoryView.contentHeight) {
242+ categoryView.contentY + categoryView.height > categoryView.contentHeight) {
246− return;
243+ return;
244+ }
247 }
245 }
248
246
249 if (item && item.hasOwnProperty("delegateCreationBegin")) {
247 if (item && item.hasOwnProperty("delegateCreationBegin")) {
qml/Dash/Previews/PreviewRatingInput.qml+2−2
@@ -155,8 +155,8 @@ PreviewWidget {
155 objectName: "submitButton"
155 objectName: "submitButton"
156
156
157 readonly property bool readyToSubmit: {
157 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;
160 else return true;
160 else return true;
161 }
161 }
162
162
qml/Greeter/Clock.qml+3−6
@@ -24,14 +24,11 @@ Item {
24 implicitWidth: childrenRect.width
24 implicitWidth: childrenRect.width
25 implicitHeight: childrenRect.height
25 implicitHeight: childrenRect.height
26
26
27− // Allows to set the current Date. Will be overwritten if active
27+ // Allows to set the current Date. Will be overwritten if visible
28 property date currentDate
28 property date currentDate
29
29
30− // If active, time will be updated through the indicators service
31− property bool active: clock.enabled && clock.visible
32−
33 Component.onCompleted: {
30 Component.onCompleted: {
34− if (active) {
31+ if (visible) {
35 currentDate = new Date()
32 currentDate = new Date()
36 }
33 }
37 }
34 }
@@ -42,7 +39,7 @@ Item {
42
39
43 busName: "com.canonical.indicator.datetime"
40 busName: "com.canonical.indicator.datetime"
44 actionsObjectPath: "/com/canonical/indicator/datetime"
41 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" : ""
46
43
47 Indicators.RootActionState {
44 Indicators.RootActionState {
48 menu: timeModel.model
45 menu: timeModel.model
qml/Shell.qml−1
@@ -217,7 +217,6 @@ BasicShell {
217 shown = true;
217 shown = true;
218 panel.indicators.hide();
218 panel.indicators.hide();
219 edgeDemo.stopDemo();
219 edgeDemo.stopDemo();
220− greeter.hide();
221 if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
220 if (!ApplicationManager.focusedApplicationId && ApplicationManager.count > 0 && focusApp) {
222 ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
221 ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
223 }
222 }
tests/autopilot/unity8/shell/__init__.py+50−1
@@ -21,8 +21,9 @@
21
21
22from time import sleep
22from time import sleep
23from functools import wraps
23from functools import wraps
24−import logging
24+from gi.repository import Notify
25
25
26+import logging
26
27
27logger = logging.getLogger(__name__)
28logger = logging.getLogger(__name__)
28
29
@@ -48,6 +49,7 @@ def disable_qml_mocking(fn):
48 return fn(*args, **kwargs)
49 return fn(*args, **kwargs)
49 return wrapper
50 return wrapper
50
51
52+
51class DragMixin(object):
53class DragMixin(object):
52 def _drag(self, x1, y1, x2, y2):
54 def _drag(self, x1, y1, x2, y2):
53 # XXX This ugly code is here just temporarily, waiting for drag
55 # XXX This ugly code is here just temporarily, waiting for drag
@@ -69,3 +71,50 @@ class DragMixin(object):
69 self.touch._finger_move(int(x2), int(y2))
71 self.touch._finger_move(int(x2), int(y2))
70 except AttributeError:
72 except AttributeError:
71 self.touch._device.finger_move(int(x2), int(y2))
73 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):
195 category)
195 category)
196 grid = category_element.select_single('CardFilterGrid')
196 grid = category_element.select_single('CardFilterGrid')
197 filtergrid = grid.select_single('FilterGrid')
197 filtergrid = grid.select_single('FilterGrid')
198− if (grid.filter):
198+ if (grid.filtered):
199 return filtergrid.collapsedRowCount * filtergrid.columns
199 return filtergrid.collapsedRowCount * filtergrid.columns
200 else:
200 else:
201 return filtergrid.uncollapsedRowCount * filtergrid.columns
201 return filtergrid.uncollapsedRowCount * filtergrid.columns
tests/autopilot/unity8/shell/tests/test_notifications.py+14−57
@@ -21,6 +21,7 @@
21
21
22from __future__ import absolute_import
22from __future__ import absolute_import
23
23
24+from unity8 import shell
24from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
25from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
25
26
26from testtools.matchers import Equals, NotEquals
27from testtools.matchers import Equals, NotEquals
@@ -63,7 +64,8 @@ class NotificationsBase(UnityTestCase):
63 if os.path.abspath(__file__).startswith('/usr/'):
64 if os.path.abspath(__file__).startswith('/usr/'):
64 return '/usr/share/unity8/graphics/' + icon_name
65 return '/usr/share/unity8/graphics/' + icon_name
65 else:
66 else:
66− return os.path.dirname(__file__) + "/../../../../../qml/graphics/" + icon_name
67+ return os.path.dirname(__file__) + (
68+ "/../../../../../qml/graphics/" + icon_name)
67
69
68 def _get_notifications_list(self):
70 def _get_notifications_list(self):
69 return self.main_window.select_single(
71 return self.main_window.select_single(
@@ -350,7 +352,7 @@ class EphemeralNotificationsTests(NotificationsBase):
350 )
352 )
351 ]
353 ]
352
354
353− notification = self._create_ephemeral_notification(
355+ notification = shell.create_ephemeral_notification(
354 summary,
356 summary,
355 body,
357 body,
356 icon_path,
358 icon_path,
@@ -386,7 +388,7 @@ class EphemeralNotificationsTests(NotificationsBase):
386 )
388 )
387 ]
389 ]
388
390
389− notification = self._create_ephemeral_notification(
391+ notification = shell.create_ephemeral_notification(
390 summary,
392 summary,
391 None,
393 None,
392 None,
394 None,
@@ -427,7 +429,7 @@ class EphemeralNotificationsTests(NotificationsBase):
427 body_critical = 'Dude, this is so urgent you have no idea :)'
429 body_critical = 'Dude, this is so urgent you have no idea :)'
428 icon_path_critical = self._get_icon_path('avatars/anna_olsson.png')
430 icon_path_critical = self._get_icon_path('avatars/anna_olsson.png')
429
431
430− notification_normal = self._create_ephemeral_notification(
432+ notification_normal = shell.create_ephemeral_notification(
431 summary_normal,
433 summary_normal,
432 body_normal,
434 body_normal,
433 icon_path_normal,
435 icon_path_normal,
@@ -435,7 +437,7 @@ class EphemeralNotificationsTests(NotificationsBase):
435 )
437 )
436 notification_normal.show()
438 notification_normal.show()
437
439
438− notification_low = self._create_ephemeral_notification(
440+ notification_low = shell.create_ephemeral_notification(
439 summary_low,
441 summary_low,
440 body_low,
442 body_low,
441 icon_path_low,
443 icon_path_low,
@@ -443,7 +445,7 @@ class EphemeralNotificationsTests(NotificationsBase):
443 )
445 )
444 notification_low.show()
446 notification_low.show()
445
447
446− notification_critical = self._create_ephemeral_notification(
448+ notification_critical = shell.create_ephemeral_notification(
447 summary_critical,
449 summary_critical,
448 body_critical,
450 body_critical,
449 icon_path_critical,
451 icon_path_critical,
@@ -503,7 +505,7 @@ class EphemeralNotificationsTests(NotificationsBase):
503 summary = 'Summary-Body'
505 summary = 'Summary-Body'
504 body = 'This is a superfluous notification'
506 body = 'This is a superfluous notification'
505
507
506− notification = self._create_ephemeral_notification(summary, body)
508+ notification = shell.create_ephemeral_notification(summary, body)
507 notification.show()
509 notification.show()
508
510
509 notification = notify_list.wait_select_single(
511 notification = notify_list.wait_select_single(
@@ -526,7 +528,7 @@ class EphemeralNotificationsTests(NotificationsBase):
526
528
527 summary = 'Summary-Only'
529 summary = 'Summary-Only'
528
530
529− notification = self._create_ephemeral_notification(summary)
531+ notification = shell.create_ephemeral_notification(summary)
530 notification.show()
532 notification.show()
531
533
532 notification = notify_list.wait_select_single(
534 notification = notify_list.wait_select_single(
@@ -545,7 +547,7 @@ class EphemeralNotificationsTests(NotificationsBase):
545 body = 'This is the original content of this notification-bubble.'
547 body = 'This is the original content of this notification-bubble.'
546 icon_path = self._get_icon_path('avatars/funky.png')
548 icon_path = self._get_icon_path('avatars/funky.png')
547
549
548− notification = self._create_ephemeral_notification(
550+ notification = shell.create_ephemeral_notification(
549 summary,
551 summary,
550 body,
552 body,
551 icon_path
553 icon_path
@@ -584,7 +586,7 @@ class EphemeralNotificationsTests(NotificationsBase):
584 icon_path = self._get_icon_path('avatars/anna_olsson.png')
586 icon_path = self._get_icon_path('avatars/anna_olsson.png')
585 hint_icon = self._get_icon_path('applicationIcons/phone-app.png')
587 hint_icon = self._get_icon_path('applicationIcons/phone-app.png')
586
588
587− notification = self._create_ephemeral_notification(
589+ notification = shell.create_ephemeral_notification(
588 summary,
590 summary,
589 body,
591 body,
590 icon_path
592 icon_path
@@ -627,7 +629,7 @@ class EphemeralNotificationsTests(NotificationsBase):
627 body = 'Hey Bro Coly!'
629 body = 'Hey Bro Coly!'
628 icon_path = self._get_icon_path('avatars/amanda.png')
630 icon_path = self._get_icon_path('avatars/amanda.png')
629 body_sum = body
631 body_sum = body
630− notification = self._create_ephemeral_notification(
632+ notification = shell.create_ephemeral_notification(
631 summary,
633 summary,
632 body,
634 body,
633 icon_path,
635 icon_path,
@@ -663,7 +665,7 @@ class EphemeralNotificationsTests(NotificationsBase):
663 for new_body in bodies:
665 for new_body in bodies:
664 body = new_body
666 body = new_body
665 body_sum += '\n' + body
667 body_sum += '\n' + body
666− notification = self._create_ephemeral_notification(
668+ notification = shell.create_ephemeral_notification(
667 summary,
669 summary,
668 body,
670 body,
669 icon_path,
671 icon_path,
@@ -684,48 +686,3 @@ class EphemeralNotificationsTests(NotificationsBase):
684 False,
686 False,
685 1.0
687 1.0
686 )
688 )
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):
82 ))
82 ))
83
83
84 def test_no_sigstop(self):
84 def test_no_sigstop(self):
85− self.patch_environment("UPSTART_JOB", "foo")
85+ self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "")
86 self._launch_unity()
86 self._launch_unity()
87 self._set_proxy()
87 self._set_proxy()
88
88
@@ -91,7 +91,7 @@ class UpstartIntegrationTests(UnityTestCase):
91 logger.debug("Unity loaded and ready.")
91 logger.debug("Unity loaded and ready.")
92
92
93 def test_expect_sigstop(self):
93 def test_expect_sigstop(self):
94− self.patch_environment("UPSTART_JOB", "unity8")
94+ self.patch_environment("UNITY_MIR_EMITS_SIGSTOP", "1")
95 self._launch_unity()
95 self._launch_unity()
96 self.assertThat(lambda: os.WIFSTOPPED(self._get_status()), Eventually(Equals(True)), "Unity8 should raise SIGSTOP when ready")
96 self.assertThat(lambda: os.WIFSTOPPED(self._get_status()), Eventually(Equals(True)), "Unity8 should raise SIGSTOP when ready")
97
97
tests/mocks/liblightdm/Greeter.cpp+11
@@ -151,12 +151,23 @@ void Greeter::setLanguage (const QString &language)
151 Q_UNUSED(language)
151 Q_UNUSED(language)
152}
152}
153
153
154+void Greeter::setResettable (bool resettable)
155+{
156+ Q_UNUSED(resettable)
157+}
158+
154bool Greeter::startSessionSync(const QString &session)
159bool Greeter::startSessionSync(const QString &session)
155{
160{
156 Q_UNUSED(session)
161 Q_UNUSED(session)
157 return true;
162 return true;
158}
163}
159
164
165+QString Greeter::ensureSharedDataDirSync(const QString &username)
166+{
167+ Q_UNUSED(username)
168+ return "";
169+}
170+
160void Greeter::respond(const QString &response)
171void Greeter::respond(const QString &response)
161{
172{
162 Q_D(Greeter);
173 Q_D(Greeter);
tests/mocks/liblightdm/Greeter.h+4
@@ -88,13 +88,17 @@ public Q_SLOTS:
88 void respond(const QString &response);
88 void respond(const QString &response);
89 void cancelAuthentication();
89 void cancelAuthentication();
90 void setLanguage (const QString &language);
90 void setLanguage (const QString &language);
91+ void setResettable (bool resettable);
91 bool startSessionSync(const QString &session=QString());
92 bool startSessionSync(const QString &session=QString());
93+ QString ensureSharedDataDirSync(const QString &username);
92
94
93Q_SIGNALS:
95Q_SIGNALS:
94 void showMessage(QString text, QLightDM::Greeter::MessageType type);
96 void showMessage(QString text, QLightDM::Greeter::MessageType type);
95 void showPrompt(QString text, QLightDM::Greeter::PromptType type);
97 void showPrompt(QString text, QLightDM::Greeter::PromptType type);
96 void authenticationComplete();
98 void authenticationComplete();
97 void autologinTimerExpired();
99 void autologinTimerExpired();
100+ void idle();
101+ void reset();
98
102
99private:
103private:
100 GreeterPrivate *d_ptr;
104 GreeterPrivate *d_ptr;
tests/plugins/DashViews/CMakeLists.txt+23−35
@@ -25,46 +25,41 @@ remove_definitions(-DQT_NO_KEYWORDS)
25add_definitions(-DDASHVIEWSTEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
25add_definitions(-DDASHVIEWSTEST_FOLDER="${CMAKE_CURRENT_SOURCE_DIR}")
26add_definitions(-DBUILT_PLUGINS_DIR="${CMAKE_BINARY_DIR}/plugins")
26add_definitions(-DBUILT_PLUGINS_DIR="${CMAKE_BINARY_DIR}/plugins")
27
27
28+macro(add_lvwph_test FILENAME TESTNAME)
29+ add_executable(${TESTNAME}TestExec
30+ ${FILENAME}test.cpp
28−add_executable(listviewwithpageheadertestExec listviewwithpageheadertest.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
31+ ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
29−qt5_use_modules(listviewwithpageheadertestExec Test Core Qml)
32+ qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
30−target_link_libraries(listviewwithpageheadertestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
33+ target_link_libraries(${TESTNAME}TestExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
31−add_custom_target(testlistviewwithpageheader ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheader.xml,xunitxml -o -,txt)
32
34
33−add_executable(listviewwithpageheadertestsectionExec listviewwithpageheadertestsection.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
35+ add_binary_qml_test(${TESTNAME} "" "DashViews-qml")
34−qt5_use_modules(listviewwithpageheadertestsectionExec Test Core Qml)
36+endmacro()
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)
37
37
38−add_executable(listviewwithpageheadertestsectionexternalmodelExec listviewwithpageheadertestsectionexternalmodel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/listviewwithpageheader.cpp)
38+add_lvwph_test(listviewwithpageheader ListViewWithPageHeader)
39−qt5_use_modules(listviewwithpageheadertestsectionexternalmodelExec Test Core Qml)
39+add_lvwph_test(listviewwithpageheadersection ListViewWithPageHeaderSection)
40−target_link_libraries(listviewwithpageheadertestsectionexternalmodelExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
40+add_lvwph_test(listviewwithpageheadersectionexternalmodel ListViewWithPageHeaderSectionExternalModel)
41−add_custom_target(testlistviewwithpageheadersectionexternalmodel ${CMAKE_CURRENT_BINARY_DIR}/listviewwithpageheadertestsectionexternalmodelExec -o ${CMAKE_BINARY_DIR}/testlistviewwithpageheadersectionexternalmodel.xml,xunitxml -o -,txt)
42
41
43macro(add_dashview_try_test FILENAME TESTNAME)
42macro(add_dashview_try_test FILENAME TESTNAME)
44− add_executable(${FILENAME}testExec
43+ add_executable(${TESTNAME}TestExec
45 ${FILENAME}test.cpp
44 ${FILENAME}test.cpp
46 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
45 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
47 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/abstractdashview.cpp
46 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/abstractdashview.cpp
48 )
47 )
49− qt5_use_modules(${FILENAME}testExec Test Core Qml)
48+ qt5_use_modules(${TESTNAME}TestExec Test Core Qml)
50− target_link_libraries(${FILENAME}testExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
49+ target_link_libraries(${TESTNAME}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− )
57
50
51+ add_binary_qml_test(${TESTNAME} "" "DashViews-qml")
52+
58− add_executable(${FILENAME}tryExec
53+ add_executable(${TESTNAME}tryExec
59 ${FILENAME}try.cpp
54 ${FILENAME}try.cpp
60 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
55 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/${FILENAME}.cpp
61 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/abstractdashview.cpp
56 ${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/DashViews/abstractdashview.cpp
62 )
57 )
63− qt5_use_modules(${FILENAME}tryExec Test Core Qml)
58+ qt5_use_modules(${TESTNAME}tryExec Test Core Qml)
64− target_link_libraries(${FILENAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
59+ target_link_libraries(${TESTNAME}tryExec ${Qt5Gui_LIBRARIES} ${Qt5Quick_LIBRARIES})
65 add_custom_target(try${TESTNAME}
60 add_custom_target(try${TESTNAME}
66− ${CMAKE_CURRENT_BINARY_DIR}/${FILENAME}tryExec
61+ ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}tryExec
67− DEPENDS ${FILENAME}tryExec DashViews-qml
62+ DEPENDS ${TESTNAME}tryExec DashViews-qml
68 )
63 )
69endmacro()
64endmacro()
70
65
@@ -72,13 +67,6 @@ add_dashview_try_test(verticaljournal VerticalJournal)
72add_dashview_try_test(horizontaljournal HorizontalJournal)
67add_dashview_try_test(horizontaljournal HorizontalJournal)
73add_dashview_try_test(organicgrid OrganicGrid)
68add_dashview_try_test(organicgrid OrganicGrid)
74
69
70+set(qmltest_DEFAULT_TARGETS qmluitests)
75set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
71set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
76−add_qml_test(. listviewwithpageheaderqml IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
72+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)
tests/plugins/DashViews/listviewwithpageheadertestsectionexternalmodel.cpp → tests/plugins/DashViews/listviewwithpageheadersectionexternalmodeltest.cpprenamed+1−1
@@ -248,4 +248,4 @@ private:
248
248
249QTEST_MAIN(ListViewWithPageHeaderTestSection)
249QTEST_MAIN(ListViewWithPageHeaderTestSection)
250
250
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:
2166
2166
2167QTEST_MAIN(ListViewWithPageHeaderTestSection)
2167QTEST_MAIN(ListViewWithPageHeaderTestSection)
2168
2168
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)
20 target_link_libraries(${CLASSNAME}TestExec UbuntuGestureQml)
20 target_link_libraries(${CLASSNAME}TestExec UbuntuGestureQml)
21
21
22 add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles)
22 add_binary_qml_test(${CLASSNAME} ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures UbuntuGesturesTestQmlFiles)
23+ add_manual_qml_test(. ${CLASSNAME} IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
23endmacro(add_gesture_ui_test)
24endmacro(add_gesture_ui_test)
24
25
25macro(add_gesture_test CLASSNAME)
26macro(add_gesture_test CLASSNAME)
tests/plugins/Utils/CMakeLists.txt+2−1
@@ -11,7 +11,8 @@ macro(run_tests)
11 -o ${CMAKE_BINARY_DIR}/${_test}.xml,xunitxml
11 -o ${CMAKE_BINARY_DIR}/${_test}.xml,xunitxml
12 -o -,txt)
12 -o -,txt)
13 add_test(NAME ${_test} COMMAND ${testCommand})
13 add_test(NAME ${_test} COMMAND ${testCommand})
14+ set_tests_properties(${_test} PROPERTIES ENVIRONMENT "LC_ALL=C")
14− add_custom_target(${_test} ${testCommand})
15+ add_custom_target(${_test} env "LC_ALL=C" ${testCommand})
15 add_executable(${_test}Exec ${_test}.cpp modeltest.cpp)
16 add_executable(${_test}Exec ${_test}.cpp modeltest.cpp)
16 qt5_use_modules(${_test}Exec Test Core Qml)
17 qt5_use_modules(${_test}Exec Test Core Qml)
17 target_link_libraries(${_test}Exec
18 target_link_libraries(${_test}Exec
tests/qmltests/CMakeLists.txt+4−3
@@ -17,7 +17,7 @@ add_qml_test(utils/Unity/Test UnityTest)
17
17
18set(qmltest_DEFAULT_TARGETS qmluitests)
18set(qmltest_DEFAULT_TARGETS qmluitests)
19set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
19set(qmltest_DEFAULT_NO_ADD_TEST TRUE)
20−set(qmltest_DEFAULT_PROPERTIES "")
20+set(qmltest_DEFAULT_PROPERTIES ENVIRONMENT "LC_ALL=C")
21
21
22add_qml_test(. Shell)
22add_qml_test(. Shell)
23add_qml_test(. GreeterShell ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/single")
23add_qml_test(. GreeterShell ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/liblightdm/single")
@@ -70,6 +70,7 @@ add_qml_test(Panel Panel)
70add_qml_test(Panel SearchIndicator)
70add_qml_test(Panel SearchIndicator)
71add_qml_test(Panel/Indicators DefaultIndicatorWidget ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
71add_qml_test(Panel/Indicators DefaultIndicatorWidget ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
72add_qml_test(Panel/Indicators DefaultIndicatorPage ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
72add_qml_test(Panel/Indicators DefaultIndicatorPage ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/tests/mocks/QMenuModel")
73+# These MenuItemFactory tests need the test/mocks/ to come before plugins/
73−add_qml_test(Panel/Indicators MenuItemFactory)
74+add_qml_test(Panel/Indicators MenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
74−add_qml_test(Panel/Indicators MessageMenuItemFactory)
75+add_qml_test(Panel/Indicators MessageMenuItemFactory IMPORT_PATHS ${CMAKE_BINARY_DIR}/tests/mocks ${qmltest_DEFAULT_IMPORT_PATHS})
75add_qml_test(Stages PhoneStage)
76add_qml_test(Stages PhoneStage)
tests/qmltests/Components/CMakeLists.txt+1
@@ -11,6 +11,7 @@ qt5_use_modules(DragHandleTestExec Test Core Qml Gui Quick)
11target_link_libraries(DragHandleTestExec UbuntuGestureQml)
11target_link_libraries(DragHandleTestExec UbuntuGestureQml)
12
12
13add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "")
13add_binary_qml_test(DragHandle ${CMAKE_BINARY_DIR}/plugins/Ubuntu/Gestures "")
14+add_manual_qml_test(. DragHandle IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins)
14
15
15add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
16add_definitions(-DUBUNTU_GESTURES_PLUGIN_DIR="${CMAKE_BINARY_DIR}/plugins")
16add_definitions(-DTEST_DIR="${CMAKE_CURRENT_LIST_DIR}")
17add_definitions(-DTEST_DIR="${CMAKE_CURRENT_LIST_DIR}")
tests/qmltests/Components/tst_FilterGrid.qml+1−1
@@ -50,6 +50,7 @@ Rectangle {
50 CheckBox {
50 CheckBox {
51 id: filterCheckBox
51 id: filterCheckBox
52 checked: true
52 checked: true
53+ onCheckedChanged: filterGrid.setFilter(checked, false /*animate*/)
53 }
54 }
54 }
55 }
55 }
56 }
@@ -99,7 +100,6 @@ Rectangle {
99 maximumNumberOfColumns: 3
100 maximumNumberOfColumns: 3
100 collapsedRowCount:
101 collapsedRowCount:
101 collapsedRowCountSelector.values[collapsedRowCountSelector.selectedIndex]
102 collapsedRowCountSelector.values[collapsedRowCountSelector.selectedIndex]
102− filter: filterCheckBox.checked
103 minimumHorizontalSpacing: units.gu(1)
103 minimumHorizontalSpacing: units.gu(1)
104 delegateWidth: units.gu(6)
104 delegateWidth: units.gu(6)
105 delegateHeight: units.gu(6)
105 delegateHeight: units.gu(6)
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+21−2
@@ -36,6 +36,8 @@ Rectangle {
36 property var triggeredDataReviewOnly: { "rating": invalidInputRating, "review": validInputText, "author": null }
36 property var triggeredDataReviewOnly: { "rating": invalidInputRating, "review": validInputText, "author": null }
37
37
38 property var widgetDataBoth: { "visible": "both", "required": "both" }
38 property var widgetDataBoth: { "visible": "both", "required": "both" }
39+ property var widgetDataBothRequireRating: { "visible": "both", "required": "rating" }
40+ property var widgetDataBothRequireReview: { "visible": "both", "required": "review" }
39 property var widgetDataRating: { "visible": "rating", "required": "rating" }
41 property var widgetDataRating: { "visible": "rating", "required": "rating" }
40 property var widgetDataRatingBroken: { "visible": "rating", "required": "review" }
42 property var widgetDataRatingBroken: { "visible": "rating", "required": "review" }
41 property var widgetDataReview: { "visible": "review", "required": "review" }
43 property var widgetDataReview: { "visible": "review", "required": "review" }
@@ -85,6 +87,14 @@ Rectangle {
85 {tag: "both, rating-only review", widgetData: widgetDataBoth, inputRating: validInputRating, inputText: invalidInputText, emitted: false},
87 {tag: "both, rating-only review", widgetData: widgetDataBoth, inputRating: validInputRating, inputText: invalidInputText, emitted: false},
86 {tag: "both, review-only review", widgetData: widgetDataBoth, inputRating: invalidInputRating, inputText: validInputText, emitted: false},
88 {tag: "both, review-only review", widgetData: widgetDataBoth, inputRating: invalidInputRating, inputText: validInputText, emitted: false},
87 {tag: "both, complete review", widgetData: widgetDataBoth, inputRating: validInputRating, inputText: validInputText, emitted: true},
89 {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},
88 {tag: "rating, null review", widgetData: widgetDataRating, inputRating: invalidInputRating, inputText: invalidInputText, emitted: false},
98 {tag: "rating, null review", widgetData: widgetDataRating, inputRating: invalidInputRating, inputText: invalidInputText, emitted: false},
89 {tag: "rating, rating-only review", widgetData: widgetDataRating, inputRating: validInputRating, inputText: invalidInputText, emitted: true},
99 {tag: "rating, rating-only review", widgetData: widgetDataRating, inputRating: validInputRating, inputText: invalidInputText, emitted: true},
90 {tag: "rating, review-only review", widgetData: widgetDataRating, inputRating: invalidInputRating, inputText: validInputText, emitted: false},
100 {tag: "rating, review-only review", widgetData: widgetDataRating, inputRating: invalidInputRating, inputText: validInputText, emitted: false},
@@ -114,7 +124,9 @@ Rectangle {
114 verify(rating.visible === true);
124 verify(rating.visible === true);
115
125
116 rating.value = data.inputRating;
126 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) {
118 compare(spy.count, 0);
130 compare(spy.count, 0);
119 } else {
131 } else {
120 compare(spy.count, 1);
132 compare(spy.count, 1);
@@ -129,7 +141,14 @@ Rectangle {
129 reviewTextArea.text = data.inputText;
141 reviewTextArea.text = data.inputText;
130 mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
142 mouseClick(submitButton, submitButton.width / 2, submitButton.height / 2);
131 switch (data.widgetData["required"]) {
143 switch (data.widgetData["required"]) {
144+ case "rating": {
145+ if (rating.visible === false || data.inputRating < 0) {
132− case "rating": compare(spy.count, 0); break;
146+ compare(spy.count, 0);
147+ } else {
148+ compare(spy.count, 1);
149+ }
150+ break;
151+ }
133 case "both":
152 case "both":
134 default: {
153 default: {
135 if (data.inputRating < 0 || data.inputText === "") {
154 if (data.inputRating < 0 || data.inputText === "") {
tests/qmltests/Dash/tst_GenericScopeView.qml+3−3
@@ -140,7 +140,7 @@ Item {
140 mouseClick(header, header.width / 2, header.height / 2);
140 mouseClick(header, header.width / 2, header.height / 2);
141 tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
141 tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
142 tryCompare(category, "filtered", false);
142 tryCompare(category, "filtered", false);
143− verify(category.height > middleHeight);
143+ tryCompareFunction(function() { return category.height > middleHeight; }, true);
144
144
145 mouseClick(header, header.width / 2, header.height / 2);
145 mouseClick(header, header.width / 2, header.height / 2);
146 verify(category.expandable);
146 verify(category.expandable);
@@ -165,7 +165,7 @@ Item {
165
165
166 mouseClick(header2, header2.width / 2, header2.height / 2);
166 mouseClick(header2, header2.width / 2, header2.height / 2);
167 tryCompare(category2, "filtered", false);
167 tryCompare(category2, "filtered", false);
168− tryCompare(category2FilterGrid, "filter", false);
168+ tryCompare(category2FilterGrid, "filtered", false);
169
169
170 categoryListView.positionAtBeginning();
170 categoryListView.positionAtBeginning();
171
171
@@ -182,7 +182,7 @@ Item {
182 mouseClick(header0, header0.width / 2, header0.height / 2);
182 mouseClick(header0, header0.width / 2, header0.height / 2);
183 tryCompare(category0, "filtered", false);
183 tryCompare(category0, "filtered", false);
184 tryCompare(category2, "filtered", true);
184 tryCompare(category2, "filtered", true);
185− tryCompare(category2FilterGrid, "filter", true);
185+ tryCompare(category2FilterGrid, "filtered", true);
186 mouseClick(header0, header0.width / 2, header0.height / 2);
186 mouseClick(header0, header0.width / 2, header0.height / 2);
187 tryCompare(category0, "filtered", true);
187 tryCompare(category0, "filtered", true);
188 tryCompare(category2, "filtered", true);
188 tryCompare(category2, "filtered", true);
tests/qmltests/Greeter/tst_Clock.qml+3−3
@@ -71,10 +71,10 @@ Rectangle {
71 var dateString = Qt.formatDate(dateObj, Qt.DefaultLocaleLongDate)
71 var dateString = Qt.formatDate(dateObj, Qt.DefaultLocaleLongDate)
72 var timeString = Qt.formatTime(dateObj)
72 var timeString = Qt.formatTime(dateObj)
73
73
74− clock.enabled = false
74+ clock.visible = false
75 var timeModel = findInvisibleChild(clock, "timeModel")
75 var timeModel = findInvisibleChild(clock, "timeModel")
76
76
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.")
78
78
79 clock.currentDate = dateObj
79 clock.currentDate = dateObj
80
80
@@ -83,7 +83,7 @@ Rectangle {
83 var timeLabel = findChild(clock, "timeLabel")
83 var timeLabel = findChild(clock, "timeLabel")
84 compare(timeLabel.text, timeString, "Not the expected time")
84 compare(timeLabel.text, timeString, "Not the expected time")
85
85
86− clock.enabled = true
86+ clock.visible = true
87
87
88 verify(timeModel.menuObjectPath != "", "Should be connected to Indicators.")
88 verify(timeModel.menuObjectPath != "", "Should be connected to Indicators.")
89 }
89 }
tests/qmltests/Greeter/tst_Lockscreen.qml+1−1
@@ -17,7 +17,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import QtTest 1.0
18import QtTest 1.0
19import ".."
19import ".."
20−import "../../../qml/Greeter"
20+import "../../../qml/Components"
21import Ubuntu.Components 0.1
21import Ubuntu.Components 0.1
22import LightDM 0.1 as LightDM
22import LightDM 0.1 as LightDM
23import Unity.Test 0.1 as UT
23import Unity.Test 0.1 as UT
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+29−4
@@ -19,6 +19,7 @@ import QtTest 1.0
19import Unity.Test 0.1 as UT
19import Unity.Test 0.1 as UT
20import QMenuModel 0.1
20import QMenuModel 0.1
21import Unity.Indicators 0.1 as Indicators
21import Unity.Indicators 0.1 as Indicators
22+import Utils 0.1 as Utils
22
23
23Item {
24Item {
24 id: testView
25 id: testView
@@ -42,6 +43,10 @@ Item {
42 }
43 }
43 }
44 }
44
45
46+ Utils.GDateTimeFormatter {
47+ id: timeFormatter
48+ }
49+
45 UT.UnityTestCase {
50 UT.UnityTestCase {
46 name: "MenuItemFactory"
51 name: "MenuItemFactory"
47 when: windowShown
52 when: windowShown
@@ -358,8 +363,10 @@ Item {
358
363
359 function test_create_alarmMenu_data() {
364 function test_create_alarmMenu_data() {
360 return [
365 return [
361− {label: "testLabel1", enabled: true, icon: "file:///testIcon1" },
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"},
362− {label: "testLabel2", enabled: false, icon: "file:///testIcon2" },
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" },
363 ];
370 ];
364 }
371 }
365
372
@@ -368,6 +375,12 @@ Item {
368 menuData.label = data.label;
375 menuData.label = data.label;
369 menuData.sensitive = data.enabled;
376 menuData.sensitive = data.enabled;
370 menuData.icon = data.icon;
377 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;
371
384
372 loader.data = menuData;
385 loader.data = menuData;
373 loader.sourceComponent = factory.load(menuData);
386 loader.sourceComponent = factory.load(menuData);
@@ -376,13 +389,16 @@ Item {
376
389
377 compare(loader.item.text, data.label, "Label does not match data");
390 compare(loader.item.text, data.label, "Label does not match data");
378 compare(loader.item.iconSource, data.icon, "Icon does not match data");
391 compare(loader.item.iconSource, data.icon, "Icon does not match data");
392+ compare(loader.item.time, timeFormatter.timeString, "Time does not match data");
379 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
393 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
380 }
394 }
381
395
382 function test_create_appointmentMenu_data() {
396 function test_create_appointmentMenu_data() {
383 return [
397 return [
384− {label: "testLabel1", enabled: true, icon: "file:///testIcon1" },
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"},
385− {label: "testLabel2", enabled: false, icon: "file:///testIcon2" },
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" },
386 ];
402 ];
387 }
403 }
388
404
@@ -391,6 +407,13 @@ Item {
391 menuData.label = data.label;
407 menuData.label = data.label;
392 menuData.sensitive = data.enabled;
408 menuData.sensitive = data.enabled;
393 menuData.icon = data.icon;
409 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;
394
417
395 loader.data = menuData;
418 loader.data = menuData;
396 loader.sourceComponent = factory.load(menuData);
419 loader.sourceComponent = factory.load(menuData);
@@ -399,6 +422,8 @@ Item {
399
422
400 compare(loader.item.text, data.label, "Label does not match data");
423 compare(loader.item.text, data.label, "Label does not match data");
401 compare(loader.item.iconSource, data.icon, "Icon does not match data");
424 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");
402 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
427 compare(loader.item.enabled, data.enabled, "Enabled does not match data");
403 }
428 }
404
429
tests/qmltests/tst_GreeterShell.qml+9
@@ -24,6 +24,7 @@ import GSettings 1.0
24import Unity.Application 0.1
24import Unity.Application 0.1
25import Unity.Test 0.1 as UT
25import Unity.Test 0.1 as UT
26import Powerd 0.1
26import Powerd 0.1
27+import LightDM 0.1 as LightDM
27
28
28import "../../qml"
29import "../../qml"
29
30
@@ -75,5 +76,13 @@ Item {
75 verify(greeterBackground.source.toString().indexOf(data.expected) !== -1)
76 verify(greeterBackground.source.toString().indexOf(data.expected) !== -1)
76 tryCompare(greeterBackground, "status", Image.Ready)
77 tryCompare(greeterBackground, "status", Image.Ready)
77 }
78 }
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+ }
78 }
87 }
79}
88}
tests/qmltests/tst_Shell.qml−11
@@ -511,16 +511,5 @@ Item {
511
511
512 tryCompare(searchIndicator, "opacity", 0);
512 tryCompare(searchIndicator, "opacity", 0);
513 }
513 }
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− }
525 }
514 }
526}
515}