Merge lp:~alan-griffiths/mir/death-to-SurfaceConfigurator into lp:mir
- death-to-SurfaceConfigurator
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Alan Griffiths |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2448 |
Proposed branch: | lp:~alan-griffiths/mir/death-to-SurfaceConfigurator |
Merge into: | lp:mir |
Diff against target: |
462 lines (+9/-245) 14 files modified
playground/demo-shell/demo_shell.cpp (+1/-2) src/include/server/mir/default_server_configuration.h (+0/-3) src/include/server/mir/scene/surface_configurator.h (+0/-54) src/include/server/mir/shell/default_window_manager.h (+2/-4) src/server/default_server_configuration.cpp (+0/-20) src/server/scene/surface_allocator.h (+0/-1) src/server/shell/default_window_manager.cpp (+3/-12) tests/include/mir_test_doubles/mock_surface_configurator.h (+0/-43) tests/include/mir_test_doubles/null_surface_configurator.h (+0/-48) tests/integration-tests/test_default_window_manager.cpp (+1/-51) tests/integration-tests/test_surface_stack_with_compositor.cpp (+0/-1) tests/mir_test_framework/fake_event_hub_server_configuration.cpp (+1/-2) tests/unit-tests/scene/test_surface.cpp (+0/-1) tests/unit-tests/shell/test_default_window_manager.cpp (+1/-3) |
To merge this branch: | bzr merge lp:~alan-griffiths/mir/death-to-SurfaceConfigurator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Daniel van Vugt | Approve | ||
Alexandros Frantzis (community) | Approve | ||
Review via email: mp+254796@code.launchpad.net |
Commit message
scene: Remove the useless (and unused) SurfaceConfigurator customization point
Description of the change
scene: Remove the useless (and unused) SurfaceConfigurator customization point
PS Jenkins bot (ps-jenkins) wrote : | # |
Daniel van Vugt (vanvugt) wrote : | # |
Cool.
I implemented and almost proposed this a while back, but then found it was used downstream somewhere. Are all downstream users weaned off it yet?
Alexandros Frantzis (afrantzis) wrote : | # |
Looks good. A quick grep shows a reference to the_surface_
Alan Griffiths (alan-griffiths) wrote : | # |
> Cool.
>
> I implemented and almost proposed this a while back, but then found it was
> used downstream somewhere. Are all downstream users weaned off it yet?
Nearly: https:/
Daniel van Vugt (vanvugt) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'playground/demo-shell/demo_shell.cpp' | |||
2 | --- playground/demo-shell/demo_shell.cpp 2015-03-31 14:05:53 +0000 | |||
3 | +++ playground/demo-shell/demo_shell.cpp 2015-04-01 10:12:47 +0000 | |||
4 | @@ -107,8 +107,7 @@ | |||
5 | 107 | { return std::make_shared<shell::DefaultWindowManager>( | 107 | { return std::make_shared<shell::DefaultWindowManager>( |
6 | 108 | focus_controller, | 108 | focus_controller, |
7 | 109 | the_placement_strategy(), | 109 | the_placement_strategy(), |
10 | 110 | the_session_coordinator(), | 110 | the_session_coordinator()); }; |
9 | 111 | the_surface_configurator()); }; | ||
11 | 112 | } | 111 | } |
12 | 113 | 112 | ||
13 | 114 | std::shared_ptr<msh::HostLifecycleEventListener> the_host_lifecycle_event_listener() override | 113 | std::shared_ptr<msh::HostLifecycleEventListener> the_host_lifecycle_event_listener() override |
14 | 115 | 114 | ||
15 | === modified file 'src/include/server/mir/default_server_configuration.h' | |||
16 | --- src/include/server/mir/default_server_configuration.h 2015-03-31 02:35:42 +0000 | |||
17 | +++ src/include/server/mir/default_server_configuration.h 2015-04-01 10:12:47 +0000 | |||
18 | @@ -104,7 +104,6 @@ | |||
19 | 104 | class SessionCoordinator; | 104 | class SessionCoordinator; |
20 | 105 | class SnapshotStrategy; | 105 | class SnapshotStrategy; |
21 | 106 | class SurfaceCoordinator; | 106 | class SurfaceCoordinator; |
22 | 107 | class SurfaceConfigurator; | ||
23 | 108 | class SurfaceStackModel; | 107 | class SurfaceStackModel; |
24 | 109 | class SurfaceStack; | 108 | class SurfaceStack; |
25 | 110 | class SceneReport; | 109 | class SceneReport; |
26 | @@ -283,7 +282,6 @@ | |||
27 | 283 | virtual std::shared_ptr<scene::SurfaceStackModel> the_surface_stack_model(); | 282 | virtual std::shared_ptr<scene::SurfaceStackModel> the_surface_stack_model(); |
28 | 284 | virtual std::shared_ptr<scene::SurfaceFactory> the_surface_factory(); | 283 | virtual std::shared_ptr<scene::SurfaceFactory> the_surface_factory(); |
29 | 285 | virtual std::shared_ptr<scene::SurfaceCoordinator>the_surface_coordinator(); | 284 | virtual std::shared_ptr<scene::SurfaceCoordinator>the_surface_coordinator(); |
30 | 286 | virtual std::shared_ptr<scene::SurfaceConfigurator> the_surface_configurator(); | ||
31 | 287 | /** @} */ | 285 | /** @} */ |
32 | 288 | 286 | ||
33 | 289 | /** @name scene configuration - dependencies | 287 | /** @name scene configuration - dependencies |
34 | @@ -424,7 +422,6 @@ | |||
35 | 424 | CachedPtr<scene::PixelBuffer> pixel_buffer; | 422 | CachedPtr<scene::PixelBuffer> pixel_buffer; |
36 | 425 | CachedPtr<scene::SnapshotStrategy> snapshot_strategy; | 423 | CachedPtr<scene::SnapshotStrategy> snapshot_strategy; |
37 | 426 | CachedPtr<shell::DisplayLayout> shell_display_layout; | 424 | CachedPtr<shell::DisplayLayout> shell_display_layout; |
38 | 427 | CachedPtr<scene::SurfaceConfigurator> surface_configurator; | ||
39 | 428 | CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory; | 425 | CachedPtr<compositor::DisplayBufferCompositorFactory> display_buffer_compositor_factory; |
40 | 429 | CachedPtr<compositor::Compositor> compositor; | 426 | CachedPtr<compositor::Compositor> compositor; |
41 | 430 | CachedPtr<compositor::CompositorReport> compositor_report; | 427 | CachedPtr<compositor::CompositorReport> compositor_report; |
42 | 431 | 428 | ||
43 | === removed file 'src/include/server/mir/scene/surface_configurator.h' | |||
44 | --- src/include/server/mir/scene/surface_configurator.h 2015-03-24 15:18:19 +0000 | |||
45 | +++ src/include/server/mir/scene/surface_configurator.h 1970-01-01 00:00:00 +0000 | |||
46 | @@ -1,54 +0,0 @@ | |||
47 | 1 | /* | ||
48 | 2 | * Copyright © 2013 Canonical Ltd. | ||
49 | 3 | * | ||
50 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
51 | 5 | * under the terms of the GNU General Public License version 3, | ||
52 | 6 | * as published by the Free Software Foundation. | ||
53 | 7 | * | ||
54 | 8 | * This program is distributed in the hope that it will be useful, | ||
55 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
56 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
57 | 11 | * GNU General Public License for more details. | ||
58 | 12 | * | ||
59 | 13 | * You should have received a copy of the GNU General Public License | ||
60 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
61 | 15 | * | ||
62 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | ||
63 | 17 | */ | ||
64 | 18 | |||
65 | 19 | #ifndef MIR_SCENE_SURFACE_CONFIGURATOR_H_ | ||
66 | 20 | #define MIR_SCENE_SURFACE_CONFIGURATOR_H_ | ||
67 | 21 | |||
68 | 22 | #include "mir_toolkit/common.h" | ||
69 | 23 | |||
70 | 24 | #include <memory> | ||
71 | 25 | |||
72 | 26 | namespace mir | ||
73 | 27 | { | ||
74 | 28 | |||
75 | 29 | namespace scene | ||
76 | 30 | { | ||
77 | 31 | class Surface; | ||
78 | 32 | |||
79 | 33 | class SurfaceConfigurator | ||
80 | 34 | { | ||
81 | 35 | public: | ||
82 | 36 | virtual ~SurfaceConfigurator() = default; | ||
83 | 37 | |||
84 | 38 | /// Returns the selected value. | ||
85 | 39 | virtual int select_attribute_value(Surface const& surface, MirSurfaceAttrib attrib, | ||
86 | 40 | int requested_value) = 0; | ||
87 | 41 | |||
88 | 42 | virtual void attribute_set(Surface const& surface, MirSurfaceAttrib attrib, | ||
89 | 43 | int new_value) = 0; | ||
90 | 44 | |||
91 | 45 | protected: | ||
92 | 46 | SurfaceConfigurator() = default; | ||
93 | 47 | SurfaceConfigurator(SurfaceConfigurator const&) = delete; | ||
94 | 48 | SurfaceConfigurator& operator=(SurfaceConfigurator const&) = delete; | ||
95 | 49 | }; | ||
96 | 50 | |||
97 | 51 | } | ||
98 | 52 | } // namespace mir | ||
99 | 53 | |||
100 | 54 | #endif // MIR_SCENE_SURFACE_CONFIGURATOR_H_ | ||
101 | 55 | 0 | ||
102 | === modified file 'src/include/server/mir/shell/default_window_manager.h' | |||
103 | --- src/include/server/mir/shell/default_window_manager.h 2015-03-31 11:18:41 +0000 | |||
104 | +++ src/include/server/mir/shell/default_window_manager.h 2015-04-01 10:12:47 +0000 | |||
105 | @@ -23,7 +23,7 @@ | |||
106 | 23 | 23 | ||
107 | 24 | namespace mir | 24 | namespace mir |
108 | 25 | { | 25 | { |
110 | 26 | namespace scene { class PlacementStrategy; class SurfaceConfigurator; class SessionCoordinator; } | 26 | namespace scene { class PlacementStrategy; class SessionCoordinator; } |
111 | 27 | 27 | ||
112 | 28 | namespace shell | 28 | namespace shell |
113 | 29 | { | 29 | { |
114 | @@ -34,8 +34,7 @@ | |||
115 | 34 | public: | 34 | public: |
116 | 35 | explicit DefaultWindowManager(FocusController* focus_controller, | 35 | explicit DefaultWindowManager(FocusController* focus_controller, |
117 | 36 | std::shared_ptr<scene::PlacementStrategy> const& placement_strategy, | 36 | std::shared_ptr<scene::PlacementStrategy> const& placement_strategy, |
120 | 37 | std::shared_ptr<scene::SessionCoordinator> const& session_coordinator, | 37 | std::shared_ptr<scene::SessionCoordinator> const& session_coordinator); |
119 | 38 | std::shared_ptr<scene::SurfaceConfigurator> const& surface_configurator); | ||
121 | 39 | 38 | ||
122 | 40 | void add_session(std::shared_ptr<scene::Session> const& session) override; | 39 | void add_session(std::shared_ptr<scene::Session> const& session) override; |
123 | 41 | 40 | ||
124 | @@ -70,7 +69,6 @@ | |||
125 | 70 | FocusController* const focus_controller; | 69 | FocusController* const focus_controller; |
126 | 71 | std::shared_ptr<scene::PlacementStrategy> const placement_strategy; | 70 | std::shared_ptr<scene::PlacementStrategy> const placement_strategy; |
127 | 72 | std::shared_ptr<scene::SessionCoordinator> const session_coordinator; | 71 | std::shared_ptr<scene::SessionCoordinator> const session_coordinator; |
128 | 73 | std::shared_ptr<scene::SurfaceConfigurator> const surface_configurator; | ||
129 | 74 | }; | 72 | }; |
130 | 75 | } | 73 | } |
131 | 76 | } | 74 | } |
132 | 77 | 75 | ||
133 | === modified file 'src/server/default_server_configuration.cpp' | |||
134 | --- src/server/default_server_configuration.cpp 2015-01-21 07:34:50 +0000 | |||
135 | +++ src/server/default_server_configuration.cpp 2015-04-01 10:12:47 +0000 | |||
136 | @@ -29,7 +29,6 @@ | |||
137 | 29 | #include "mir/options/program_option.h" | 29 | #include "mir/options/program_option.h" |
138 | 30 | #include "mir/frontend/session_credentials.h" | 30 | #include "mir/frontend/session_credentials.h" |
139 | 31 | #include "mir/frontend/session_authorizer.h" | 31 | #include "mir/frontend/session_authorizer.h" |
140 | 32 | #include "mir/scene/surface_configurator.h" | ||
141 | 33 | #include "mir/graphics/cursor.h" | 32 | #include "mir/graphics/cursor.h" |
142 | 34 | #include "mir/scene/null_session_listener.h" | 33 | #include "mir/scene/null_session_listener.h" |
143 | 35 | #include "mir/graphics/display.h" | 34 | #include "mir/graphics/display.h" |
144 | @@ -101,25 +100,6 @@ | |||
145 | 101 | }); | 100 | }); |
146 | 102 | } | 101 | } |
147 | 103 | 102 | ||
148 | 104 | std::shared_ptr<ms::SurfaceConfigurator> mir::DefaultServerConfiguration::the_surface_configurator() | ||
149 | 105 | { | ||
150 | 106 | struct DefaultSurfaceConfigurator : public ms::SurfaceConfigurator | ||
151 | 107 | { | ||
152 | 108 | int select_attribute_value(ms::Surface const&, MirSurfaceAttrib, int requested_value) | ||
153 | 109 | { | ||
154 | 110 | return requested_value; | ||
155 | 111 | } | ||
156 | 112 | void attribute_set(ms::Surface const&, MirSurfaceAttrib, int) | ||
157 | 113 | { | ||
158 | 114 | } | ||
159 | 115 | }; | ||
160 | 116 | return surface_configurator( | ||
161 | 117 | [this]() | ||
162 | 118 | { | ||
163 | 119 | return std::make_shared<DefaultSurfaceConfigurator>(); | ||
164 | 120 | }); | ||
165 | 121 | } | ||
166 | 122 | |||
167 | 123 | std::shared_ptr<mf::SessionAuthorizer> | 103 | std::shared_ptr<mf::SessionAuthorizer> |
168 | 124 | mir::DefaultServerConfiguration::the_session_authorizer() | 104 | mir::DefaultServerConfiguration::the_session_authorizer() |
169 | 125 | { | 105 | { |
170 | 126 | 106 | ||
171 | === modified file 'src/server/scene/surface_allocator.h' | |||
172 | --- src/server/scene/surface_allocator.h 2015-03-31 02:35:42 +0000 | |||
173 | +++ src/server/scene/surface_allocator.h 2015-04-01 10:12:47 +0000 | |||
174 | @@ -36,7 +36,6 @@ | |||
175 | 36 | { | 36 | { |
176 | 37 | class BufferStreamFactory; | 37 | class BufferStreamFactory; |
177 | 38 | class SceneReport; | 38 | class SceneReport; |
178 | 39 | class SurfaceConfigurator; | ||
179 | 40 | 39 | ||
180 | 41 | class SurfaceAllocator : public SurfaceFactory | 40 | class SurfaceAllocator : public SurfaceFactory |
181 | 42 | { | 41 | { |
182 | 43 | 42 | ||
183 | === modified file 'src/server/shell/default_window_manager.cpp' | |||
184 | --- src/server/shell/default_window_manager.cpp 2015-03-31 11:18:41 +0000 | |||
185 | +++ src/server/shell/default_window_manager.cpp 2015-04-01 10:12:47 +0000 | |||
186 | @@ -23,7 +23,6 @@ | |||
187 | 23 | #include "mir/scene/session.h" | 23 | #include "mir/scene/session.h" |
188 | 24 | #include "mir/scene/session_coordinator.h" | 24 | #include "mir/scene/session_coordinator.h" |
189 | 25 | #include "mir/scene/surface.h" | 25 | #include "mir/scene/surface.h" |
190 | 26 | #include "mir/scene/surface_configurator.h" | ||
191 | 27 | #include "mir/scene/surface_creation_parameters.h" | 26 | #include "mir/scene/surface_creation_parameters.h" |
192 | 28 | #include "mir/shell/focus_controller.h" | 27 | #include "mir/shell/focus_controller.h" |
193 | 29 | 28 | ||
194 | @@ -34,12 +33,10 @@ | |||
195 | 34 | msh::DefaultWindowManager::DefaultWindowManager( | 33 | msh::DefaultWindowManager::DefaultWindowManager( |
196 | 35 | FocusController* focus_controller, | 34 | FocusController* focus_controller, |
197 | 36 | std::shared_ptr<scene::PlacementStrategy> const& placement_strategy, | 35 | std::shared_ptr<scene::PlacementStrategy> const& placement_strategy, |
200 | 37 | std::shared_ptr<scene::SessionCoordinator> const& session_coordinator, | 36 | std::shared_ptr<scene::SessionCoordinator> const& session_coordinator) : |
199 | 38 | std::shared_ptr<scene::SurfaceConfigurator> const& surface_configurator) : | ||
201 | 39 | focus_controller{focus_controller}, | 37 | focus_controller{focus_controller}, |
202 | 40 | placement_strategy{placement_strategy}, | 38 | placement_strategy{placement_strategy}, |
205 | 41 | session_coordinator{session_coordinator}, | 39 | session_coordinator{session_coordinator} |
204 | 42 | surface_configurator{surface_configurator} | ||
206 | 43 | { | 40 | { |
207 | 44 | } | 41 | } |
208 | 45 | 42 | ||
209 | @@ -138,11 +135,5 @@ | |||
210 | 138 | MirSurfaceAttrib attrib, | 135 | MirSurfaceAttrib attrib, |
211 | 139 | int value) | 136 | int value) |
212 | 140 | { | 137 | { |
220 | 141 | auto const configured_value = surface_configurator->select_attribute_value(*surface, attrib, value); | 138 | return surface->configure(attrib, value); |
214 | 142 | |||
215 | 143 | auto const result = surface->configure(attrib, configured_value); | ||
216 | 144 | |||
217 | 145 | surface_configurator->attribute_set(*surface, attrib, result); | ||
218 | 146 | |||
219 | 147 | return result; | ||
221 | 148 | } | 139 | } |
222 | 149 | 140 | ||
223 | === removed file 'tests/include/mir_test_doubles/mock_surface_configurator.h' | |||
224 | --- tests/include/mir_test_doubles/mock_surface_configurator.h 2015-01-21 07:34:50 +0000 | |||
225 | +++ tests/include/mir_test_doubles/mock_surface_configurator.h 1970-01-01 00:00:00 +0000 | |||
226 | @@ -1,43 +0,0 @@ | |||
227 | 1 | /* | ||
228 | 2 | * Copyright © 2013 Canonical Ltd. | ||
229 | 3 | * | ||
230 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
231 | 5 | * under the terms of the GNU General Public License version 3, | ||
232 | 6 | * as published by the Free Software Foundation. | ||
233 | 7 | * | ||
234 | 8 | * This program is distributed in the hope that it will be useful, | ||
235 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
236 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
237 | 11 | * GNU General Public License for more details. | ||
238 | 12 | * | ||
239 | 13 | * You should have received a copy of the GNU General Public License | ||
240 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
241 | 15 | * | ||
242 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | ||
243 | 17 | */ | ||
244 | 18 | |||
245 | 19 | #ifndef MIR_TEST_DOUBLES_MOCK_SURFACE_CONFIGURATOR_H_ | ||
246 | 20 | #define MIR_TEST_DOUBLES_MOCK_SURFACE_CONFIGURATOR_H_ | ||
247 | 21 | |||
248 | 22 | #include "mir/scene/surface_configurator.h" | ||
249 | 23 | |||
250 | 24 | #include <gmock/gmock.h> | ||
251 | 25 | |||
252 | 26 | namespace mir | ||
253 | 27 | { | ||
254 | 28 | namespace test | ||
255 | 29 | { | ||
256 | 30 | namespace doubles | ||
257 | 31 | { | ||
258 | 32 | |||
259 | 33 | struct MockSurfaceConfigurator : public scene::SurfaceConfigurator | ||
260 | 34 | { | ||
261 | 35 | MOCK_METHOD3(select_attribute_value, int(scene::Surface const&, MirSurfaceAttrib, int)); | ||
262 | 36 | MOCK_METHOD3(attribute_set, void(scene::Surface const&, MirSurfaceAttrib, int)); | ||
263 | 37 | }; | ||
264 | 38 | |||
265 | 39 | } | ||
266 | 40 | } | ||
267 | 41 | } | ||
268 | 42 | |||
269 | 43 | #endif /* MIR_TEST_DOUBLES_MOCK_SURFACE_CONFIGURATOR_H_ */ | ||
270 | 44 | 0 | ||
271 | === removed file 'tests/include/mir_test_doubles/null_surface_configurator.h' | |||
272 | --- tests/include/mir_test_doubles/null_surface_configurator.h 2015-01-21 07:34:50 +0000 | |||
273 | +++ tests/include/mir_test_doubles/null_surface_configurator.h 1970-01-01 00:00:00 +0000 | |||
274 | @@ -1,48 +0,0 @@ | |||
275 | 1 | /* | ||
276 | 2 | * Copyright © 2013 Canonical Ltd. | ||
277 | 3 | * | ||
278 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
279 | 5 | * under the terms of the GNU General Public License version 3, | ||
280 | 6 | * as published by the Free Software Foundation. | ||
281 | 7 | * | ||
282 | 8 | * This program is distributed in the hope that it will be useful, | ||
283 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
284 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
285 | 11 | * GNU General Public License for more details. | ||
286 | 12 | * | ||
287 | 13 | * You should have received a copy of the GNU General Public License | ||
288 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
289 | 15 | * | ||
290 | 16 | * Authored by: Robert Carr <robert.carr@canonical.com> | ||
291 | 17 | */ | ||
292 | 18 | |||
293 | 19 | #ifndef MIR_TEST_DOUBLES_NULL_SURFACE_CONFIGURATOR_H_ | ||
294 | 20 | #define MIR_TEST_DOUBLES_NULL_SURFACE_CONFIGURATOR_H_ | ||
295 | 21 | |||
296 | 22 | #include "mir/scene/surface_configurator.h" | ||
297 | 23 | |||
298 | 24 | namespace mir | ||
299 | 25 | { | ||
300 | 26 | namespace test | ||
301 | 27 | { | ||
302 | 28 | namespace doubles | ||
303 | 29 | { | ||
304 | 30 | |||
305 | 31 | struct NullSurfaceConfigurator : public scene::SurfaceConfigurator | ||
306 | 32 | { | ||
307 | 33 | int select_attribute_value(scene::Surface const&, | ||
308 | 34 | MirSurfaceAttrib, int requested_value) | ||
309 | 35 | { | ||
310 | 36 | return requested_value; | ||
311 | 37 | } | ||
312 | 38 | void attribute_set(scene::Surface const&, | ||
313 | 39 | MirSurfaceAttrib, int) | ||
314 | 40 | { | ||
315 | 41 | } | ||
316 | 42 | }; | ||
317 | 43 | |||
318 | 44 | } | ||
319 | 45 | } | ||
320 | 46 | } | ||
321 | 47 | |||
322 | 48 | #endif /* MIR_TEST_DOUBLES_NULL_SURFACE_CONFIGURATOR_H_ */ | ||
323 | 49 | 0 | ||
324 | === modified file 'tests/integration-tests/test_default_window_manager.cpp' | |||
325 | --- tests/integration-tests/test_default_window_manager.cpp 2015-03-31 11:18:41 +0000 | |||
326 | +++ tests/integration-tests/test_default_window_manager.cpp 2015-04-01 10:12:47 +0000 | |||
327 | @@ -33,7 +33,6 @@ | |||
328 | 33 | #include "mir_test_doubles/null_snapshot_strategy.h" | 33 | #include "mir_test_doubles/null_snapshot_strategy.h" |
329 | 34 | #include "mir_test_doubles/null_event_sink.h" | 34 | #include "mir_test_doubles/null_event_sink.h" |
330 | 35 | #include "mir_test_doubles/null_session_event_sink.h" | 35 | #include "mir_test_doubles/null_session_event_sink.h" |
331 | 36 | #include "mir_test_doubles/mock_surface_configurator.h" | ||
332 | 37 | #include "mir_test_doubles/null_prompt_session_manager.h" | 36 | #include "mir_test_doubles/null_prompt_session_manager.h" |
333 | 38 | #include "mir_test_doubles/mock_input_targeter.h" | 37 | #include "mir_test_doubles/mock_input_targeter.h" |
334 | 39 | #include "mir_test_doubles/stub_buffer_stream_factory.h" | 38 | #include "mir_test_doubles/stub_buffer_stream_factory.h" |
335 | @@ -82,8 +81,6 @@ | |||
336 | 82 | mt::fake_shared(session_listener) | 81 | mt::fake_shared(session_listener) |
337 | 83 | }; | 82 | }; |
338 | 84 | 83 | ||
339 | 85 | NiceMock<mtd::MockSurfaceConfigurator> surface_configurator; | ||
340 | 86 | |||
341 | 87 | msh::AbstractShell shell{ | 84 | msh::AbstractShell shell{ |
342 | 88 | mt::fake_shared(input_targeter), | 85 | mt::fake_shared(input_targeter), |
343 | 89 | mt::fake_shared(surface_coordinator), | 86 | mt::fake_shared(surface_coordinator), |
344 | @@ -93,8 +90,7 @@ | |||
345 | 93 | { return std::make_shared<msh::DefaultWindowManager>( | 90 | { return std::make_shared<msh::DefaultWindowManager>( |
346 | 94 | focus_controller, | 91 | focus_controller, |
347 | 95 | std::make_shared<NullPlacementStrategy>(), | 92 | std::make_shared<NullPlacementStrategy>(), |
350 | 96 | mt::fake_shared(session_manager), | 93 | mt::fake_shared(session_manager)); |
349 | 97 | mt::fake_shared(surface_configurator)); | ||
351 | 98 | }}; | 94 | }}; |
352 | 99 | }; | 95 | }; |
353 | 100 | } | 96 | } |
354 | @@ -183,49 +179,3 @@ | |||
355 | 183 | 179 | ||
356 | 184 | shell.set_focus_to(mt::fake_shared(app), mock_surface); | 180 | shell.set_focus_to(mt::fake_shared(app), mock_surface); |
357 | 185 | } | 181 | } |
358 | 186 | |||
359 | 187 | TEST_F(TestDefaultWindowManager, configurator_selects_attribute_values) | ||
360 | 188 | { | ||
361 | 189 | mtd::StubSceneSession app; | ||
362 | 190 | auto const session = mt::fake_shared(app); | ||
363 | 191 | auto const surface = std::make_shared<NiceMock<mtd::MockSurface>>(); | ||
364 | 192 | ON_CALL(*surface, configure(_, _)).WillByDefault(ReturnArg<1>()); | ||
365 | 193 | |||
366 | 194 | InSequence seq; | ||
367 | 195 | |||
368 | 196 | EXPECT_CALL(surface_configurator, select_attribute_value(_, mir_surface_attrib_state, mir_surface_state_restored)) | ||
369 | 197 | .WillOnce(Return(mir_surface_state_minimized)); | ||
370 | 198 | |||
371 | 199 | EXPECT_CALL(*surface, configure(mir_surface_attrib_state, mir_surface_state_minimized)); | ||
372 | 200 | |||
373 | 201 | EXPECT_CALL(surface_configurator, attribute_set(_, mir_surface_attrib_state, mir_surface_state_minimized)); | ||
374 | 202 | |||
375 | 203 | EXPECT_THAT( | ||
376 | 204 | shell.set_surface_attribute(session, surface, mir_surface_attrib_state, mir_surface_state_restored), | ||
377 | 205 | Eq(mir_surface_state_minimized)); | ||
378 | 206 | } | ||
379 | 207 | |||
380 | 208 | TEST_F(TestDefaultWindowManager, set_surface_attribute_returns_value_set_by_configurator) | ||
381 | 209 | { | ||
382 | 210 | mtd::StubSceneSession app; | ||
383 | 211 | auto const session = mt::fake_shared(app); | ||
384 | 212 | auto const surface = std::make_shared<NiceMock<mtd::MockSurface>>(); | ||
385 | 213 | ON_CALL(*surface, configure(_, _)).WillByDefault(ReturnArg<1>()); | ||
386 | 214 | |||
387 | 215 | ON_CALL(surface_configurator, select_attribute_value(_, Not(mir_surface_attrib_focus), _)) | ||
388 | 216 | .WillByDefault(ReturnArg<1>()); | ||
389 | 217 | |||
390 | 218 | ON_CALL(surface_configurator, select_attribute_value(_, mir_surface_attrib_focus, mir_surface_focused)) | ||
391 | 219 | .WillByDefault(Return(mir_surface_unfocused)); | ||
392 | 220 | |||
393 | 221 | ON_CALL(surface_configurator, select_attribute_value(_, mir_surface_attrib_focus, Not(mir_surface_focused))) | ||
394 | 222 | .WillByDefault(Return(mir_surface_focused)); | ||
395 | 223 | |||
396 | 224 | EXPECT_THAT( | ||
397 | 225 | shell.set_surface_attribute(session, surface, mir_surface_attrib_focus, mir_surface_focused), | ||
398 | 226 | Eq(mir_surface_unfocused)); | ||
399 | 227 | |||
400 | 228 | EXPECT_THAT( | ||
401 | 229 | shell.set_surface_attribute(session, surface, mir_surface_attrib_focus, mir_surface_unfocused), | ||
402 | 230 | Eq(mir_surface_focused)); | ||
403 | 231 | } | ||
404 | 232 | 182 | ||
405 | === modified file 'tests/integration-tests/test_surface_stack_with_compositor.cpp' | |||
406 | --- tests/integration-tests/test_surface_stack_with_compositor.cpp 2015-03-31 02:35:42 +0000 | |||
407 | +++ tests/integration-tests/test_surface_stack_with_compositor.cpp 2015-04-01 10:12:47 +0000 | |||
408 | @@ -31,7 +31,6 @@ | |||
409 | 31 | #include "mir_test_doubles/stub_display_buffer.h" | 31 | #include "mir_test_doubles/stub_display_buffer.h" |
410 | 32 | #include "mir_test_doubles/stub_buffer.h" | 32 | #include "mir_test_doubles/stub_buffer.h" |
411 | 33 | #include "mir_test_doubles/stub_input_sender.h" | 33 | #include "mir_test_doubles/stub_input_sender.h" |
412 | 34 | #include "mir_test_doubles/null_surface_configurator.h" | ||
413 | 35 | #include "mir_test_doubles/null_display_sync_group.h" | 34 | #include "mir_test_doubles/null_display_sync_group.h" |
414 | 36 | 35 | ||
415 | 37 | #include <condition_variable> | 36 | #include <condition_variable> |
416 | 38 | 37 | ||
417 | === modified file 'tests/mir_test_framework/fake_event_hub_server_configuration.cpp' | |||
418 | --- tests/mir_test_framework/fake_event_hub_server_configuration.cpp 2015-03-31 11:18:41 +0000 | |||
419 | +++ tests/mir_test_framework/fake_event_hub_server_configuration.cpp 2015-04-01 10:12:47 +0000 | |||
420 | @@ -69,7 +69,6 @@ | |||
421 | 69 | { return std::make_shared<ms::DefaultWindowManager>( | 69 | { return std::make_shared<ms::DefaultWindowManager>( |
422 | 70 | focus_controller, | 70 | focus_controller, |
423 | 71 | the_placement_strategy(), | 71 | the_placement_strategy(), |
426 | 72 | the_session_coordinator(), | 72 | the_session_coordinator()); }; |
425 | 73 | the_surface_configurator()); }; | ||
427 | 74 | } | 73 | } |
428 | 75 | 74 | ||
429 | 76 | 75 | ||
430 | === modified file 'tests/unit-tests/scene/test_surface.cpp' | |||
431 | --- tests/unit-tests/scene/test_surface.cpp 2015-03-31 02:35:42 +0000 | |||
432 | +++ tests/unit-tests/scene/test_surface.cpp 2015-04-01 10:12:47 +0000 | |||
433 | @@ -23,7 +23,6 @@ | |||
434 | 23 | #include "src/server/report/null_report_factory.h" | 23 | #include "src/server/report/null_report_factory.h" |
435 | 24 | #include "mir/frontend/event_sink.h" | 24 | #include "mir/frontend/event_sink.h" |
436 | 25 | #include "mir/scene/surface_creation_parameters.h" | 25 | #include "mir/scene/surface_creation_parameters.h" |
437 | 26 | #include "mir/scene/surface_configurator.h" | ||
438 | 27 | #include "mir/scene/surface_event_source.h" | 26 | #include "mir/scene/surface_event_source.h" |
439 | 28 | #include "mir/input/input_channel.h" | 27 | #include "mir/input/input_channel.h" |
440 | 29 | 28 | ||
441 | 30 | 29 | ||
442 | === modified file 'tests/unit-tests/shell/test_default_window_manager.cpp' | |||
443 | --- tests/unit-tests/shell/test_default_window_manager.cpp 2015-03-31 11:18:41 +0000 | |||
444 | +++ tests/unit-tests/shell/test_default_window_manager.cpp 2015-04-01 10:12:47 +0000 | |||
445 | @@ -34,7 +34,6 @@ | |||
446 | 34 | #include "mir_test_doubles/mock_session_listener.h" | 34 | #include "mir_test_doubles/mock_session_listener.h" |
447 | 35 | #include "mir_test_doubles/mock_surface.h" | 35 | #include "mir_test_doubles/mock_surface.h" |
448 | 36 | #include "mir_test_doubles/null_snapshot_strategy.h" | 36 | #include "mir_test_doubles/null_snapshot_strategy.h" |
449 | 37 | #include "mir_test_doubles/null_surface_configurator.h" | ||
450 | 38 | #include "mir_test_doubles/null_prompt_session_manager.h" | 37 | #include "mir_test_doubles/null_prompt_session_manager.h" |
451 | 39 | #include "mir_test_doubles/stub_input_targeter.h" | 38 | #include "mir_test_doubles/stub_input_targeter.h" |
452 | 40 | #include "mir_test_doubles/stub_buffer_stream_factory.h" | 39 | #include "mir_test_doubles/stub_buffer_stream_factory.h" |
453 | @@ -127,8 +126,7 @@ | |||
454 | 127 | { return std::make_shared<msh::DefaultWindowManager>( | 126 | { return std::make_shared<msh::DefaultWindowManager>( |
455 | 128 | focus_controller, | 127 | focus_controller, |
456 | 129 | mt::fake_shared(placement_strategy), | 128 | mt::fake_shared(placement_strategy), |
459 | 130 | mt::fake_shared(session_manager), | 129 | mt::fake_shared(session_manager)); |
458 | 131 | std::make_shared<mtd::NullSurfaceConfigurator>()); | ||
460 | 132 | }}; | 130 | }}; |
461 | 133 | 131 | ||
462 | 134 | void SetUp() override | 132 | void SetUp() override |
PASSED: Continuous integration, rev:2445 jenkins. qa.ubuntu. com/job/ mir-ci/ 3414/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/1899 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/1898 jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/1849 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1411 jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 1411/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1849 jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 1849/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-mediumtests -runner- mako/4802 s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 19315
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/3414/ rebuild
http://