Merge lp:~unity-team/qtmir/1541388.close-resumable into lp:qtmir

Proposed by Michał Sawicz
Status: Rejected
Rejected by: Gerry Boland
Proposed branch: lp:~unity-team/qtmir/1541388.close-resumable
Merge into: lp:qtmir
Prerequisite: lp:~dandrader/qtmir/removeUselessClass
Diff against target: 56 lines (+38/-0)
2 files modified
src/modules/Unity/Application/application.cpp (+3/-0)
tests/modules/ApplicationManager/application_manager_test.cpp (+35/-0)
To merge this branch: bzr merge lp:~unity-team/qtmir/1541388.close-resumable
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity8 CI Bot (community) continuous-integration Needs Fixing
Michael Zanetti Pending
Review via email: mp+284968@code.launchpad.net

This proposal supersedes a proposal from 2016-02-03.

Commit message

Added fix and test for closing app during the StoppedResumable state.

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

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

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

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

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

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

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote : Posted in a previous version of this proposal

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

waiting. But tests are passing here.

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

yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

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

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

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

This fix landed in rev 439 already.

Unmerged revisions

444. By Michał Sawicz

Adapt to new TaskController

443. By Michał Sawicz

Merge lp:~dandrader/qtmir/removeUselessClass

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/application.cpp'
2--- src/modules/Unity/Application/application.cpp 2016-02-03 20:25:27 +0000
3+++ src/modules/Unity/Application/application.cpp 2016-02-03 20:25:27 +0000
4@@ -428,6 +428,9 @@
5 // already on the way
6 break;
7 case InternalState::StoppedResumable:
8+ // session stopped while suspended. Stop it for good now.
9+ setInternalState(InternalState::Stopped);
10+ break;
11 case InternalState::Stopped:
12 // too late
13 break;
14
15=== modified file 'tests/modules/ApplicationManager/application_manager_test.cpp'
16--- tests/modules/ApplicationManager/application_manager_test.cpp 2016-02-03 20:25:27 +0000
17+++ tests/modules/ApplicationManager/application_manager_test.cpp 2016-02-03 20:25:27 +0000
18@@ -2266,3 +2266,38 @@
19 EXPECT_EQ(Application::Stopped, application->state());
20 EXPECT_EQ(spy.count(), 1);
21 }
22+
23+/*
24+ * Test that an application that fails while suspended will stop on close request
25+ */
26+TEST_F(ApplicationManagerTests,CloseWhenSuspendedProcessFailed)
27+{
28+ using namespace ::testing;
29+
30+ const QString appId("testAppId");
31+ quint64 procId = 5551;
32+
33+ auto application = startApplication(procId, "testAppId");
34+
35+ qtmir::Session* session(static_cast<qtmir::Session*>(application->session()));
36+
37+ FakeMirSurface *surface = new FakeMirSurface;
38+ onSessionCreatedSurface(session->session().get(), surface);
39+ surface->drawFirstFrame();
40+ EXPECT_EQ(Application::InternalState::Running, application->internalState());
41+
42+ // Session is suspended
43+ suspend(application);
44+
45+ // Process failed
46+ onSessionStopping(session->session());
47+ applicationManager.onProcessFailed(appId, TaskController::Error::APPLICATION_CRASHED);
48+ applicationManager.onProcessStopped(appId);
49+ EXPECT_EQ(Application::InternalState::StoppedResumable, application->internalState());
50+
51+ QSignalSpy spy(application, SIGNAL(stopped()));
52+ application->close();
53+
54+ EXPECT_EQ(Application::Stopped, application->state());
55+ EXPECT_EQ(spy.count(), 1);
56+}

Subscribers

People subscribed via source and target branches