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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1506
Merged at revision: 1510
Proposed branch: lp:~aacid/unity8/bottom_list_drag
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/apps-special-after-all
Diff against target: 135 lines (+87/-14)
2 files modified
qml/Dash/Dash.qml (+1/-0)
tests/qmltests/Dash/tst_Dash.qml (+86/-14)
To merge this branch: bzr merge lp:~aacid/unity8/bottom_list_drag
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+244563@code.launchpad.net

Commit message

Fix clicking on the manage dash list after having moved the current scope

Comes with a test for that and for a other manage dash scope move situation
And removes unused code from the test

Description of the change

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

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * 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.
lp:~aacid/unity8/bottom_list_drag updated
1504. By Albert Astals Cid

comment++

1505. By Albert Astals Cid

fix comment

1506. By Albert Astals Cid

settle animation before clicking

Revision history for this message
Michael Zanetti (mzanetti) 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.

not yet. but tests pass for me here

 * 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
1=== modified file 'qml/Dash/Dash.qml'
2--- qml/Dash/Dash.qml 2014-12-11 13:25:10 +0000
3+++ qml/Dash/Dash.qml 2014-12-12 12:14:51 +0000
4@@ -75,6 +75,7 @@
5 return
6 }
7
8+ dashContent.workaroundRestoreIndex = -1;
9 dashContent.setCurrentScopeAtIndex(scopeIndex, animate, reset)
10 }
11
12
13=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
14--- tests/qmltests/Dash/tst_Dash.qml 2014-12-12 12:14:51 +0000
15+++ tests/qmltests/Dash/tst_Dash.qml 2014-12-12 12:14:51 +0000
16@@ -70,19 +70,6 @@
17 waitForRendering(findChild(dash, "scopeLoader0").item);
18 }
19
20- function get_scope_data() {
21- return [
22- { tag: "MockScope1", visualIndex: 0 },
23- { tag: "MockScope2", visualIndex: -1 },
24- { tag: "clickscope", visualIndex: 1 },
25- { tag: "MockScope5", visualIndex: 2 },
26- ]
27- }
28-
29- function test_show_scope_on_load_data() {
30- return get_scope_data()
31- }
32-
33 function test_manage_dash_clickscope_unfavoritable() {
34 // Show the manage dash
35 touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
36@@ -330,7 +317,7 @@
37 spy.target = scopesList.scope;
38 spy.signalName = "performQuery";
39
40- // Do a search
41+ // Click on the store
42 var scopesListPageHeader = findChild(scopesList, "pageHeader");
43 var searchButton = findChild(scopesListPageHeader, "store_header_button");
44 mouseClick(searchButton, 0, 0);
45@@ -339,5 +326,90 @@
46 compare(spy.signalArguments[0][0], "scope://com.canonical.scopes.clickstore");
47 tryCompare(bottomEdgeController, "progress", 0);
48 }
49+
50+ function test_manage_dash_move_current() {
51+ var dashContentList = findChild(dash, "dashContentList");
52+ compare(dashContentList.currentIndex, 0);
53+ compare(dashContentList.currentItem.scopeId, "MockScope1");
54+
55+ // Show the manage dash
56+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
57+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
58+ tryCompare(bottomEdgeController, "progress", 1);
59+
60+ // Make sure stuff is loaded
61+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
62+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
63+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
64+
65+ // Enter edit mode
66+ var scopesList = findChild(dash, "scopesList");
67+ var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
68+ mousePress(clickScope, 0, 0);
69+ tryCompare(scopesList, "state", "edit");
70+ mouseRelease(clickScope, 0, 0);
71+
72+ var starArea = findChild(clickScope, "starArea");
73+ touchFlick(starArea, 0, 0, 0, -units.gu(10));
74+
75+ // Exit edit mode and go back
76+ var scopesList = findChild(dash, "scopesList");
77+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
78+ var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "backButton");
79+ mouseClick(backButton, 0, 0);
80+ mouseClick(backButton, 0, 0);
81+ tryCompare(bottomEdgeController, "progress", 0);
82+
83+ tryCompare(dashContentList, "currentIndex", 0);
84+ compare(dashContentList.currentItem.scopeId, "clickscope");
85+
86+ // Move to second scope
87+ touchFlick(dash, dash.width / 2, units.gu(2), dash.width / 5, units.gu(2));
88+ tryCompare(dashContentList, "currentIndex", 1);
89+ compare(dashContentList.currentItem.scopeId, "MockScope1");
90+ }
91+
92+ function test_manage_dash_move_current_click_other() {
93+ var dashContentList = findChild(dash, "dashContentList");
94+ compare(dashContentList.currentIndex, 0);
95+ compare(dashContentList.currentItem.scopeId, "MockScope1");
96+
97+ // Show the manage dash
98+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
99+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
100+ tryCompare(bottomEdgeController, "progress", 1);
101+
102+ // Make sure stuff is loaded
103+ var favScopesListCategory = findChild(dash, "scopesListCategoryfavorites");
104+ var favScopesListCategoryList = findChild(favScopesListCategory, "scopesListCategoryInnerList");
105+ tryCompare(favScopesListCategoryList, "currentIndex", 0);
106+
107+ // Enter edit mode
108+ var scopesList = findChild(dash, "scopesList");
109+ var clickScope = findChild(favScopesListCategoryList, "delegateclickscope");
110+ mousePress(clickScope, 0, 0);
111+ tryCompare(scopesList, "state", "edit");
112+ mouseRelease(clickScope, 0, 0);
113+
114+ var starArea = findChild(clickScope, "starArea");
115+ touchFlick(starArea, 0, 0, 0, -units.gu(10));
116+
117+ // wait for the animation to settle
118+ tryCompare(clickScope, "height", units.gu(6));
119+
120+ // Exit edit mode
121+ var scopesList = findChild(dash, "scopesList");
122+ var scopesListPageHeader = findChild(scopesList, "pageHeader");
123+ var backButton = findChild(findChild(scopesListPageHeader, "innerPageHeader"), "backButton");
124+ mouseClick(backButton, 0, 0);
125+
126+ // Click on third scope
127+ var mockScope5 = findChild(favScopesListCategoryList, "delegateMockScope5");
128+ waitForRendering(mockScope5)
129+ mouseClick(mockScope5, 0, 0);
130+ tryCompare(bottomEdgeController, "progress", 0);
131+ tryCompare(dashContentList, "currentIndex", 2);
132+ compare(dashContentList.currentItem.scopeId, "MockScope5");
133+ }
134 }
135 }

Subscribers

People subscribed via source and target branches