~vanvugt/mir/fix-1378706

« back to all changes in this revision

Viewing changes to tests/integration-tests/test_server_shutdown.cpp

Drops InputConfiguration. The input configuration code is now part of DefaultServerConfiguration .

Approved by Daniel van Vugt, Alan Griffiths, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include "mir_test_framework/display_server_test_fixture.h"
30
30
 
31
 
#include "mir_test/fake_event_hub_input_configuration.h"
32
31
#include "mir_test/fake_event_hub.h"
33
32
#include "mir_test_doubles/stub_renderer.h"
34
33
 
123
122
 
124
123
struct FakeEventHubServerConfig : TestingServerConfiguration
125
124
{
126
 
    std::shared_ptr<mi::InputConfiguration> the_input_configuration() override
 
125
    std::shared_ptr<droidinput::EventHubInterface> the_event_hub() override
127
126
    {
128
 
        if (!input_configuration)
129
 
        {
130
 
            input_configuration =
131
 
                std::make_shared<mtd::FakeEventHubInputConfiguration>(
132
 
                    the_input_dispatcher(),
133
 
                    the_input_region(),
134
 
                    the_cursor_listener(),
135
 
                    the_touch_visualizer(),
136
 
                    the_input_report());
137
 
        }
138
 
 
139
 
        return input_configuration;
 
127
        return the_fake_event_hub();
140
128
    }
141
129
 
142
130
    std::shared_ptr<mi::InputManager> the_input_manager() override
154
142
        return DefaultServerConfiguration::the_input_dispatcher();
155
143
    }
156
144
 
157
 
    mia::FakeEventHub* the_fake_event_hub()
 
145
 
 
146
    std::shared_ptr<mia::FakeEventHub> the_fake_event_hub()
158
147
    {
159
 
        the_input_configuration();
160
 
        return input_configuration->the_fake_event_hub();
 
148
        if (!fake_event_hub)
 
149
        {
 
150
            fake_event_hub = std::make_shared<mia::FakeEventHub>();
 
151
        }
 
152
 
 
153
        return fake_event_hub;
161
154
    }
162
155
 
163
 
    std::shared_ptr<mtd::FakeEventHubInputConfiguration> input_configuration;
 
156
    std::shared_ptr<mia::FakeEventHub> fake_event_hub;
164
157
};
165
158
}
166
159