on xenial help sign in
Fix test_previewCycle
a04046cAlbert Astals
qml/Dash/PreviewListView.qml+1
@@ -32,6 +32,7 @@ Item {
32 property alias model: previewListView.model
32 property alias model: previewListView.model
33 property alias currentIndex: previewListView.currentIndex
33 property alias currentIndex: previewListView.currentIndex
34 property alias currentItem: previewListView.currentItem
34 property alias currentItem: previewListView.currentItem
35+ property alias count: previewListView.count
35
36
36 Image {
37 Image {
37 objectName: "pointerArrow"
38 objectName: "pointerArrow"
tests/qmltests/Dash/tst_GenericScopeView.qml+17−10
@@ -41,17 +41,10 @@ Item {
41 signal mainStageFocusedApplicationChanged()
41 signal mainStageFocusedApplicationChanged()
42 }
42 }
43
43
44− PreviewListView {
45− id: previewListView
46− anchors.fill: parent
47− openEffect: openEffect
48− categoryView: genericScopeView.categoryView
49− scope: genericScopeView.scope
50− }
51−
52 DashContentOpenEffect {
44 DashContentOpenEffect {
53 id: openEffect
45 id: openEffect
54 previewListView: previewListView
46 previewListView: previewListView
47+ sourceItem: genericScopeView
55 }
48 }
56
49
57 PageHeaderLabel {
50 PageHeaderLabel {
@@ -110,6 +103,7 @@ Item {
110 previewListView.open = true;
103 previewListView.open = true;
111 scopes.get(0).hideDash();
104 scopes.get(0).hideDash();
112 tryCompare(previewListView, "open", false);
105 tryCompare(previewListView, "open", false);
106+ tryCompare(openEffect, "gap", 0);
113 }
107 }
114
108
115 function openPreview() {
109 function openPreview() {
@@ -194,6 +188,7 @@ Item {
194
188
195 function test_previewCycle() {
189 function test_previewCycle() {
196 tryCompare(previewListView, "open", false);
190 tryCompare(previewListView, "open", false);
191+ tryCompare(openEffect, "gap", 0);
197
192
198 openPreview();
193 openPreview();
199
194
@@ -211,7 +206,7 @@ Item {
211 checkArrowPosition(0);
206 checkArrowPosition(0);
212
207
213 // flick to the next previews
208 // flick to the next previews
214−
209+ tryCompare(previewListView, "count", 15);
215 for (var i = 1; i < previewListView.count; ++i) {
210 for (var i = 1; i < previewListView.count; ++i) {
216
211
217 mouseFlick(previewListView, previewListView.width - units.gu(1),
212 mouseFlick(previewListView, previewListView.width - units.gu(1),
@@ -332,7 +327,7 @@ Item {
332 tryCompare(previewListView, "open", false);
327 tryCompare(previewListView, "open", false);
333 }
328 }
334
329
335− function test_filter_expand_expand() {
330+ function test_filter_expand_expand_collapse() {
336 // wait for the item to be there
331 // wait for the item to be there
337 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != undefined; }, true);
332 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != undefined; }, true);
338
333
@@ -368,11 +363,15 @@ Item {
368 tryCompare(category0, "filtered", false);
363 tryCompare(category0, "filtered", false);
369 tryCompare(category2, "filtered", true);
364 tryCompare(category2, "filtered", true);
370 tryCompare(category2FilterGrid, "filter", true);
365 tryCompare(category2FilterGrid, "filter", true);
366+ mouseClick(header0, header0.width / 2, header0.height / 2);
367+ tryCompare(category0, "filtered", true);
368+ tryCompare(category2, "filtered", true);
371 }
369 }
372
370
373 function test_narrow_delegate_ranges_expand() {
371 function test_narrow_delegate_ranges_expand() {
374 tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
372 tryCompareFunction(function() { return findChild(genericScopeView, "dashCategory0") != undefined; }, true);
375 var category = findChild(genericScopeView, "dashCategory0")
373 var category = findChild(genericScopeView, "dashCategory0")
374+ tryCompare(category, "filtered", true);
376
375
377 shell.width = units.gu(20)
376 shell.width = units.gu(20)
378 var categoryListView = findChild(genericScopeView, "categoryListView");
377 var categoryListView = findChild(genericScopeView, "categoryListView");
@@ -386,4 +385,12 @@ Item {
386 }
385 }
387 }
386 }
388 }
387 }
388+
389+ PreviewListView {
390+ id: previewListView
391+ anchors.fill: parent
392+ openEffect: openEffect
393+ categoryView: genericScopeView.categoryView
394+ scope: genericScopeView.scope
395+ }
389}
396}