Merge lp:~aacid/unity8/testFor1316660 into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 1597
Merged at revision: 1616
Proposed branch: lp:~aacid/unity8/testFor1316660
Merge into: lp:unity8
Diff against target: 94 lines (+43/-1)
4 files modified
qml/Dash/Previews/Preview.qml (+1/-0)
tests/mocks/Unity/fake_previewwidgetmodel.cpp (+10/-0)
tests/qmltests/Dash/Previews/tst_Preview.qml (+31/-0)
tests/qmltests/Dash/tst_GenericScopeView.qml (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity8/testFor1316660
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+249210@code.launchpad.net

Commit message

Test for bug #1316660

preview combo should autoscroll to make sure its child buttons are on screen

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
No, it's test only

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~aacid/unity8/testFor1316660 updated
1597. By Albert Astals Cid

Verify to tryCompare

Doesn't really belong to this MR but i had it failing in CI so let's make it more resilient here

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
 * Did CI run pass? If not, please explain why.
It did!
 * Did you make sure that the branch does not contain spurious tags?
yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Dash/Previews/Preview.qml'
--- qml/Dash/Previews/Preview.qml 2014-10-23 11:59:22 +0000
+++ qml/Dash/Previews/Preview.qml 2015-02-11 08:35:33 +0000
@@ -65,6 +65,7 @@
6565
66 delegate: ListView {66 delegate: ListView {
67 id: column67 id: column
68 objectName: "previewListRow" + index
68 anchors { top: parent.top; bottom: parent.bottom }69 anchors { top: parent.top; bottom: parent.bottom }
69 width: row.columnWidth70 width: row.columnWidth
70 spacing: row.spacing71 spacing: row.spacing
7172
=== modified file 'tests/mocks/Unity/fake_previewwidgetmodel.cpp'
--- tests/mocks/Unity/fake_previewwidgetmodel.cpp 2014-05-14 08:36:42 +0000
+++ tests/mocks/Unity/fake_previewwidgetmodel.cpp 2015-02-11 08:35:33 +0000
@@ -53,6 +53,16 @@
53 PreviewData* preview_data = new PreviewData(QString("widget-%1").arg(i), QString("text"), attributes);53 PreviewData* preview_data = new PreviewData(QString("widget-%1").arg(i), QString("text"), attributes);
54 m_previewWidgets.append(QSharedPointer<PreviewData>(preview_data));54 m_previewWidgets.append(QSharedPointer<PreviewData>(preview_data));
55 }55 }
56
57 QVariantMap attributes;
58 QVariantMap buttonData;
59 buttonData["label"] = "Button";
60 QVariantList buttons;
61 buttons << buttonData << buttonData << buttonData;
62 attributes["actions"] = QVariant::fromValue(buttons);
63 PreviewData* preview_data = new PreviewData(QString("widget-21"), QString("actions"), attributes);
64 m_previewWidgets.append(QSharedPointer<PreviewData>(preview_data));
65
56 endResetModel();66 endResetModel();
5767
58}68}
5969
=== modified file 'tests/qmltests/Dash/Previews/tst_Preview.qml'
--- tests/qmltests/Dash/Previews/tst_Preview.qml 2014-07-04 16:20:48 +0000
+++ tests/qmltests/Dash/Previews/tst_Preview.qml 2015-02-11 08:35:33 +0000
@@ -54,6 +54,11 @@
54 name: "Preview"54 name: "Preview"
55 when: windowShown55 when: windowShown
5656
57 function init() {
58 var widget = findChild(preview, "previewListRow0");
59 widget.positionViewAtBeginning();
60 }
61
57 function test_triggered() {62 function test_triggered() {
58 waitForRendering(preview);63 waitForRendering(preview);
59 var widget = findChild(preview, "widget-3");64 var widget = findChild(preview, "widget-3");
@@ -102,5 +107,31 @@
102 return bottomLeft.y <= preview.height107 return bottomLeft.y <= preview.height
103 }, true);108 }, true);
104 }109 }
110
111 function test_comboEnsureVisible() {
112 waitForRendering(preview);
113
114 // Scroll down
115 var previewListRow0 = findChild(preview, "previewListRow0");
116 touchFlick(preview, preview.width / 2, units.gu(20), preview.width / 2, units.gu(1));
117 tryCompare(previewListRow0, "atYEnd", true);
118 tryCompare(previewListRow0, "moving", false);
119
120 // Click on the combo
121 var widget = findChild(preview, "widget-21");
122 var initialWidgetHeight = widget.height;
123 var moreLessButton = findChild(widget, "moreLessButton");
124 mouseClick(moreLessButton);
125
126 // Make sure the combo is growing
127 tryCompareFunction(function () { return widget.height > 2 * initialWidgetHeight; }, true);
128
129 // Wait for the combo to stop growing
130 tryCompareFunction(function () { var currentWidgetHeight = widget.height; wait(200); return currentWidgetHeight === widget.height;}, true);
131
132 // Make sure the combo bottom is on the viewport
133 var bottomLeft = preview.mapFromItem(widget, 0, widget.height);
134 verify(bottomLeft.y <= preview.height);
135 }
105 }136 }
106}137}
107138
=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
--- tests/qmltests/Dash/tst_GenericScopeView.qml 2015-01-09 09:15:45 +0000
+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2015-02-11 08:35:33 +0000
@@ -380,8 +380,8 @@
380380
381 tryCompare(testCase.subPageLoader, "open", false);381 tryCompare(testCase.subPageLoader, "open", false);
382382
383 tryCompareFunction(function() { return findChild(category, "delegate1") != null; }, true);
383 var tile = findChild(category, "delegate1");384 var tile = findChild(category, "delegate1");
384 verify(tile, "Could not find delegate");
385385
386 mouseClick(tile);386 mouseClick(tile);
387 tryCompare(testCase.subPageLoader, "open", true);387 tryCompare(testCase.subPageLoader, "open", true);

Subscribers

People subscribed via source and target branches