on xenial help sign in
Merge trunk
commitd26a12be3d0f283e548d648836b3ccf111f02da0 authorAlbert Astals <albert.astals@canonical.com> dateWed 29 Jan 2014, 17:41 (13 years ago) parenta91da85886ef41
14 files changed+275−68
debian/changelog+102 po/bg.po+39−31 qml/Components/DragHandle.qml+7−7 qml/Components/PageHeader.qml+1 qml/Components/ResponsiveGridView.qml+1−1 qml/Dash/Card.qml+1 qml/Dash/CardHeader.qml+5−1 tests/autopilot/unity8/shell/emulators/dash.py+1−1 tests/autopilot/unity8/shell/tests/test_notifications.py+3−4 tests/qmltests/Components/tst_DragHandle.cpp+65−10 tests/qmltests/Components/tst_ResponsiveGridView.qml+1−1 tests/qmltests/Dash/tst_Card.qml+21−4 tests/qmltests/Dash/tst_CardHeader.qml+13−8 tests/qmltests/Dash/tst_GenericScopeView.qml+15
debian/changelog+102
@@ -1,3 +1,105 @@
1+unity8 (7.84+14.04.20140128-0ubuntu1) trusty; urgency=low
2+
3+ [ Michal Hruby ]
4+ * Added unity-scope-tool, which will help when developing scopes.
5+
6+ [ Michał Sawicz ]
7+ * Added unity-scope-tool, which will help when developing scopes.
8+ * Use full DashContent, not just GenericScopeView in ScopeTool.qml.
9+ * Bring Card and CardHeader over from new-scopes.
10+ * Work around bug #1268578. (LP: #1268578)
11+ * Drop unnecessary version dependencies.
12+ * Return null instead of undefined from findChild and
13+ findInvisibleChild.
14+ * Fix CardHeader and Card heights (empty Label does have non-zero
15+ height apparently). Also improve test robustness and reduce future
16+ diffs.
17+
18+ [ Albert Astals ]
19+ * Do not assert if the item we are removing was not created yet
20+ (because e.g. it's not in the viewport).
21+ * Position correctly the pointer of the search history box .
22+ * Make test_filter_expand_expand less unstable in CI VMs Make sure
23+ header0 is the header0 we want to click On the CI VM stuff is a bit
24+ slower than on real hw and we were clicking in the wrong place.
25+ * Add TabBar to the Dash header navigation Changes this comes with: *
26+ DashBar at the bottom is gone * PageHeader doesn't have a Label
27+ anymore, it has the childItem property where you add which thing it
28+ has to contain * New: PageHeaderLabel mimics the old behaviour of
29+ PageHeader * The header of the LVWPH of GenericScopeView is now fake
30+ and only used for positioning. There is a single global floating
31+ header in DashContent (which is a PageHeader with a TabBar as
32+ childItem) * The GenericScopeView previewLoader and OpenEffect have
33+ been also moved to the DashContent so that the openEffect includes
34+ the floating header in the "animation" .
35+ * Introduce the HorizontalJournal.
36+ * If there are no items m_firstVisibleIndex has to be -1 .
37+ * Add some more documentation about tests to the CODING file.
38+ * Fixes to the journal cmake tests code * Output to the correct
39+ filename for the test * Don't output stuff from the tryXYZ targets.
40+ * Adapt to findChild return value changes .
41+ * Organic Grid for the Dash View.
42+ * Misc journal fixes Don't init *modelIndex to INT_MAX Makes no sense
43+ since we're not doing any qMin and the calling function also accepts
44+ any index >= 0 as valid so in some cases it may end up wanting to
45+ create an index that doesn't exist Don't refill if height() < 0,
46+ that gives bad ranges for from/to and the code gets confused .
47+
48+ [ Michał Karnicki ]
49+ * Fix grid view column count.
50+ * Add test for minimum number of items in a carousel.
51+
52+ [ Allan LeSage ]
53+ * Add stubs for indicators autopilot tests.
54+
55+ [ Andrea Cimitan ]
56+ * Avoid input falling through notifications onto surfaces below, thus
57+ fixing LP: #1257312. (LP: #1257312)
58+
59+ [ Leo Arias ]
60+ * Close the Touch devices after the tests. (LP: #1267600)
61+ * Added methods to scroll to other scopes on autopilot tests.
62+ * Added autopilot helpers for the app scope and the app preview.
63+ Install the fake scopes in order to use them on the tests. (LP:
64+ #1269114)
65+ * On autopilot helpers, wait for the scope category to appear.
66+
67+ [ Nick Dedekind ]
68+ * Visual updates for indicator panel highlight and opening opacity.
69+ * Added inidcator tests for page & item factories.
70+ * Fixes visible indicator misalignment in indicator items/menus
71+ (lp#1264678). (LP: #1264678)
72+
73+ [ Mirco Müller ]
74+ * Fixed the failure of notification autopilot-test
75+ test_sd_incoming_call.
76+
77+ [ Michael Zanetti ]
78+ * clean up fullscreen notifications code.
79+ * import qml files into cmake, drop qmlproject.
80+ * also add qml files in tests directory.
81+ * Added autopilot helpers for the app scope and the app preview.
82+ Install the fake scopes in order to use them on the tests. (LP:
83+ #1269114)
84+
85+ [ Michael Terry ]
86+ * Fix failure to build when using the ./build script with ninja-build
87+ installed. (LP: #1268525)
88+ * Point DBus-activated processes at unity8's MIR_SOCKET rather than
89+ the system socket.
90+
91+ [ Daniel d'Andrada ]
92+ * DragHandle: Never restart hinting animation while still pressed (LP:
93+ #1269022)
94+
95+ [ Bill Filler ]
96+ * fix for lp:1259294, turn off auto capitalization for wifi password
97+ field. (LP: #1259294)
98+ * disable predictive text in Dash search field as it interferes with
99+ built-in search (LP: #1273643)
100+
101+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 28 Jan 2014 15:58:45 +0000
102+
1103unity8 (7.84+14.04.20131220-0ubuntu1) trusty; urgency=low
2104
3105 [ Michał Sawicz ]
po/bg.po+39−31
@@ -8,113 +8,121 @@ msgstr ""
88"Project-Id-Version: unity\n"
99"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
1010"POT-Creation-Date: 2013-11-29 09:21+0100\n"
11−"PO-Revision-Date: 2013-06-27 00:06+0000\n"
12−"Last-Translator: Miroslav E. Hadzhiev (Хаджиев) "
13−"<miroslav.hadzhiev@gmail.com>\n"
11+"PO-Revision-Date: 2014-01-28 19:22+0000\n"
12+"Last-Translator: Atanas Kovachki <Unknown>\n"
1413"Language-Team: Bulgarian <bg@li.org>\n"
1514"MIME-Version: 1.0\n"
1615"Content-Type: text/plain; charset=UTF-8\n"
1716"Content-Transfer-Encoding: 8bit\n"
1817"Plural-Forms: nplurals=2; plural=n != 1;\n"
19−"X-Launchpad-Export-Date: 2013-12-29 06:04+0000\n"
20−"X-Generator: Launchpad (build 16877)\n"
18+"X-Launchpad-Export-Date: 2014-01-29 06:08+0000\n"
19+"X-Generator: Launchpad (build 16916)\n"
2120
2221#: Components/EdgeDemoOverlay.qml:151
2322msgid "Skip intro"
24−msgstr ""
23+msgstr "Пропусни интрото"
2524
2625#: Components/EdgeDemo.qml:112
2726msgid "Right edge"
28−msgstr ""
27+msgstr "Десен край"
2928
3029#: Components/EdgeDemo.qml:113
3130msgid "Try swiping from the right edge to unlock the phone"
3231msgstr ""
32+"Опитайте се да приплъзнете пръста си от десния край към левия, за да "
33+"отключите телефона"
3334
3435#: Components/EdgeDemo.qml:144
3536msgid "Top edge"
36−msgstr ""
37+msgstr "Горен край"
3738
3839#: Components/EdgeDemo.qml:145
3940msgid "Try swiping from the top edge to access the indicators"
4041msgstr ""
42+"Опитайте се да приплъзнете пръста си от горния край към долния, за да "
43+"получите достъп до индикаторите"
4144
4245#: Components/EdgeDemo.qml:170
4346msgid "Close"
44−msgstr ""
47+msgstr "Затвори"
4548
4649#: Components/EdgeDemo.qml:171
4750msgid "Swipe up again to close the settings screen"
4851msgstr ""
52+"Отново приплъзнете пръста си нагоре за да затворите екрана с настройките"
4953
5054#: Components/EdgeDemo.qml:198
5155msgid "Left edge"
52−msgstr ""
56+msgstr "Ляв край"
5357
5458#: Components/EdgeDemo.qml:199
5559msgid "Swipe from the left to reveal the launcher for quick access to apps"
5660msgstr ""
61+"Приплъзнете пръста си от левия край към десния, за да отворите стартера за "
62+"бърз достъп до приложенията"
5763
5864#: Components/EdgeDemo.qml:226
5965msgid "Well done"
60−msgstr ""
66+msgstr "Великолепно"
6167
6268#: Components/EdgeDemo.qml:227
6369msgid ""
6470"You have now mastered the edge gestures and can start using the "
6571"phone<br><br>Tap anywhere to start"
6672msgstr ""
73+"Сега, когато сте научили основните движения, можете да започнете да "
74+"използвате телефона си.<br><br>Натиснете някъде за да започнете"
6775
6876#: Components/PageHeader.qml:364
6977msgid "Recent searches"
70−msgstr "Скорошни търсения"
78+msgstr "Последни търсения"
7179
7280#: Dash/Apps/AppPreview.qml:135
7381msgid "Rate this"
74−msgstr ""
82+msgstr "Оценете това"
7583
7684#. TRANSLATORS: Number of persons who rated this app/video/whatever
7785#: Dash/Previews/Header.qml:93
7886#, qt-format
7987msgid "(%1)"
80−msgstr ""
88+msgstr "(%1)"
8189
8290#. TRANSLATORS: Number of persons who wrote reviews for this app/video/whatever
8391#: Dash/Previews/Header.qml:105
8492#, qt-format
8593msgid "%1 review"
8694msgid_plural "%1 reviews"
87−msgstr[0] ""
88−msgstr[1] ""
95+msgstr[0] "%1 отзив"
96+msgstr[1] "%1 отзива"
8997
9098#: Dash/Previews/Reviews.qml:74
9199msgid "Add a review"
92−msgstr ""
100+msgstr "Добави отзив"
93101
94102#: Dash/Previews/Reviews.qml:86
95103msgid "Review"
96−msgstr ""
104+msgstr "Отзив"
97105
98106#: Dash/Previews/Reviews.qml:121
99107msgid "Send"
100−msgstr ""
108+msgstr "Изпрати"
101109
102110#: Dash/Previews/Reviews.qml:139
103111msgid "Comments:"
104−msgstr ""
112+msgstr "Коментари:"
105113
106114#: Greeter/Lockscreen.qml:149
107115msgid "Emergency Call"
108−msgstr ""
116+msgstr "Спешно повикване"
109117
110118#: Greeter/PassphraseLockscreen.qml:59
111119#, qt-format
112120msgid "Hello %1"
113−msgstr ""
121+msgstr "Здравей, %1"
114122
115123#: Greeter/PassphraseLockscreen.qml:59
116124msgid "Hello"
117−msgstr ""
125+msgstr "Здравей"
118126
119127#: Hud/HudParametrizedActionsPage.qml:132
120128msgid "Confirm"
@@ -122,23 +130,23 @@ msgstr "Потвърди"
122130
123131#: Hud/Hud.qml:61 Hud/Hud.qml:99 Hud/Hud.qml:372
124132msgid "Type or say a command"
125−msgstr ""
133+msgstr "Въведете или кажете команда"
126134
127135#: Hud/Hud.qml:84
128136msgid "Loading. Please Wait..."
129−msgstr ""
137+msgstr "Зарежда се. Моля, почакайте..."
130138
131139#: Hud/Hud.qml:89
132140msgid "Speak Now..."
133−msgstr ""
141+msgstr "Говорете сега..."
134142
135143#: Hud/Hud.qml:94
136144msgid "Speaking..."
137−msgstr ""
145+msgstr "Говорете..."
138146
139147#: Notifications/NotificationMenuItemFactory.qml:89
140148msgid "Show password"
141−msgstr ""
149+msgstr "Покажи паролата"
142150
143151#: Panel/SearchIndicator.qml:27
144152msgid "Search"
@@ -147,13 +155,13 @@ msgstr "Търсене"
147155#: plugins/Unity/Launcher/launcheritem.cpp:43
148156#: plugins/Unity/Launcher/launcheritem.cpp:73
149157msgid "Lock to Launcher"
150−msgstr ""
158+msgstr "Заключване към панела"
151159
152160#: plugins/Unity/Launcher/launcheritem.cpp:73
153161msgid "Unlock from Launcher"
154−msgstr ""
162+msgstr "Отключи от панела за стартиране"
155163
156164#: Shell.qml:439
157165#, qt-format
158166msgid "Please enter %1"
159−msgstr ""
167+msgstr "Моля, въведете %1"
qml/Components/DragHandle.qml+7−7
@@ -97,7 +97,7 @@ EdgeDragArea {
9797 // Private stuff
9898 QtObject {
9999 id: d
100− property var previousStatus: undefined
100+ property var previousStatus: DirectionalDragArea.WaitingForTouch
101101 property real startValue
102102 property real minValue: Direction.isPositive(direction) ? startValue
103103 : startValue - maxTotalDragDistance
@@ -193,14 +193,14 @@ EdgeDragArea {
193193 d.rollbackDrag();
194194 }
195195 } else /* Undecided || Recognized */ {
196− if (d.previousStatus === DirectionalDragArea.WaitingForTouch ||
197− d.previousStatus === undefined) {
196+ if (d.previousStatus === DirectionalDragArea.WaitingForTouch) {
198197 dragEvaluator.reset();
199198 d.startValue = parent[d.targetProp];
200− }
201− if (hintDisplacement > 0) {
202− hintingAnimation.targetValue = d.startValue;
203− hintingAnimation.start();
199+
200+ if (hintDisplacement > 0) {
201+ hintingAnimation.targetValue = d.startValue;
202+ hintingAnimation.start();
203+ }
204204 }
205205 }
206206
qml/Components/PageHeader.qml+1
@@ -145,6 +145,7 @@ Item {
145145 anchors.fill: parent
146146 anchors.margins: units.gu(1)
147147
148+ inputMethodHints: Qt.ImhNoPredictiveText
148149 hasClearButton: false
149150
150151 primaryItem: AbstractButton {
qml/Components/ResponsiveGridView.qml+1−1
@@ -72,7 +72,7 @@ Item {
7272
7373 function columnsForSpacing(spacing) {
7474 // minimum margin is half of the spacing
75− return Math.max(1, Math.floor((parent.width - spacing/2) / (delegateWidth + spacing)));
75+ return Math.max(1, Math.floor(parent.width / (delegateWidth + spacing)));
7676 }
7777
7878 property real allocatableHorizontalSpace: parent.width - columns * delegateWidth
qml/Dash/Card.qml+1
@@ -79,5 +79,6 @@ Item {
7979 maximumLineCount: 5
8080 elide: Text.ElideRight
8181 text: cardData && cardData["summary"] || ""
82+ height: text ? implicitHeight : 0
8283 }
8384}
qml/Dash/CardHeader.qml+5−1
@@ -56,9 +56,9 @@ Item {
5656
5757 Label {
5858 id: titleLabel
59+ objectName: "titleLabel"
5960 anchors { left: parent.left; right: parent.right }
6061 elide: Text.ElideRight
61− objectName: "titleLabel"
6262 font.weight: Font.DemiBold
6363 wrapMode: Text.Wrap
6464 maximumLineCount: 2
@@ -66,6 +66,7 @@ Item {
6666
6767 Label {
6868 id: subtitleLabel
69+ objectName: "subtitleLabel"
6970 anchors { left: parent.left; right: parent.right }
7071 elide: Text.ElideRight
7172 visible: titleLabel.text && text
@@ -90,6 +91,7 @@ Item {
9091 elide: Text.ElideRight
9192 font.weight: Font.DemiBold
9293 color: Theme.palette.selected.foreground
94+ visible: text
9395 }
9496
9597 Label {
@@ -98,6 +100,7 @@ Item {
98100 width: parent.labelWidth
99101 elide: Text.ElideRight
100102 horizontalAlignment: parent.labels === 3 ? Text.AlignHCenter : Text.AlignRight
103+ visible: text
101104 }
102105
103106 Label {
@@ -105,6 +108,7 @@ Item {
105108 width: parent.labelWidth
106109 elide: Text.ElideRight
107110 horizontalAlignment: Text.AlignRight
111+ visible: text
108112 }
109113 }
110114 }
tests/autopilot/unity8/shell/emulators/dash.py+1−1
@@ -158,7 +158,7 @@ class DashApps(emulators.UnityEmulatorBase):
158158
159159 def _get_category_element(self, category):
160160 try:
161− return self.select_single(
161+ return self.wait_select_single(
162162 'Base', objectName='dashCategory{}'.format(category))
163163 except dbus.StateNotFoundError:
164164 raise emulators.UnityEmulatorException(
tests/autopilot/unity8/shell/tests/test_notifications.py+3−4
@@ -59,7 +59,7 @@ class NotificationsBase(UnityTestCase):
5959 return '/usr/share/unity8/graphics/' + icon_name
6060 else:
6161 return os.path.abspath(
62− os.getcwd() + "/../../graphics/" + icon_name
62+ os.getcwd() + "../../qml/graphics/" + icon_name
6363 )
6464
6565 def _get_notifications_list(self):
@@ -161,8 +161,6 @@ class InteractiveNotificationBase(NotificationsBase):
161161 unity_proxy = self.launch_unity()
162162 unlock_unity(unity_proxy)
163163
164− notify_list = self._get_notifications_list()
165−
166164 summary = "Incoming call"
167165 body = "Frank Zappa\n+44 (0)7736 027340"
168166 icon_path = self._get_icon_path('avatars/anna_olsson.png')
@@ -191,8 +189,9 @@ class InteractiveNotificationBase(NotificationsBase):
191189 hints
192190 )
193191
192+ notify_list = self._get_notifications_list()
194193 get_notification = lambda: notify_list.wait_select_single(
195− 'Notification', objectName='notification1')
194+ 'Notification', objectName='notification0')
196195 notification = get_notification()
197196 self._assert_notification(notification, None, None, True, True, 1.0)
198197 initial_height = notification.height
tests/qmltests/Components/tst_DragHandle.cpp+65−10
@@ -62,9 +62,13 @@ private Q_SLOTS:
6262 void stretch_horizontal();
6363 void stretch_vertical();
6464 void hintingAnimation();
65+ void hintingAnimation_dontRestartAfterFinishedAndStillPressed();
66+
6567
6668private:
6769 void flickAndHold(DirectionalDragArea *dragHandle, qreal distance);
70+ void drag(QPointF &touchPoint, const QPointF& direction, qreal distance,
71+ int numSteps, qint64 timeMs = 500);
6872 DirectionalDragArea *fetchAndSetupDragHandle(const char *objectName);
6973 qreal fetchDragThreshold(DirectionalDragArea *dragHandle);
7074 void tryCompare(std::function<qreal ()> actualFunc, qreal expectedValue);
@@ -161,25 +165,29 @@ void tst_DragHandle::flickAndHold(DirectionalDragArea *dragHandle,
161165 QPointF initialTouchPos = dragHandle->mapToScene(
162166 QPointF(dragHandle->width() / 2.0, dragHandle->height() / 2.0));
163167 QPointF touchPoint = initialTouchPos;
164− int numSteps = 10;
165− qint64 flickTimeMs = 500;
166− qint64 timeStep = flickTimeMs / numSteps;
167168
169+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
170+
171+ int numSteps = 10;
168172 QPointF dragDirectionVector = calculateDirectionVector(dragHandle);
169− QPointF touchMovement = dragDirectionVector * (distance / (qreal)numSteps);
173+ drag(touchPoint, dragDirectionVector, distance, numSteps);
170174
171− QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
175+ // Wait for quite a bit before finally releasing to make a very low flick/release
176+ // speed.
177+ m_fakeTimeSource->m_msecsSinceReference += 5000;
178+ QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
179+}
172180
181+void tst_DragHandle::drag(QPointF &touchPoint, const QPointF& direction, qreal distance,
182+ int numSteps, qint64 timeMs)
183+{
184+ qint64 timeStep = timeMs / numSteps;
185+ QPointF touchMovement = direction * (distance / (qreal)numSteps);
173186 for (int i = 0; i < numSteps; ++i) {
174187 touchPoint += touchMovement;
175188 m_fakeTimeSource->m_msecsSinceReference += timeStep;
176189 QTest::touchEvent(m_view, m_device).move(0, touchPoint.toPoint());
177190 }
178−
179− // Wait for quite a bit before finally releasing to make a very low flick/release
180− // speed.
181− m_fakeTimeSource->m_msecsSinceReference += 5000;
182− QTest::touchEvent(m_view, m_device).release(0, touchPoint.toPoint());
183191}
184192
185193DirectionalDragArea *tst_DragHandle::fetchAndSetupDragHandle(const char *objectName)
@@ -389,6 +397,53 @@ void tst_DragHandle::hintingAnimation()
389397 QCOMPARE(parentItem->property("shown").toBool(), false);
390398}
391399
400+/*
401+ Regression test for LP#1269022: https://bugs.launchpad.net/unity8/+bug/1269022
402+
403+ 1) Click on handle.
404+ 2) wait for hint portion to appear
405+ 3) slowly drag handle, only a few pixels
406+
407+ Expected outcome:
408+ Nothing happens
409+
410+ Actual outcome:
411+ Handle will momentarily move back to zero position, then back down to the
412+ hint displacement location.
413+ */
414+void tst_DragHandle::hintingAnimation_dontRestartAfterFinishedAndStillPressed()
415+{
416+ DirectionalDragArea *dragHandle = fetchAndSetupDragHandle("downwardsDragHandle");
417+ QQuickItem *parentItem = dragHandle->parentItem();
418+ qreal hintDisplacement = 100.0;
419+
420+ // enable hinting animations
421+ m_view->rootObject()->setProperty("hintDisplacement", QVariant(hintDisplacement));
422+ m_view->rootObject()->setProperty("stretch", QVariant(true));
423+
424+ QCOMPARE(parentItem->height(), 0.0);
425+
426+ QPointF initialTouchPos = dragHandle->mapToScene(
427+ QPointF(dragHandle->width() / 2.0, dragHandle->height() / 2.0));
428+ QPointF touchPoint = initialTouchPos;
429+
430+ // Pressing causes the Showable to be stretched by hintDisplacement pixels
431+ const int touchId = 0;
432+ QTest::touchEvent(m_view, m_device).press(touchId, touchPoint.toPoint());
433+ tryCompare([&](){ return parentItem->height(); }, hintDisplacement);
434+
435+
436+ QSignalSpy parentHeightChangedSpy(parentItem, SIGNAL(heightChanged()));
437+
438+ drag(touchPoint, QPointF(0.0, -1.0) /*dragDirectionVector*/, 15 /*distance*/, 3 /*numSteps*/);
439+
440+ // Give some time for animations to run, if any
441+ QTest::qWait(300);
442+
443+ // parentItem height shouldn't have changed at all
444+ QVERIFY(parentHeightChangedSpy.isEmpty());
445+}
446+
392447QTEST_MAIN(tst_DragHandle)
393448
394449#include "tst_DragHandle.moc"
tests/qmltests/Components/tst_ResponsiveGridView.qml+1−1
@@ -152,7 +152,7 @@ Item {
152152 var data = new Array()
153153
154154 data.push({selectedIndex: 0, minHSpacing:0, columnCount: 13})
155− data.push({selectedIndex: 1, minHSpacing:units.gu(2), columnCount: 9})
155+ data.push({selectedIndex: 1, minHSpacing:units.gu(2), columnCount: 10})
156156 data.push({selectedIndex: 2, minHSpacing:units.gu(8), columnCount: 5})
157157 data.push({selectedIndex: 3, minHSpacing:units.gu(25), columnCount: 2})
158158
tests/qmltests/Dash/tst_Card.qml+21−4
@@ -106,6 +106,10 @@ Rectangle {
106106 "layout": { "template": { "card-layout": "horizontal" },
107107 "components": JSON.parse(fullMapping) }
108108 },
109+ {
110+ "name": "Art, header - vertical",
111+ "layout": { "components": Helpers.update(JSON.parse(root.fullMapping), { "summary": undefined }) }
112+ },
109113 ]
110114
111115 Card {
@@ -189,7 +193,10 @@ Rectangle {
189193 property Item summary: findChild(card, "summaryLabel")
190194
191195 function initTestCase() {
192− verify(testCase.header !== undefined, "Couldn't find header object.");
196+ verify(typeof testCase.header === "object", "Couldn't find header object.");
197+ verify(typeof testCase.art === "object", "Couldn't find art object.");
198+ verify(typeof testCase.artImage === "object", "Couldn't find artImage object.");
199+ verify(typeof testCase.summary === "object", "Couldn't find summary object.");
193200 }
194201
195202 function cleanup() {
@@ -237,6 +244,9 @@ Rectangle {
237244 { tag: "Large", width: units.gu(38), size: "large", index: 0 },
238245 { tag: "Wide", width: units.gu(18.5), aspect: 0.5, index: 0 },
239246 { tag: "Horizontal", width: units.gu(38), index: 5 },
247+ // Make sure card ends with header when there's no summary
248+ { tag: "NoSummary", height: function() { return header.y + header.height }, index: 6 },
249+ { tag: "HorizontalNoSummary", height: function() { return header.height }, card_layout: "horizontal", index: 6 },
240250 ]
241251 }
242252
@@ -248,6 +258,11 @@ Rectangle {
248258 card.templateChanged();
249259 }
250260
261+ if (data.hasOwnProperty("card_layout")) {
262+ card.template['card-layout'] = data.card_layout;
263+ card.templateChanged();
264+ }
265+
251266 if (data.hasOwnProperty("aspect")) {
252267 card.components['art']['aspect-ratio'] = data.aspect;
253268 card.componentsChanged();
@@ -257,7 +272,9 @@ Rectangle {
257272 tryCompare(card, "width", data.width);
258273 }
259274
260− if (data.hasOwnProperty("height")) {
275+ if (typeof data.height === "function") {
276+ tryCompareFunction(function() { return card.height === data.height() }, true);
277+ } else if (data.hasOwnProperty("height")) {
261278 tryCompare(card, "height", data.height);
262279 }
263280 }
@@ -308,7 +325,7 @@ Rectangle {
308325 function test_art_layout_data() {
309326 return [
310327 { tag: "Vertical", left: function() { return 0 }, index: 0},
311− { tag: "Horizontal", left: function() { return art.width }, index: 5 }
328+ { tag: "Horizontal", left: function() { return art.width }, index: 5 },
312329 ];
313330 }
314331
@@ -323,7 +340,7 @@ Rectangle {
323340 { tag: "Vertical", top: function() { return art.y + art.height },
324341 left: function() { return art.x }, index: 0 },
325342 { tag: "Horizontal", top: function() { return art.y },
326− left: function() { return art.x + art.width }, index: 5 }
343+ left: function() { return art.x + art.width }, index: 5 },
327344 ]
328345 }
329346
tests/qmltests/Dash/tst_CardHeader.qml+13−8
@@ -52,11 +52,11 @@ Rectangle {
5252 property Item column: findChild(cardHeader, "column")
5353
5454 function initTestCase() {
55− verify(testCase.mascot !== undefined, "Couldn't find mascot object.");
56− verify(testCase.titleLabel !== undefined, "Couldn't find titleLabel object.");
57− verify(testCase.subtitleLabel !== undefined, "Couldn't find subtitleLabel object.");
58− verify(testCase.prices !== undefined, "Couldn't find prices object.");
59− verify(testCase.oldPriceLabel !== undefined, "Couldn't find oldPriceLabel object.");
55+ verify(typeof testCase.mascot === "object", "Couldn't find mascot object.");
56+ verify(typeof testCase.titleLabel === "object", "Couldn't find titleLabel object.");
57+ verify(typeof testCase.subtitleLabel === "object", "Couldn't find subtitleLabel object.");
58+ verify(typeof testCase.prices === "object", "Couldn't find prices object.");
59+ verify(typeof testCase.oldPriceLabel === "object", "Couldn't find oldPriceLabel object.");
6060 }
6161
6262 function cleanup() {
@@ -86,7 +86,7 @@ Rectangle {
8686 { tag: "Empty", visible: false },
8787 { tag: "Title only", title: "Foo", visible: true },
8888 { tag: "Subtitle only", subtitle: "Bar", visible: false },
89− { tag: "Both", title: "Foo", subtitle: "Bar", visible: true }
89+ { tag: "Both", title: "Foo", subtitle: "Bar", visible: true },
9090 ]
9191 }
9292
@@ -104,7 +104,7 @@ Rectangle {
104104 { tag: "Main and Alt", main: "$1.25", alt: "€1.00", visible: true },
105105 { tag: "Main and Old", main: "$1.25", old: "$2.00", visible: true, oldAlign: Text.AlignRight },
106106 { tag: "Alt and Old", alt: "€1.00", old: "$2.00", visible: false },
107− { tag: "All", main: "$1.25", alt: "€1.00", old: "$2.00", visible: true, oldAlign: Text.AlignHCenter }
107+ { tag: "All", main: "$1.25", alt: "€1.00", old: "$2.00", visible: true, oldAlign: Text.AlignHCenter },
108108 ]
109109 }
110110
@@ -121,7 +121,8 @@ Rectangle {
121121 function test_dimensions_data() {
122122 return [
123123 { tag: "Column width", object: column, width: cardHeader.width - testCase.outerRow.spacing * 2 },
124− { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" }
124+ { tag: "Column width", object: column, width: cardHeader.width - mascot.width - testCase.outerRow.spacing * 3, mascot: "artwork/avatar.png" },
125+ { tag: "Header height", object: cardHeader, height: function() { return subtitleLabel.y + subtitleLabel.height + outerRow.spacing * 2 } },
125126 ]
126127 }
127128
@@ -133,6 +134,10 @@ Rectangle {
133134 if (data.hasOwnProperty("width")) {
134135 tryCompare(data.object, "width", data.width);
135136 }
137+
138+ if (data.hasOwnProperty("height")) {
139+ tryCompareFunction(function() { return data.object.height === data.height() }, true);
140+ }
136141 }
137142 }
138143}
tests/qmltests/Dash/tst_GenericScopeView.qml+15
@@ -281,6 +281,21 @@ Item {
281281 tryCompare(category, "filtered", true);
282282 }
283283
284+ function test_getRendererCarouselGridFallback() {
285+ var rendererId = "carousel"
286+ var contentType = ""
287+ var rendererHint = ""
288+ var results = new Object()
289+
290+ results.count = 7
291+ var renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)
292+ compare(renderer, "Generic/GenericCarousel.qml")
293+
294+ results.count = 6
295+ renderer = genericScopeView.getRenderer(rendererId, contentType, rendererHint, results)
296+ compare(renderer, "Generic/GenericFilterGrid.qml")
297+ }
298+
284299 function test_showPreviewCarousel() {
285300 tryCompareFunction(function() { return findChild(genericScopeView, "carouselDelegate") != null; }, true);
286301 var tile = findChild(genericScopeView, "carouselDelegate");