on xenial help sign in
Merge from trunk
commit4fb7d68fc8c49da298c7bb88470132522edf4ab7 authorMichael Terry <michael.terry@canonical.com> dateFri 2 Aug 2013, 10:00 (13 years ago) parented761d56554dea
7 files changed+121−23
debian/changelog+28 plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+26−8 plugins/ListViewWithPageHeader/listviewwithpageheader.h+1−1 tests/autopilot/unity8/shell/emulators/hud.py+4−7 tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp+51−2 tests/qmltests/Greeter/tst_Lockscreen.qml+1 tests/utils/modules/Unity/Test/UnityTestCase.qml+10−5
debian/changelog+28
@@ -1,3 +1,31 @@
1+unity8 (7.81.3+13.10.20130802-0ubuntu1) saucy; urgency=low
2+
3+ [ Michael Terry ]
4+ * Make hud autopilot tests more reliable by fixing how it calculates
5+ relative coordinates.
6+
7+ [ Albert Astals ]
8+ * Only update the "section" if we are not culling the item If the item
9+ is not shown we should not care about its section.
10+
11+ [ Ubuntu daily release ]
12+ * Automatic snapshot from revision 155
13+
14+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 02 Aug 2013 02:40:11 +0000
15+
16+unity8 (7.81.3+13.10.20130801.1-0ubuntu1) saucy; urgency=low
17+
18+ [ Michał Sawicz ]
19+ * Add a disclaimer for the fake applications plugin.
20+
21+ [ Nick Dedekind ]
22+ * Removed animations from fake indicator pages.
23+
24+ [ Ubuntu daily release ]
25+ * Automatic snapshot from revision 152
26+
27+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 01 Aug 2013 14:30:40 +0000
28+
129unity8 (7.81.3+13.10.20130801ubuntu.unity.next-0ubuntu1) saucy; urgency=low
230
331 [ Michael Zanetti ]
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+26−8
@@ -280,7 +280,7 @@ void ListViewWithPageHeader::setSectionDelegate(QQmlComponent *delegate)
280280
281281 m_sectionDelegate = delegate;
282282
283− m_topSectionItem = getSectionItem(QString());
283+ m_topSectionItem = getSectionItem(-1, QString());
284284 m_topSectionItem->setZ(3);
285285 QQuickItemPrivate::get(m_topSectionItem)->setCulled(true);
286286
@@ -599,16 +599,17 @@ QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, bool alreadyI
599599 }
600600 }
601601
602− return getSectionItem(section);
602+ return getSectionItem(modelIndex, section);
603603}
604604
605−QQuickItem *ListViewWithPageHeader::getSectionItem(const QString &sectionText)
605+QQuickItem *ListViewWithPageHeader::getSectionItem(int modelIndex, const QString &sectionText)
606606{
607607 QQuickItem *sectionItem = nullptr;
608608
609609 QQmlContext *creationContext = m_sectionDelegate->creationContext();
610610 QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this));
611611 context->setContextProperty(QLatin1String("section"), sectionText);
612+ context->setContextProperty(QLatin1String("delegateIndex"), modelIndex);
612613 QObject *nobj = m_sectionDelegate->beginCreate(context);
613614 if (nobj) {
614615 QQml_setParent_noEvent(context, nobj);
@@ -932,6 +933,14 @@ void ListViewWithPageHeader::onModelUpdated(const QQmlChangeSet &changeSet, bool
932933 adjustMinYExtent();
933934 }
934935
936+ for (int i = 0; i < m_visibleItems.count(); ++i) {
937+ ListItem *item = m_visibleItems[i];
938+ if (item->m_sectionItem) {
939+ QQmlContext *context = QQmlEngine::contextForObject(item->m_sectionItem)->parentContext();
940+ context->setContextProperty(QLatin1String("delegateIndex"), m_firstVisibleIndex + i);
941+ }
942+ }
943+
935944 layout();
936945 polish();
937946 m_contentHeightDirty = true;
@@ -1037,11 +1046,6 @@ void ListViewWithPageHeader::layout()
10371046 if (!cull && firstReallyVisibleItem == -1) {
10381047 firstReallyVisibleItem = modelIndex;
10391048 if (m_topSectionItem) {
1040− // Update the top sticky section header
1041− const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1042− QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1043− context->setContextProperty(QLatin1String("section"), section);
1044−
10451049 // Positing the top section sticky item is a two step process
10461050 // First we set it either we cull it (because it doesn't need to be sticked to the top)
10471051 // or stick it to the top
@@ -1058,8 +1062,22 @@ void ListViewWithPageHeader::layout()
10581062 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(false);
10591063 }
10601064 } else {
1065+ // Update the top sticky section header
1066+ const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty);
1067+ QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext();
1068+ context->setContextProperty(QLatin1String("section"), section);
1069+
10611070 QQuickItemPrivate::get(m_topSectionItem)->setCulled(false);
10621071 m_topSectionItem->setY(topSectionStickPos);
1072+ int delegateIndex = modelIndex;
1073+ // Look for the first index with this section text
1074+ while (delegateIndex > 0) {
1075+ const QString prevSection = m_delegateModel->stringValue(delegateIndex - 1, m_sectionProperty);
1076+ if (prevSection != section)
1077+ break;
1078+ delegateIndex--;
1079+ }
1080+ context->setContextProperty(QLatin1String("delegateIndex"), delegateIndex);
10631081 if (item->m_sectionItem) {
10641082 QQuickItemPrivate::get(item->m_sectionItem)->setCulled(true);
10651083 }
plugins/ListViewWithPageHeader/listviewwithpageheader.h+1−1
@@ -152,7 +152,7 @@ private:
152152 void reallyReleaseItem(ListItem *item);
153153 void updateWatchedRoles();
154154 QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted);
155− QQuickItem *getSectionItem(const QString &sectionText);
155+ QQuickItem *getSectionItem(int modelIndex, const QString &sectionText);
156156
157157#if (QT_VERSION < QT_VERSION_CHECK(5, 1, 0))
158158 QQuickVisualDataModel *m_delegateModel;
tests/autopilot/unity8/shell/emulators/hud.py+4−7
@@ -38,13 +38,10 @@ class Hud(UnityEmulatorBase):
3838 window = self.get_root_instance().select_single('QQuickView')
3939 hud_show_button = window.select_single("HudButton")
4040
41− start_x = int(window.x + (window.width / 2))
42− end_x = start_x
43− start_y = window.y + window.height
44− end_y = int(hud_show_button.y + (hud_show_button.height/2))
41+ swipe_coords = self.get_button_swipe_coords(window, hud_show_button)
4542
46− touch.press(start_x, start_y)
47− touch._finger_move(end_x, end_y)
43+ touch.press(swipe_coords.start_x, swipe_coords.start_y)
44+ touch._finger_move(swipe_coords.end_x, swipe_coords.end_y)
4845 try:
4946 hud_show_button.opacity.wait_for(1.0)
5047 touch.release()
@@ -78,6 +75,6 @@ class Hud(UnityEmulatorBase):
7875 start_x = int(main_view.x + (main_view.width / 2))
7976 end_x = start_x
8077 start_y = main_view.y + (main_view.height - 3)
81− end_y = int(hud_show_button.y + (hud_show_button.height/2))
78+ end_y = main_view.y + int(hud_show_button.y + (hud_show_button.height/2))
8279
8380 return SwipeCoords(start_x, end_x, start_y, end_y)
tests/plugins/ListViewWithPageHeader/listviewwithpageheadertestsection.cpp+51−2
@@ -45,6 +45,7 @@ private:
4545 QCOMPARE(section(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), sectionHeader);
4646 if (!sectionHeader.isNull()) {
4747 QCOMPARE(QQuickItemPrivate::get(lvwph->m_visibleItems[visibleIndex]->m_sectionItem)->culled, sectionHeaderCulled);
48+ QCOMPARE(sectionDelegateIndex(lvwph->m_visibleItems[visibleIndex]->m_sectionItem), lvwph->m_firstVisibleIndex + visibleIndex);
4849 }
4950 }
5051
@@ -116,6 +117,11 @@ private:
116117 return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("section")).toString() : QString();
117118 }
118119
120+ int sectionDelegateIndex(QQuickItem *item)
121+ {
122+ return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("delegateIndex")).toInt() : -1;
123+ }
124+
119125private Q_SLOTS:
120126
121127 void initTestCase()
@@ -220,6 +226,7 @@ private Q_SLOTS:
220226 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
221227 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
222228 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
229+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
223230 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
224231 }
225232
@@ -241,6 +248,7 @@ private Q_SLOTS:
241248 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
242249 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
243250 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
251+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
244252 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
245253 }
246254
@@ -262,6 +270,7 @@ private Q_SLOTS:
262270 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
263271 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
264272 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
273+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
265274 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
266275
267276 changeContentY(-30);
@@ -280,6 +289,7 @@ private Q_SLOTS:
280289 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
281290 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
282291 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
292+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
283293 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
284294 }
285295
@@ -335,6 +345,7 @@ private Q_SLOTS:
335345 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
336346 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
337347 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
348+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
338349 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
339350
340351 lvwph->positionAtBeginning();
@@ -360,6 +371,7 @@ private Q_SLOTS:
360371 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
361372 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
362373 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
374+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
363375 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
364376
365377 lvwph->positionAtBeginning();
@@ -404,6 +416,7 @@ private Q_SLOTS:
404416 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
405417 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
406418 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
419+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
407420 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
408421
409422 model->setProperty(0, "size", 400);
@@ -423,6 +436,7 @@ private Q_SLOTS:
423436 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
424437 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
425438 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
439+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
426440 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
427441
428442 scrollToTop();
@@ -476,6 +490,7 @@ private Q_SLOTS:
476490 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
477491 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
478492 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
493+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
479494 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
480495
481496 model->setProperty(0, "size", 400);
@@ -495,6 +510,7 @@ private Q_SLOTS:
495510 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
496511 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
497512 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
513+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
498514 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
499515
500516 scrollToTop();
@@ -531,6 +547,7 @@ private Q_SLOTS:
531547 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
532548 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
533549 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
550+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
534551 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
535552
536553 changeContentY(-30);
@@ -548,6 +565,7 @@ private Q_SLOTS:
548565 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
549566 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
550567 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
568+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
551569 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
552570
553571 changeContentY(30);
@@ -565,6 +583,7 @@ private Q_SLOTS:
565583 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
566584 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
567585 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
586+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
568587 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
569588
570589 changeContentY(-30);
@@ -582,6 +601,7 @@ private Q_SLOTS:
582601 QCOMPARE(lvwph->m_headerItemShownHeight, 30.);
583602 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
584603 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
604+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
585605 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
586606 }
587607
@@ -602,6 +622,7 @@ private Q_SLOTS:
602622 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
603623 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
604624 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
625+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
605626 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
606627
607628 lvwph->setDelegate(otherDelegate);
@@ -660,6 +681,7 @@ private Q_SLOTS:
660681 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
661682 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
662683 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
684+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
663685 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
664686
665687 scrollToTop();
@@ -698,6 +720,7 @@ private Q_SLOTS:
698720 QTRY_VERIFY(lvwph->isAtYEnd());
699721 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
700722 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
723+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
701724 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
702725
703726 scrollToTop();
@@ -734,6 +757,7 @@ private Q_SLOTS:
734757 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
735758 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
736759 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
760+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
737761 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
738762 }
739763
@@ -818,6 +842,7 @@ private Q_SLOTS:
818842 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
819843 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
820844 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
845+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
821846 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
822847
823848 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -838,6 +863,7 @@ private Q_SLOTS:
838863 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
839864 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
840865 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
866+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 4);
841867 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
842868
843869 scrollToTop();
@@ -878,6 +904,7 @@ private Q_SLOTS:
878904 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
879905 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
880906 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
907+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
881908 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
882909
883910 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 3), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -898,6 +925,7 @@ private Q_SLOTS:
898925 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
899926 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
900927 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
928+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
901929 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
902930 }
903931
@@ -920,6 +948,7 @@ private Q_SLOTS:
920948 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
921949 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
922950 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
951+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
923952 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
924953
925954 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -940,6 +969,7 @@ private Q_SLOTS:
940969 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
941970 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
942971 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
972+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 4);
943973 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
944974 }
945975
@@ -962,6 +992,7 @@ private Q_SLOTS:
962992 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
963993 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
964994 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
995+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
965996 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
966997
967998 QMetaObject::invokeMethod(model, "insertItem", Q_ARG(QVariant, 1), Q_ARG(QVariant, 100), Q_ARG(QVariant, "Agressive"));
@@ -982,6 +1013,7 @@ private Q_SLOTS:
9821013 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
9831014 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
9841015 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1016+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
9851017 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
9861018
9871019 scrollToTop();
@@ -1029,6 +1061,7 @@ private Q_SLOTS:
10291061 QVERIFY(!lvwph->isAtYEnd());
10301062 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
10311063 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1064+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
10321065 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
10331066
10341067 scrollToBottom();
@@ -1049,6 +1082,7 @@ private Q_SLOTS:
10491082 QVERIFY(lvwph->isAtYEnd());
10501083 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
10511084 QCOMPARE(section(lvwph->m_topSectionItem), QString("Lazy"));
1085+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 5);
10521086 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
10531087 }
10541088
@@ -1102,6 +1136,7 @@ private Q_SLOTS:
11021136 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
11031137 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
11041138 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1139+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 13);
11051140 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
11061141
11071142 changeContentY(-1700);
@@ -1126,6 +1161,7 @@ private Q_SLOTS:
11261161 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
11271162 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
11281163 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1164+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 4);
11291165 QCOMPARE(lvwph->m_topSectionItem->y(), -23.);
11301166 }
11311167
@@ -1187,6 +1223,7 @@ private Q_SLOTS:
11871223 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
11881224 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
11891225 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1226+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
11901227 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
11911228 }
11921229
@@ -1210,6 +1247,7 @@ private Q_SLOTS:
12101247 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
12111248 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
12121249 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1250+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
12131251 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
12141252 }
12151253
@@ -1232,6 +1270,7 @@ private Q_SLOTS:
12321270 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
12331271 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
12341272 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1273+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
12351274 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
12361275
12371276 QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 1), Q_ARG(QVariant, 1));
@@ -1251,6 +1290,7 @@ private Q_SLOTS:
12511290 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
12521291 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
12531292 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1293+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
12541294 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
12551295 }
12561296
@@ -1273,6 +1313,7 @@ private Q_SLOTS:
12731313 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
12741314 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
12751315 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1316+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
12761317 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
12771318
12781319 QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 3), Q_ARG(QVariant, 1));
@@ -1292,6 +1333,7 @@ private Q_SLOTS:
12921333 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
12931334 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
12941335 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1336+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
12951337 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
12961338 }
12971339
@@ -1371,6 +1413,7 @@ private Q_SLOTS:
13711413 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
13721414 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
13731415 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1416+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 3);
13741417 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
13751418
13761419 QMetaObject::invokeMethod(model, "moveItems", Q_ARG(QVariant, 0), Q_ARG(QVariant, 5), Q_ARG(QVariant, 1));
@@ -1391,6 +1434,7 @@ private Q_SLOTS:
13911434 QVERIFY(!lvwph->isAtYEnd());
13921435 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
13931436 QCOMPARE(section(lvwph->m_topSectionItem), QString("Bold"));
1437+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
13941438 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
13951439 }
13961440
@@ -1414,6 +1458,7 @@ private Q_SLOTS:
14141458 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
14151459 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
14161460 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1461+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
14171462 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
14181463
14191464 model->setProperty(1, "size", 100);
@@ -1434,6 +1479,7 @@ private Q_SLOTS:
14341479 QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
14351480 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
14361481 QCOMPARE(section(lvwph->m_topSectionItem), QString("Mild"));
1482+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 2);
14371483 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
14381484 }
14391485
@@ -1455,7 +1501,7 @@ private Q_SLOTS:
14551501 QCOMPARE(lvwph->m_headerItem->y(), 0.);
14561502 QCOMPARE(lvwph->m_headerItem->height(), 50.);
14571503 QCOMPARE(lvwph->contentY(), 20.);
1458− QCOMPARE(lvwph->m_headerItemShownHeight, 0.);;
1504+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
14591505 QVERIFY(QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
14601506
14611507 lvwph->showHeader();
@@ -1475,6 +1521,7 @@ private Q_SLOTS:
14751521 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
14761522 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
14771523 QCOMPARE(section(lvwph->m_topSectionItem), QString("Agressive"));
1524+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 0);
14781525 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
14791526
14801527 scrollToTop();
@@ -1510,9 +1557,10 @@ private Q_SLOTS:
15101557 QCOMPARE(lvwph->m_headerItem->y(), 0.);
15111558 QCOMPARE(lvwph->m_headerItem->height(), 50.);
15121559 QCOMPARE(lvwph->contentY(), 375.);
1513− QCOMPARE(lvwph->m_headerItemShownHeight, 0.);;
1560+ QCOMPARE(lvwph->m_headerItemShownHeight, 0.);
15141561 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
15151562 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1563+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
15161564 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
15171565
15181566 lvwph->showHeader();
@@ -1533,6 +1581,7 @@ private Q_SLOTS:
15331581 QCOMPARE(lvwph->m_headerItemShownHeight, 50.);
15341582 QVERIFY(!QQuickItemPrivate::get(lvwph->m_topSectionItem)->culled);
15351583 QCOMPARE(section(lvwph->m_topSectionItem), QString("Regular"));
1584+ QCOMPARE(sectionDelegateIndex(lvwph->m_topSectionItem), 1);
15361585 QCOMPARE(lvwph->m_topSectionItem->y(), 0.);
15371586
15381587 scrollToTop();
tests/qmltests/Greeter/tst_Lockscreen.qml+1
@@ -186,6 +186,7 @@ Rectangle {
186186 function test_unlock(data) {
187187 unlockedCheckBox.checked = false
188188 LightDM.Greeter.authenticate(data.username)
189+ waitForRendering(lockscreen)
189190
190191 var inputField = findChild(lockscreen, "pinentryField")
191192 if (data.alphanumeric) {
tests/utils/modules/Unity/Test/UnityTestCase.qml+10−5
@@ -72,11 +72,16 @@ TestCase {
7272 // Find an object with the given name recursively, starting
7373 // at the given object "obj"
7474 function findChild(obj,objectName) {
75− for (var i in obj.children) {
76− var child = obj.children[i];
77− if (child.objectName === objectName) return child;
78− var subChild = findChild(child,objectName);
79− if (subChild !== undefined) return subChild;
75+ var childs = new Array(0);
76+ childs.push(obj)
77+ while (childs.length > 0) {
78+ if (childs[0].objectName == objectName) {
79+ return childs[0]
80+ }
81+ for (var i in childs[0].data) {
82+ childs.push(childs[0].data[i])
83+ }
84+ childs.splice(0, 1);
8085 }
8186 return undefined;
8287 }