Merge lp:~nick-dedekind/unity8/1534541.zombie-session into lp:unity8

Proposed by Nick Dedekind
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 2174
Merged at revision: 2193
Proposed branch: lp:~nick-dedekind/unity8/1534541.zombie-session
Merge into: lp:unity8
Diff against target: 203 lines (+53/-29)
5 files modified
qml/Stages/SessionContainer.qml (+2/-0)
tests/mocks/Unity/Application/ApplicationTestInterface.cpp (+4/-4)
tests/mocks/Unity/Application/ApplicationTestInterface.h (+2/-2)
tests/qmltests/Stages/RecursingChildSessionControl.qml (+3/-3)
tests/qmltests/Stages/tst_SessionContainer.qml (+42/-20)
To merge this branch: bzr merge lp:~nick-dedekind/unity8/1534541.zombie-session
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
Marcus Tomlinson (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+284905@code.launchpad.net

Commit message

Remove zombie if they're not animated.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
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.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2174
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/264/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/264/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2174
http://jenkins.qa.ubuntu.com/job/unity8-ci/7206/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6310
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/621/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1911
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/614
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1806
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1806
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/613
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/612
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4850
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6321
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6321/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27271
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/330/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/619
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/619/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27269

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7206/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

I've built this branch here: https://launchpad.net/~unity-api-team/+archive/ubuntu/dev-build-1

Tested on the phone and it works like a charm!!

I can confirm that this change fixes Bug #1534541 (together with its associated duplicates).

Nice work Nick!

review: Approve
Revision history for this message
Albert Astals Cid (aacid) wrote :

Code looks sane, test passes and fails without the new code.

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

 * Did CI run pass?
To what it can pass.

 * 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/Stages/SessionContainer.qml'
2--- qml/Stages/SessionContainer.qml 2015-12-01 12:17:24 +0000
3+++ qml/Stages/SessionContainer.qml 2016-02-03 14:09:31 +0000
4@@ -152,6 +152,8 @@
5 popped.completed.connect(function() { root.session.release(); } );
6 popped.end();
7 d.animations = tmp;
8+ } else {
9+ root.session.release();
10 }
11 }
12
13
14=== modified file 'tests/mocks/Unity/Application/ApplicationTestInterface.cpp'
15--- tests/mocks/Unity/Application/ApplicationTestInterface.cpp 2015-11-05 17:59:16 +0000
16+++ tests/mocks/Unity/Application/ApplicationTestInterface.cpp 2016-02-03 14:09:31 +0000
17@@ -36,7 +36,7 @@
18 connection.registerObject("/com/canonical/Unity8/Mocks", parent);
19 }
20
21-Session* ApplicationTestInterface::addChildSession(Session* existingSession, const QString& surfaceImage)
22+Session* ApplicationTestInterface::addChildSession(Session* existingSession, const QString& surfaceImage, bool addSurface)
23 {
24 if (!existingSession) return nullptr;
25
26@@ -49,7 +49,7 @@
27 .arg(existingSession->childSessions()->count()),
28 screenshotUrl);
29 existingSession->addChildSession(session);
30- session->createSurface();
31+ if (addSurface) session->createSurface();
32
33 return session;
34 }
35@@ -70,7 +70,7 @@
36 existingSurface->setLive(false);
37 }
38
39-quint32 ApplicationTestInterface::addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage)
40+quint32 ApplicationTestInterface::addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage, bool addSurface)
41 {
42 qDebug() << "ApplicationTestInterface::addChildSession to " << appId;
43
44@@ -100,7 +100,7 @@
45 .arg(parentSession->childSessions()->count()),
46 screenshotUrl);
47 parentSession->addChildSession(session);
48- session->createSurface();
49+ if (addSurface) { session->createSurface(); }
50 m_childSessions[sessionId] = session;
51
52 return sessionId;
53
54=== modified file 'tests/mocks/Unity/Application/ApplicationTestInterface.h'
55--- tests/mocks/Unity/Application/ApplicationTestInterface.h 2015-08-03 15:00:47 +0000
56+++ tests/mocks/Unity/Application/ApplicationTestInterface.h 2016-02-03 14:09:31 +0000
57@@ -30,12 +30,12 @@
58 public:
59 ApplicationTestInterface(QObject* parent = 0);
60
61- Q_INVOKABLE Session* addChildSession(Session* existingSession, const QString& surfaceImage);
62+ Q_INVOKABLE Session* addChildSession(Session* existingSession, const QString& surfaceImage, bool addSurface);
63 Q_INVOKABLE void removeSession(Session* existingSession);
64 Q_INVOKABLE void removeSurface(MirSurface* existingSurface);
65
66 public Q_SLOTS:
67- quint32 addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage);
68+ quint32 addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage, bool addSurface);
69 void removeSession(quint32 sessionId);
70
71 private:
72
73=== modified file 'tests/qmltests/Stages/RecursingChildSessionControl.qml'
74--- tests/qmltests/Stages/RecursingChildSessionControl.qml 2015-12-01 12:17:24 +0000
75+++ tests/qmltests/Stages/RecursingChildSessionControl.qml 2016-02-03 14:09:31 +0000
76@@ -88,7 +88,7 @@
77
78 CheckBox {
79 id: _surfaceCheckbox;
80- checked: false;
81+ checked: root.session.lastSurface ? true : false
82 activeFocusOnPress: false
83 enabled: root.session
84 onCheckedChanged: {
85@@ -101,7 +101,7 @@
86
87 Connections {
88 target: root.session ? root.session : null
89- onSurfaceChanged: {
90+ onLastSurfaceChanged: {
91 surfaceCheckbox.checked = root.session.lastSurface !== null
92 }
93 }
94@@ -137,7 +137,7 @@
95 text: "Add Child"
96 onClicked: {
97 var screenshot = Math.round(Math.random()*100 % (screenshotIds.length-1));
98- var session = ApplicationTest.addChildSession(root.session, root.screenshotIds[screenshot]);
99+ var session = ApplicationTest.addChildSession(root.session, root.screenshotIds[screenshot], true);
100 }
101 }
102 }
103
104=== modified file 'tests/qmltests/Stages/tst_SessionContainer.qml'
105--- tests/qmltests/Stages/tst_SessionContainer.qml 2015-12-01 12:17:24 +0000
106+++ tests/qmltests/Stages/tst_SessionContainer.qml 2016-02-03 14:09:31 +0000
107@@ -155,7 +155,8 @@
108 var sessions = [];
109 for (i = 0; i < data.count; i++) {
110 var session = ApplicationTest.addChildSession(sessionContainer.session,
111- "gallery");
112+ "gallery",
113+ true);
114 session.createSurface();
115 sessionContainer.session.addChildSession(session);
116 compare(sessionContainer.childSessions.count(), i+1);
117@@ -180,7 +181,7 @@
118 // 3 sessions should cover all edge cases
119 for(i = 0; i < 3; i++) {
120 var a_session = ApplicationTest.addChildSession(
121- sessionContainer.session, "gallery"
122+ sessionContainer.session, "gallery", true
123 )
124
125 a_session.createSurface();
126@@ -226,7 +227,8 @@
127 var container = sessionContainer;
128 for (i = 0; i < data.depth; i++) {
129 var session = ApplicationTest.addChildSession(lastSession,
130- "gallery");
131+ "gallery",
132+ true);
133 session.createSurface();
134 lastSession.addChildSession(session);
135 compare(container.childSessions.count(), 1);
136@@ -250,7 +252,8 @@
137 var sessionContainer = sessionContainerLoader.item;
138
139 var session = ApplicationTest.addChildSession(sessionContainer.session,
140- "gallery");
141+ "gallery",
142+ true);
143 session.createSurface();
144 sessionContainer.session.addChildSession(session);
145
146@@ -288,22 +291,41 @@
147 var sessionContainer = sessionContainerLoader.item;
148
149 var session = ApplicationTest.addChildSession(sessionContainer.session,
150- "gallery");
151-
152- var delegate = findChild(sessionContainer, "childDelegate0");
153- var childContainer = findChild(delegate, "sessionContainer");
154-
155- // wait for animation to begin
156- tryCompareFunction(function() { return isContainerAnimating(childContainer); }, true);
157- // wait for animation to end
158- tryCompareFunction(function() { return isContainerAnimating(childContainer); }, false);
159-
160- ApplicationTest.removeSession(session);
161-
162- // wait for animation to begin
163- tryCompareFunction(function() { return isContainerAnimating(childContainer); }, true);
164- // wait for animation to end
165- tryCompareFunction(function() { return isContainerAnimating(childContainer); }, false);
166+ "gallery",
167+ true);
168+
169+ var delegate = findChild(sessionContainer, "childDelegate0");
170+ var childContainer = findChild(delegate, "sessionContainer");
171+
172+ // wait for animation to begin
173+ tryCompareFunction(function() { return isContainerAnimating(childContainer); }, true);
174+ // wait for animation to end
175+ tryCompareFunction(function() { return isContainerAnimating(childContainer); }, false);
176+
177+ ApplicationTest.removeSession(session);
178+
179+ // wait for animation to begin
180+ tryCompareFunction(function() { return isContainerAnimating(childContainer); }, true);
181+ // wait for animation to end
182+ tryCompareFunction(function() { return isContainerAnimating(childContainer); }, false);
183+
184+ tryCompareFunction(function() { return sessionContainer.childSessions.count() }, 0);
185+ }
186+
187+ function test_childSessionsRemovedOnStopWhenNotLive() {
188+ sessionCheckbox.checked = true;
189+ var sessionContainer = sessionContainerLoader.item;
190+
191+ var session = ApplicationTest.addChildSession(sessionContainer.session,
192+ "gallery",
193+ false);
194+
195+ var delegate = findChild(sessionContainer, "childDelegate0");
196+ var childContainer = findChild(delegate, "sessionContainer");
197+
198+ ApplicationTest.removeSession(session);
199+
200+ tryCompareFunction(function() { return sessionContainer.childSessions.count() }, 0);
201 }
202 }
203 }

Subscribers

People subscribed via source and target branches