Merge lp:~alan-griffiths/mir/tidy-code into lp:mir
- tidy-code
- Merge into development-branch
Status: | Merged |
---|---|
Merged at revision: | 4120 |
Proposed branch: | lp:~alan-griffiths/mir/tidy-code |
Merge into: | lp:mir |
Diff against target: |
277 lines (+9/-214) 2 files modified
include/test/mir_test_framework/observant_shell.h (+4/-74) tests/mir_test_framework/observant_shell.cpp (+5/-140) |
To merge this branch: | bzr merge lp:~alan-griffiths/mir/tidy-code |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Needs Fixing | |
Daniel van Vugt | Approve | ||
Chris Halse Rogers | Approve | ||
Review via email: mp+321093@code.launchpad.net |
Commit message
Simplify mtf::ObservantShell
Description of the change
Mir CI Bot (mir-ci-bot) wrote : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Mir CI Bot (mir-ci-bot) : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Alan Griffiths (alan-griffiths) wrote : | # |
"08:00:55 E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem."
Is this a new failure mode? testflinger?
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Alan Griffiths (alan-griffiths) wrote : | # |
09:34:02 ++ testflinger-cli submit -q /dev/stdin
09:34:09 Traceback (most recent call last):
09:34:09 File "/snap/
09:34:09 six.raise_from(e, None)
...
09:34:09 During handling of the above exception, another exception occurred:
...
09:34:09 + JOB_ID=
09:34:09 Build step 'Execute shell' marked build as failure
09:34:09 [WS-CLEANUP] Deleting project workspace.
09:34:09 Finished: FAILURE
Mir CI Bot (mir-ci-bot) : | # |
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
https:/
Executed test runs:
SUCCESS: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Preview Diff
1 | === modified file 'include/test/mir_test_framework/observant_shell.h' |
2 | --- include/test/mir_test_framework/observant_shell.h 2017-03-09 17:42:58 +0000 |
3 | +++ include/test/mir_test_framework/observant_shell.h 2017-03-27 16:55:20 +0000 |
4 | @@ -19,96 +19,26 @@ |
5 | #ifndef MIR_TEST_OBSERVANT_SHELL_H_ |
6 | #define MIR_TEST_OBSERVANT_SHELL_H_ |
7 | |
8 | -#include "mir/scene/session.h" |
9 | -#include "mir/scene/surface.h" |
10 | -#include "mir/shell/shell.h" |
11 | +#include "mir/shell/shell_wrapper.h" |
12 | + |
13 | +namespace mir { namespace scene { class SurfaceObserver; }} |
14 | |
15 | namespace mir_test_framework |
16 | { |
17 | - |
18 | -struct ObservantShell : mir::shell::Shell |
19 | +struct ObservantShell : mir::shell::ShellWrapper |
20 | { |
21 | ObservantShell( |
22 | std::shared_ptr<mir::shell::Shell> const& wrapped, |
23 | std::shared_ptr<mir::scene::SurfaceObserver> const& surface_observer); |
24 | |
25 | - void add_display(mir::geometry::Rectangle const& area) override; |
26 | - |
27 | - void remove_display(mir::geometry::Rectangle const& area) override; |
28 | - |
29 | - bool handle(MirEvent const& event) override; |
30 | - |
31 | - void focus_next_session() override; |
32 | - |
33 | - auto focused_session() const -> std::shared_ptr<mir::scene::Session> override; |
34 | - |
35 | - void set_focus_to( |
36 | - std::shared_ptr<mir::scene::Session> const& focus_session, |
37 | - std::shared_ptr<mir::scene::Surface> const& focus_surface) override; |
38 | - |
39 | - std::shared_ptr<mir::scene::Surface> focused_surface() const override; |
40 | - |
41 | - auto surface_at(mir::geometry::Point cursor) const -> std::shared_ptr<mir::scene::Surface> override; |
42 | - |
43 | - void raise(mir::shell::SurfaceSet const& surfaces) override; |
44 | - |
45 | - std::shared_ptr<mir::scene::Session> open_session( |
46 | - pid_t client_pid, |
47 | - std::string const& name, |
48 | - std::shared_ptr<mir::frontend::EventSink> const& sink) override; |
49 | - |
50 | - void close_session(std::shared_ptr<mir::scene::Session> const& session) override; |
51 | - |
52 | - std::shared_ptr<mir::scene::PromptSession> start_prompt_session_for( |
53 | - std::shared_ptr<mir::scene::Session> const& session, |
54 | - mir::scene::PromptSessionCreationParameters const& params) override; |
55 | - |
56 | - void add_prompt_provider_for( |
57 | - std::shared_ptr<mir::scene::PromptSession> const& prompt_session, |
58 | - std::shared_ptr<mir::scene::Session> const& session) override; |
59 | - |
60 | - void stop_prompt_session(std::shared_ptr<mir::scene::PromptSession> const& prompt_session) override; |
61 | - |
62 | mir::frontend::SurfaceId create_surface( |
63 | std::shared_ptr<mir::scene::Session> const& session, |
64 | mir::scene::SurfaceCreationParameters const& params, |
65 | std::shared_ptr<mir::frontend::EventSink> const& sink) override; |
66 | |
67 | - void modify_surface( |
68 | - std::shared_ptr<mir::scene::Session> const& session, |
69 | - std::shared_ptr<mir::scene::Surface> const& window, |
70 | - mir::shell::SurfaceSpecification const& modifications) override; |
71 | - |
72 | - void destroy_surface(std::shared_ptr<mir::scene::Session> const& session, mir::frontend::SurfaceId window) override; |
73 | - |
74 | - int set_surface_attribute( |
75 | - std::shared_ptr<mir::scene::Session> const& session, |
76 | - std::shared_ptr<mir::scene::Surface> const& window, |
77 | - MirWindowAttrib attrib, |
78 | - int value) override; |
79 | - |
80 | - int get_surface_attribute( |
81 | - std::shared_ptr<mir::scene::Surface> const& window, |
82 | - MirWindowAttrib attrib) override; |
83 | - |
84 | - void raise_surface( |
85 | - std::shared_ptr<mir::scene::Session> const& session, |
86 | - std::shared_ptr<mir::scene::Surface> const& window, |
87 | - uint64_t timestamp) override; |
88 | - |
89 | - void request_drag_and_drop( |
90 | - std::shared_ptr<mir::scene::Session> const& session, |
91 | - std::shared_ptr<mir::scene::Surface> const& window, |
92 | - uint64_t timestamp) override; |
93 | - |
94 | - void set_drag_and_drop_handle(std::vector<uint8_t> const& handle) override; |
95 | - void clear_drag_and_drop_handle() override; |
96 | - |
97 | private: |
98 | - std::shared_ptr<mir::shell::Shell> const wrapped; |
99 | std::shared_ptr<mir::scene::SurfaceObserver> const surface_observer; |
100 | }; |
101 | - |
102 | } |
103 | |
104 | #endif /* MIR_TEST_OBSERVANT_SHELL_H_ */ |
105 | |
106 | === modified file 'tests/mir_test_framework/observant_shell.cpp' |
107 | --- tests/mir_test_framework/observant_shell.cpp 2017-03-10 12:02:27 +0000 |
108 | +++ tests/mir_test_framework/observant_shell.cpp 2017-03-27 16:55:20 +0000 |
109 | @@ -18,163 +18,28 @@ |
110 | |
111 | #include "mir_test_framework/observant_shell.h" |
112 | |
113 | -namespace geom = mir::geometry; |
114 | +#include "mir/scene/session.h" |
115 | +#include "mir/scene/surface.h" |
116 | + |
117 | namespace msh = mir::shell; |
118 | namespace msc = mir::scene; |
119 | namespace mf = mir::frontend; |
120 | -namespace mi = mir::input; |
121 | namespace mtf = mir_test_framework; |
122 | |
123 | mtf::ObservantShell::ObservantShell( |
124 | std::shared_ptr<msh::Shell> const& wrapped, |
125 | std::shared_ptr<msc::SurfaceObserver> const& surface_observer) : |
126 | - wrapped(wrapped), |
127 | + msh::ShellWrapper(wrapped), |
128 | surface_observer(surface_observer) |
129 | { |
130 | } |
131 | - |
132 | -void mtf::ObservantShell::add_display(geom::Rectangle const& area) |
133 | -{ |
134 | - return wrapped->add_display(area); |
135 | -} |
136 | - |
137 | -void mtf::ObservantShell::remove_display(geom::Rectangle const& area) |
138 | -{ |
139 | - return wrapped->remove_display(area); |
140 | -} |
141 | - |
142 | -bool mtf::ObservantShell::handle(MirEvent const& event) |
143 | -{ |
144 | - return wrapped->handle(event); |
145 | -} |
146 | - |
147 | -void mtf::ObservantShell::focus_next_session() |
148 | -{ |
149 | - wrapped->focus_next_session(); |
150 | -} |
151 | - |
152 | -auto mtf::ObservantShell::focused_session() const -> std::shared_ptr<msc::Session> |
153 | -{ |
154 | - return wrapped->focused_session(); |
155 | -} |
156 | - |
157 | -void mtf::ObservantShell::set_focus_to( |
158 | - std::shared_ptr<msc::Session> const& focus_session, |
159 | - std::shared_ptr<msc::Surface> const& focus_surface) |
160 | -{ |
161 | - return wrapped->set_focus_to(focus_session, focus_surface); |
162 | -} |
163 | - |
164 | -std::shared_ptr<msc::Surface> mtf::ObservantShell::focused_surface() const |
165 | -{ |
166 | - return wrapped->focused_surface(); |
167 | -} |
168 | - |
169 | -auto mtf::ObservantShell::surface_at(geom::Point cursor) const -> std::shared_ptr<msc::Surface> |
170 | -{ |
171 | - return wrapped->surface_at(cursor); |
172 | -} |
173 | - |
174 | -void mtf::ObservantShell::raise(msh::SurfaceSet const& surfaces) |
175 | -{ |
176 | - wrapped->raise(surfaces); |
177 | -} |
178 | - |
179 | -std::shared_ptr<msc::Session> mtf::ObservantShell::open_session( |
180 | - pid_t client_pid, |
181 | - std::string const& name, |
182 | - std::shared_ptr<mf::EventSink> const& sink) |
183 | -{ |
184 | - return wrapped->open_session(client_pid, name, sink); |
185 | -} |
186 | - |
187 | -void mtf::ObservantShell::close_session(std::shared_ptr<msc::Session> const& session) |
188 | -{ |
189 | - wrapped->close_session(session); |
190 | -} |
191 | - |
192 | -std::shared_ptr<msc::PromptSession> mtf::ObservantShell::start_prompt_session_for( |
193 | - std::shared_ptr<msc::Session> const& session, |
194 | - msc::PromptSessionCreationParameters const& params) |
195 | -{ |
196 | - return wrapped->start_prompt_session_for(session, params); |
197 | -} |
198 | - |
199 | -void mtf::ObservantShell::add_prompt_provider_for( |
200 | - std::shared_ptr<msc::PromptSession> const& prompt_session, |
201 | - std::shared_ptr<msc::Session> const& session) |
202 | -{ |
203 | - wrapped->add_prompt_provider_for(prompt_session, session); |
204 | -} |
205 | - |
206 | -void mtf::ObservantShell::stop_prompt_session(std::shared_ptr<msc::PromptSession> const& prompt_session) |
207 | -{ |
208 | - wrapped->stop_prompt_session(prompt_session); |
209 | -} |
210 | - |
211 | mf::SurfaceId mtf::ObservantShell::create_surface( |
212 | std::shared_ptr<msc::Session> const& session, |
213 | msc::SurfaceCreationParameters const& params, |
214 | std::shared_ptr<mf::EventSink> const& sink) |
215 | { |
216 | - auto id = wrapped->create_surface(session, params, sink); |
217 | + auto id = msh::ShellWrapper::create_surface(session, params, sink); |
218 | auto window = session->surface(id); |
219 | window->add_observer(surface_observer); |
220 | return id; |
221 | } |
222 | - |
223 | -void mtf::ObservantShell::modify_surface( |
224 | - std::shared_ptr<msc::Session> const& session, |
225 | - std::shared_ptr<msc::Surface> const& window, |
226 | - msh::SurfaceSpecification const& modifications) |
227 | -{ |
228 | - wrapped->modify_surface(session, window, modifications); |
229 | -} |
230 | - |
231 | -void mtf::ObservantShell::destroy_surface(std::shared_ptr<msc::Session> const& session, mf::SurfaceId window) |
232 | -{ |
233 | - wrapped->destroy_surface(session, window); |
234 | -} |
235 | - |
236 | -int mtf::ObservantShell::set_surface_attribute( |
237 | - std::shared_ptr<msc::Session> const& session, |
238 | - std::shared_ptr<msc::Surface> const& window, |
239 | - MirWindowAttrib attrib, |
240 | - int value) |
241 | -{ |
242 | - return wrapped->set_surface_attribute(session, window, attrib, value); |
243 | -} |
244 | - |
245 | -int mtf::ObservantShell::get_surface_attribute( |
246 | - std::shared_ptr<msc::Surface> const& window, |
247 | - MirWindowAttrib attrib) |
248 | -{ |
249 | - return wrapped->get_surface_attribute(window, attrib); |
250 | -} |
251 | - |
252 | -void mtf::ObservantShell::raise_surface( |
253 | - std::shared_ptr<msc::Session> const& session, |
254 | - std::shared_ptr<msc::Surface> const& window, |
255 | - uint64_t timestamp) |
256 | -{ |
257 | - return wrapped->raise_surface(session, window, timestamp); |
258 | -} |
259 | - |
260 | -void mtf::ObservantShell::request_drag_and_drop( |
261 | - std::shared_ptr<msc::Session> const& session, |
262 | - std::shared_ptr<msc::Surface> const& window, |
263 | - uint64_t timestamp) |
264 | -{ |
265 | - return wrapped->request_drag_and_drop(session, window, timestamp); |
266 | -} |
267 | - |
268 | -void mtf::ObservantShell::set_drag_and_drop_handle(std::vector<uint8_t> const& handle) |
269 | -{ |
270 | - wrapped->set_drag_and_drop_handle(handle); |
271 | -} |
272 | - |
273 | -void mtf::ObservantShell::clear_drag_and_drop_handle() |
274 | -{ |
275 | - wrapped->clear_drag_and_drop_handle(); |
276 | -} |
277 | - |
PASSED: Continuous integration, rev:4119 /mir-jenkins. ubuntu. com/job/ mir-ci/ 3254/ /mir-jenkins. ubuntu. com/job/ build-mir/ 4382 /mir-jenkins. ubuntu. com/job/ build-0- fetch/4471 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 4461 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 4461 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/4461 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/4414 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= zesty/4414/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4414 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4414/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4414 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= zesty/4414/ artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 4414 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 4414/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 4414 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 4414/artifact/ output/ *zip*/output. zip /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4414 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 4414/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 3254/rebuild
https:/