~mir-team/miral/release

« back to all changes in this revision

Viewing changes to test/test_server.cpp

  • Committer: Bileto Bot
  • Date: 2017-06-21 08:34:34 UTC
  • mfrom: (360.1.1 miral-release)
  • Revision ID: ci-train-bot@canonical.com-20170621083434-e7ftkyg5qr2fzsao
* New upstream release 1.4.0 (https://launchpad.net/miral/+milestone/1.4.0)
  - ABI summary:
    . miral ABI unchanged at 2
  - Enhancements:
    . Support for passing messages to enable Drag & Drop
    . Support for client requested move
    . Port to the undeprecated Mir APIs
    . Added "--cursor-theme" option when configuring a cursor theme
    . Drop support for Mir versions before 0.26
  - Bugs fixed:

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <mir/server.h>
30
30
#include <mir/version.h>
31
31
 
32
 
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
33
32
#include <mir_test_framework/headless_display_buffer_compositor_factory.h>
34
 
#endif
35
33
 
36
34
#include <boost/throw_exception.hpp>
37
35
 
52
50
    CanonicalWindowManagerPolicy{tools}
53
51
{
54
52
    test_fixture.tools = tools;
55
 
    test_fixture.policy = this;
56
53
}
57
54
 
58
55
miral::TestServer::TestServer() :
71
68
 
72
69
void miral::TestServer::SetUp()
73
70
{
74
 
#if MIR_SERVER_VERSION < MIR_VERSION_NUMBER(0, 25, 0)
75
 
    mtf::set_next_preset_display({}); // Workaround for lp:1611337
76
 
#endif
77
 
 
78
71
    mir::test::AutoJoinThread t([this]
79
72
         {
80
73
            auto init = [this](mir::Server& server)
93
86
                                });
94
87
                        });
95
88
 
96
 
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 25, 0)
97
89
                    server.override_the_display_buffer_compositor_factory([]
98
90
                        {
99
91
                            return std::make_shared<mtf::HeadlessDisplayBufferCompositorFactory>();
100
92
                        });
101
 
#endif
102
93
 
103
94
                    server.override_the_window_manager_builder([this, &server](msh::FocusController* focus_controller)
104
95
                        -> std::shared_ptr<msh::WindowManager>
105
96
                        {
106
97
                            auto const display_layout = server.the_shell_display_layout();
107
98
 
108
 
#if MIR_SERVER_VERSION >= MIR_VERSION_NUMBER(0, 24, 0)
109
99
                            auto const persistent_surface_store = server.the_persistent_surface_store();
110
 
#else
111
 
                            std::shared_ptr<mir::shell::PersistentSurfaceStore> const persistent_surface_store;
112
 
#endif
113
100
 
114
101
                            auto builder = [this](WindowManagerTools const& tools) -> std::unique_ptr<miral::WindowManagementPolicy>
115
102
                                {