~mir-team/mir/rename-everything

« back to all changes in this revision

Viewing changes to tests/acceptance-tests/test_prompt_session_client_api.cpp

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2015-01-28 20:21:34 UTC
  • mfrom: (2257.1.31 mir3)
  • Revision ID: tarmac-20150128202134-dn97lf8gwk0xcqbc
shell, frontend: Provide a mir::shell::Shell customization point.

Approved by PS Jenkins bot, Kevin DuBois, Alexandros Frantzis.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include "mir/scene/prompt_session.h"
22
22
#include "mir/scene/prompt_session_manager.h"
23
23
#include "mir/scene/session.h"
24
 
#include "mir/shell/session_coordinator_wrapper.h"
 
24
#include "mir/shell/shell_wrapper.h"
25
25
#include "mir/frontend/session_credentials.h"
26
 
#include "mir/frontend/shell.h"
27
26
#include "mir/cached_ptr.h"
28
27
#include "mir/fd.h"
29
28
 
63
62
};
64
63
 
65
64
// We need to fake any client_pids used to identify sessions
66
 
class PidFakingSessionCoordinator : public msh::SessionCoordinatorWrapper
 
65
class PidFakingShell : public msh::ShellWrapper
67
66
{
68
67
public:
69
 
    PidFakingSessionCoordinator(
70
 
        std::shared_ptr<ms::SessionCoordinator> const& wrapped,
 
68
    PidFakingShell(
 
69
        std::shared_ptr<msh::Shell> const& wrapped,
71
70
        std::vector<pid_t> const& pids) :
72
 
            msh::SessionCoordinatorWrapper(wrapped),
 
71
            msh::ShellWrapper(wrapped),
73
72
        pids(pids)
74
73
    {
75
74
    }
150
149
 
151
150
    void SetUp() override
152
151
    {
153
 
        auto session_coordinator_wrapper = [&](std::shared_ptr<ms::SessionCoordinator> const& wrapped)
154
 
            -> std::shared_ptr<ms::SessionCoordinator>
 
152
        auto shell_wrapper = [&](std::shared_ptr<msh::Shell> const& wrapped)
 
153
            -> std::shared_ptr<msh::Shell>
155
154
            {
156
155
                std::vector<pid_t> fake_pids;
157
156
                fake_pids.push_back(application_session_pid);
158
157
 
159
 
                return std::make_shared<PidFakingSessionCoordinator>(wrapped, fake_pids);
 
158
                return std::make_shared<PidFakingShell>(wrapped, fake_pids);
160
159
            };
161
160
 
162
161
        server.override_the_session_authorizer([this]()
170
169
                 return the_mock_prompt_session_listener();
171
170
            });
172
171
 
173
 
        server.wrap_session_coordinator(session_coordinator_wrapper);
 
172
        server.wrap_shell(shell_wrapper);
174
173
 
175
174
        mtf::HeadlessInProcessServer::SetUp();
176
175