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

Proposed by Albert Astals Cid on 2015-03-19
Status: Merged
Approved by: Michael Zanetti on 2015-04-01
Approved revision: 1693
Merged at revision: 1712
Proposed branch: lp:~aacid/unity8/urldispatcher_hideeverything
Merge into: lp:unity8
Diff against target: 195 lines (+89/-22)
6 files modified
qml/Dash/Dash.qml (+26/-13)
qml/Dash/DashContent.qml (+0/-5)
tests/mocks/Unity/fake_scope.cpp (+9/-0)
tests/mocks/Unity/fake_scope.h (+4/-2)
tests/qmltests/Dash/tst_Dash.qml (+49/-1)
tests/qmltests/Dash/tst_GenericScopeView.qml (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity8/urldispatcher_hideeverything
Reviewer Review Type Date Requested Status
Michael Zanetti (community) 2015-03-19 Approve on 2015-04-01
PS Jenkins bot continuous-integration Needs Fixing on 2015-03-27
Review via email: mp+253527@code.launchpad.net

Commit Message

Make url-dispatching scope activation when the dash is not on the main scopes

i.e. temp scope or preview or manage scopes

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?
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.
1691. By Albert Astals Cid on 2015-03-19

fix variable ^_^

Michael Zanetti (mzanetti) wrote :

tested, works. do we have a change to test this?

review: Needs Information
1692. By Albert Astals Cid on 2015-03-27

Test uri dispatcher does what it has to do

The uri dispatcher calls are not dbus activated but fake signals,
but here we're not testing the uri dispatcher itself that is on the SDK
just checking that when it's activated it does what it should

1693. By Albert Astals Cid on 2015-03-27

And forgot i need this too

Michael Zanetti (mzanetti) wrote :

lovely. thanks a lot!

 * 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.

no. looks unrelated. unity didn't seem to start within the expected time

 * 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 2015-02-17 08:26:20 +0000
3+++ qml/Dash/Dash.qml 2015-03-27 12:30:49 +0000
4@@ -28,29 +28,42 @@
5
6 visible: shown
7
8+ Connections {
9+ target: UriHandler
10+ onOpened: {
11+ backToDashContent()
12+ dashContent.currentScope.performQuery(uris[0])
13+ }
14+ }
15+
16 DashCommunicatorService {
17 objectName: "dashCommunicatorService"
18 onSetCurrentScopeRequested: {
19 if (!isSwipe || !window.active || bottomEdgeController.progress != 0 || scopeItem.scope || dashContent.subPageShown) {
20 if (bottomEdgeController.progress != 0 && window.active) animate = false;
21 dashContent.setCurrentScopeAtIndex(index, animate, isSwipe)
22- // Close dash overview and nested temp scopes in it
23- if (bottomEdgeController.progress != 0) {
24- bottomEdgeController.enableAnimation = window.active;
25- bottomEdgeController.progress = 0;
26- }
27- // Close normal temp scopes (e.g. App Store)
28- if (scopeItem.scope) {
29- scopeItem.backClicked();
30- }
31- // Close previews
32- if (dashContent.subPageShown) {
33- dashContent.closePreview();
34- }
35+ backToDashContent()
36 }
37 }
38 }
39
40+ function backToDashContent()
41+ {
42+ // Close dash overview and nested temp scopes in it
43+ if (bottomEdgeController.progress != 0) {
44+ bottomEdgeController.enableAnimation = window.active;
45+ bottomEdgeController.progress = 0;
46+ }
47+ // Close normal temp scopes (e.g. App Store)
48+ if (scopeItem.scope) {
49+ scopeItem.backClicked();
50+ }
51+ // Close previews
52+ if (dashContent.subPageShown) {
53+ dashContent.closePreview();
54+ }
55+ }
56+
57 function setCurrentScope(scopeId, animate, reset) {
58 var scopeIndex = -1;
59 for (var i = 0; i < scopes.count; ++i) {
60
61=== modified file 'qml/Dash/DashContent.qml'
62--- qml/Dash/DashContent.qml 2015-01-16 14:40:52 +0000
63+++ qml/Dash/DashContent.qml 2015-03-27 12:30:49 +0000
64@@ -63,11 +63,6 @@
65 }
66 }
67
68- Connections {
69- target: UriHandler
70- onOpened: dashContentList.currentItem.theScope.performQuery(uris[0])
71- }
72-
73 function setCurrentScopeAtIndex(index, animate, reset) {
74 // if the scopes haven't loaded yet, then wait until they are.
75 if (!scopes.loaded) {
76
77=== modified file 'tests/mocks/Unity/fake_scope.cpp'
78--- tests/mocks/Unity/fake_scope.cpp 2015-02-11 17:17:20 +0000
79+++ tests/mocks/Unity/fake_scope.cpp 2015-03-27 12:30:49 +0000
80@@ -310,3 +310,12 @@
81 Q_EMIT currentNavigationIdChanged();
82 }
83 }
84+
85+void Scope::performQuery(const QString& query)
86+{
87+ Q_EMIT queryPerformed(query);
88+ if (query.startsWith("scopes://")) {
89+ QString scopeId = query.mid(9);
90+ Q_EMIT gotoScope(scopeId);
91+ }
92+}
93
94=== modified file 'tests/mocks/Unity/fake_scope.h'
95--- tests/mocks/Unity/fake_scope.h 2014-09-26 19:47:09 +0000
96+++ tests/mocks/Unity/fake_scope.h 2015-03-27 12:30:49 +0000
97@@ -72,7 +72,7 @@
98 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& navigationId) override;
99 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getAltNavigation(QString const& altNavigationId) override;
100 Q_INVOKABLE void setNavigationState(const QString &navigationId, bool isAltNavigation) override;
101- Q_SIGNAL void performQuery(const QString& query) override;
102+ void performQuery(const QString& query) override;
103
104 Status status() const override;
105 QVariantMap customizations() const override;
106@@ -80,7 +80,9 @@
107 Q_INVOKABLE void refresh() override;
108
109 Q_SIGNALS:
110- void refreshed(); // This is not in the Interface, here for testing benefits
111+ // These are not in the Interface, here for testing benefits
112+ void refreshed();
113+ void queryPerformed(const QString& query);
114
115 protected:
116
117
118=== modified file 'tests/qmltests/Dash/tst_Dash.qml'
119--- tests/qmltests/Dash/tst_Dash.qml 2015-03-12 16:08:14 +0000
120+++ tests/qmltests/Dash/tst_Dash.qml 2015-03-27 12:30:49 +0000
121@@ -315,7 +315,7 @@
122
123 var scopesList = findChild(dash, "scopesList");
124 spy.target = scopesList.scope;
125- spy.signalName = "performQuery";
126+ spy.signalName = "queryPerformed";
127
128 // Click on the store
129 var scopesListPageHeader = findChild(scopesList, "pageHeader");
130@@ -517,5 +517,53 @@
131 tryCompare(dashTempScopeItem, "x", dash.width);
132 tryCompare(dashTempScopeItem, "visible", false);
133 }
134+
135+ function test_UriDispatcher()
136+ {
137+ var dashContentList = findChild(dash, "dashContentList");
138+
139+ UriHandler.opened("scopes://clickscope");
140+ tryCompare(dashContentList, "currentIndex", 1);
141+
142+ // Show the manage dash
143+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
144+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
145+ tryCompare(bottomEdgeController, "progress", 1);
146+
147+ // UriHandler changes to a scope and closes the manage scopes
148+ UriHandler.opened("scopes://MockScope1");
149+ tryCompare(dashContentList, "currentIndex", 0);
150+ tryCompare(bottomEdgeController, "progress", 0);
151+
152+ // Show a preview
153+ var scopeLoader0 = findChild(dashContent, "scopeLoader0");
154+ var dashCategory0 = findChild(scopeLoader0, "dashCategory0");
155+ var delegate0 = findChild(dashCategory0, "delegate0");
156+ mouseClick(delegate0);
157+ tryCompare(dashContent, "subPageShown", true)
158+
159+ // UriHandler changes to a scope and closes the manage scopes
160+ UriHandler.opened("scopes://clickscope");
161+ tryCompare(dashContentList, "currentIndex", 1);
162+ tryCompare(dashContent, "subPageShown", false);
163+
164+ // Go to a temp scope
165+ touchFlick(dash, dash.width / 2, dash.height - 1, dash.width / 2, units.gu(2));
166+ var bottomEdgeController = findInvisibleChild(dash, "bottomEdgeController");
167+ tryCompare(bottomEdgeController, "progress", 1);
168+ var nonfavScopesListCategory = findChild(dash, "scopesListCategoryother");
169+ var nonfavScopesListCategoryList = findChild(nonfavScopesListCategory, "scopesListCategoryInnerList");
170+ tryCompare(nonfavScopesListCategoryList, "currentIndex", 0);
171+ mouseClick(nonfavScopesListCategoryList.currentItem);
172+ var dashTempScopeItem = findChild(dash, "dashTempScopeItem");
173+ tryCompare(dashTempScopeItem, "x", 0);
174+ tryCompare(dashTempScopeItem, "visible", true);
175+
176+ // UriHandler changes to a scope and closes the temp scope
177+ UriHandler.opened("scopes://MockScope1");
178+ tryCompare(dashContentList, "currentIndex", 0);
179+ tryCompare(dashTempScopeItem, "x", dashTempScopeItem.width);
180+ tryCompare(dashTempScopeItem, "visible", false);
181+ }
182 }
183 }
184
185=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
186--- tests/qmltests/Dash/tst_GenericScopeView.qml 2015-02-11 08:34:50 +0000
187+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2015-03-27 12:30:49 +0000
188@@ -206,7 +206,7 @@
189 var header = findChild(genericScopeView, "dashSectionHeader1");
190
191 spy.target = genericScopeView.scope;
192- spy.signalName = "performQuery";
193+ spy.signalName = "queryPerformed";
194
195 mouseClick(header);
196

Subscribers

People subscribed via source and target branches