Status: | Merged |
---|---|
Approved by: | Andreas Pokorny |
Approved revision: | 3641 |
Merged at revision: | 1291 |
Proposed branch: | lp:mir/0.24 |
Merge into: | lp:mir/ubuntu |
Diff against target: |
462 lines (+220/-20) 19 files modified
CMakeLists.txt (+1/-1) debian/changelog (+20/-0) src/client/buffer_factory.cpp (+1/-1) src/client/input/xkb_mapper.cpp (+2/-1) src/client/rpc/mir_protobuf_rpc_channel.cpp (+0/-5) src/common/dispatch/CMakeLists.txt (+1/-0) src/common/dispatch/legacy_readable_fd.cpp (+34/-0) src/common/symbols.map (+9/-0) src/platforms/eglstream-kms/client/client_platform.cpp (+1/-2) src/platforms/eglstream-kms/client/client_platform.h (+1/-4) src/platforms/eglstream-kms/server/platform.cpp (+1/-2) src/platforms/eglstream-kms/server/platform.h (+0/-1) src/server/graphics/nested/display_buffer.cpp (+1/-0) src/server/shell/abstract_shell.cpp (+3/-1) tests/unit-tests/client/input/test_xkb_mapper.cpp (+9/-0) tests/unit-tests/graphics/mesa/test_ipc_operations.cpp (+4/-0) tests/unit-tests/graphics/nested/CMakeLists.txt (+1/-0) tests/unit-tests/graphics/nested/test_nested_display_buffer.cpp (+105/-0) tests/unit-tests/scene/test_abstract_shell.cpp (+26/-2) |
To merge this branch: | bzr merge lp:mir/0.24 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Cemil Azizoglu (community) | Approve | ||
Mir CI Bot | continuous-integration | Approve | |
Daniel van Vugt | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2016-09-27.
Commit message
Mir 0.24.1 release
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mir CI Bot (mir-ci-bot) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel van Vugt (vanvugt) wrote : Posted in a previous version of this proposal | # |
Wrong target branch. You mean lp:mir/ubuntu
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3634
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 3635. By Daniel van Vugt
-
debian/changelog: Fix up version format
Remember we're releasing Mir-for-Ubuntu and not a definitive one
release for all distros.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1609612. And it's non-trivial to backport all the fixes.
- 3636. By Daniel van Vugt
- 3637. By Daniel van Vugt
- 3638. By Daniel van Vugt
-
Mention LP: #1609612 in the changelog
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3635
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1612012 now
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:3638
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel van Vugt (vanvugt) wrote : | # |
^^^
Bug 1612012 and a new one:
[ FAILED ] NestedInput.
Although I won't log that new one because this isn't trunk.
- 3639. By Daniel van Vugt
-
Cherry pick r3656 from lp:mir to fix CI failures (and a potential
crash) (LP: #1612012) - 3640. By Daniel van Vugt
-
Mention LP: #1612012 in the changelog
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3640
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:/
Click here to trigger a rebuild:
https:/
- 3641. By Andreas Pokorny
-
cherry picked bug fix from lp:mir
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:3641
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:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2016-08-09 16:24:17 +0000 |
3 | +++ CMakeLists.txt 2016-09-28 12:03:27 +0000 |
4 | @@ -29,7 +29,7 @@ |
5 | |
6 | set(MIR_VERSION_MAJOR 0) |
7 | set(MIR_VERSION_MINOR 24) |
8 | -set(MIR_VERSION_PATCH 0) |
9 | +set(MIR_VERSION_PATCH 1) |
10 | |
11 | add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR}) |
12 | add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR}) |
13 | |
14 | === modified file 'debian/changelog' |
15 | --- debian/changelog 2016-08-15 16:29:03 +0000 |
16 | +++ debian/changelog 2016-09-28 12:03:27 +0000 |
17 | @@ -1,3 +1,23 @@ |
18 | +mir (0.24.1-0ubuntu1) UNRELEASED; urgency=medium |
19 | + |
20 | + * New upstream release 0.24.1 (https://launchpad.net/mir/+milestone/0.24.1) |
21 | + - ABI summary: |
22 | + . All ABI numbers remain unchanged. |
23 | + . mircommon ABI at 6, but now including a symbol misplaced in 0.24.0 |
24 | + - Bugs fixed: |
25 | + . mirserver ignored further keymap configuration changes after a keyboard |
26 | + is configured (LP: #1626435) |
27 | + . fix for libmircommon.so.6 ABI break: version stanza of |
28 | + mir::dispatch::ReadableFd* moved to newer version (LP: #1617865) |
29 | + . clang builds fail (again) (LP: #1609612) |
30 | + . Valgrind errors in NesterServer.* cause subsequent tests |
31 | + (ServerDisconnect, ServerStartup, UnresponsiveClient) to fail |
32 | + (LP: #1612012) |
33 | + . Break potentially infinite loop in search for next session to focus |
34 | + (LP: #1625401) |
35 | + |
36 | + -- Andreas Pokorny <andreas.pokorny@canonical.com> Tue, 27 Sep 2016 09:50:08 +0200 |
37 | + |
38 | mir (0.24.0+16.10.20160815.3-0ubuntu1) yakkety; urgency=medium |
39 | |
40 | * New upstream release 0.24.0 (https://launchpad.net/mir/+milestone/0.24.0) |
41 | |
42 | === modified file 'src/client/buffer_factory.cpp' |
43 | --- src/client/buffer_factory.cpp 2016-06-24 18:19:58 +0000 |
44 | +++ src/client/buffer_factory.cpp 2016-09-28 12:03:27 +0000 |
45 | @@ -86,7 +86,7 @@ |
46 | } |
47 | |
48 | allocation_requests.erase(request_it); |
49 | - return std::move(b); |
50 | + return b; |
51 | } |
52 | |
53 | void mcl::BufferFactory::cancel_requests_with_context(void* cancelled_context) |
54 | |
55 | === modified file 'src/client/input/xkb_mapper.cpp' |
56 | --- src/client/input/xkb_mapper.cpp 2016-07-14 09:19:49 +0000 |
57 | +++ src/client/input/xkb_mapper.cpp 2016-09-28 12:03:27 +0000 |
58 | @@ -148,10 +148,10 @@ |
59 | auto input_event = mir_event_get_input_event(&ev); |
60 | auto input_type = mir_input_event_get_type(input_event); |
61 | auto device_id = mir_input_event_get_device_id(input_event); |
62 | - auto mapping_state = get_keymapping_state(device_id); |
63 | |
64 | if (input_type == mir_input_event_type_key) |
65 | { |
66 | + auto mapping_state = get_keymapping_state(device_id); |
67 | if (mapping_state && mapping_state->update_and_map(ev)) |
68 | update_modifier(); |
69 | } |
70 | @@ -211,6 +211,7 @@ |
71 | { |
72 | std::lock_guard<std::mutex> lg(guard); |
73 | |
74 | + device_mapping.erase(id); |
75 | device_mapping.emplace(std::piecewise_construct, |
76 | std::forward_as_tuple(id), |
77 | std::forward_as_tuple(std::move(new_keymap))); |
78 | |
79 | === modified file 'src/client/rpc/mir_protobuf_rpc_channel.cpp' |
80 | --- src/client/rpc/mir_protobuf_rpc_channel.cpp 2016-06-24 17:52:00 +0000 |
81 | +++ src/client/rpc/mir_protobuf_rpc_channel.cpp 2016-09-28 12:03:27 +0000 |
82 | @@ -52,11 +52,6 @@ |
83 | namespace md = mir::dispatch; |
84 | namespace mp = mir::protobuf; |
85 | |
86 | -namespace |
87 | -{ |
88 | -std::chrono::milliseconds const timeout(200); |
89 | -} |
90 | - |
91 | mclr::MirProtobufRpcChannel::MirProtobufRpcChannel( |
92 | std::unique_ptr<mclr::StreamTransport> transport, |
93 | std::shared_ptr<mcl::SurfaceMap> const& surface_map, |
94 | |
95 | === modified file 'src/common/dispatch/CMakeLists.txt' |
96 | --- src/common/dispatch/CMakeLists.txt 2016-01-29 08:18:22 +0000 |
97 | +++ src/common/dispatch/CMakeLists.txt 2016-09-28 12:03:27 +0000 |
98 | @@ -19,6 +19,7 @@ |
99 | ${CMAKE_CURRENT_SOURCE_DIR}/action_queue.cpp |
100 | ${CMAKE_CURRENT_SOURCE_DIR}/multiplexing_dispatchable.cpp |
101 | ${CMAKE_CURRENT_SOURCE_DIR}/readable_fd.cpp |
102 | + ${CMAKE_CURRENT_SOURCE_DIR}/legacy_readable_fd.cpp |
103 | ${CMAKE_CURRENT_SOURCE_DIR}/threaded_dispatcher.cpp |
104 | ${CMAKE_CURRENT_SOURCE_DIR}/utils.cpp |
105 | ) |
106 | |
107 | === added file 'src/common/dispatch/legacy_readable_fd.cpp' |
108 | --- src/common/dispatch/legacy_readable_fd.cpp 1970-01-01 00:00:00 +0000 |
109 | +++ src/common/dispatch/legacy_readable_fd.cpp 2016-09-28 12:03:27 +0000 |
110 | @@ -0,0 +1,34 @@ |
111 | +/* |
112 | + * Copyright © 2016 Canonical Ltd. |
113 | + * |
114 | + * This program is free software: you can redistribute it and/or modify it |
115 | + * under the terms of the GNU Lesser General Public License version 3, |
116 | + * as published by the Free Software Foundation. |
117 | + * |
118 | + * This program is distributed in the hope that it will be useful, |
119 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
120 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
121 | + * GNU Lesser General Public License for more details. |
122 | + * |
123 | + * You should have received a copy of the GNU Lesser General Public License |
124 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
125 | + * |
126 | + * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com> |
127 | + * |
128 | + * TODO: Remove this file at the next mircommon ABI break. |
129 | + */ |
130 | + |
131 | +#define ReadableFd LegacyReadableFd |
132 | + |
133 | +#include "mir/dispatch/readable_fd.h" |
134 | + |
135 | +__asm__(".symver _ZN3mir8dispatch16LegacyReadableFd8dispatchEj,_ZN3mir8dispatch10ReadableFd8dispatchEj@MIR_COMMON_5.1"); |
136 | +__asm__(".symver _ZN3mir8dispatch16LegacyReadableFdC1ENS_2FdERKSt8functionIFvvEE,_ZN3mir8dispatch10ReadableFdC1ENS_2FdERKSt8functionIFvvEE@MIR_COMMON_5.1"); |
137 | +__asm__(".symver _ZN3mir8dispatch16LegacyReadableFdC2ENS_2FdERKSt8functionIFvvEE,_ZN3mir8dispatch10ReadableFdC2ENS_2FdERKSt8functionIFvvEE@MIR_COMMON_5.1"); |
138 | +__asm__(".symver _ZN3mir8dispatch16LegacyReadableFdD0Ev,_ZN3mir8dispatch10ReadableFdD0Ev@MIR_COMMON_5.1"); |
139 | +__asm__(".symver _ZN3mir8dispatch16LegacyReadableFdD1Ev,_ZN3mir8dispatch10ReadableFdD1Ev@MIR_COMMON_5.1"); |
140 | +__asm__(".symver _ZN3mir8dispatch16LegacyReadableFdD2Ev,_ZN3mir8dispatch10ReadableFdD2Ev@MIR_COMMON_5.1"); |
141 | +__asm__(".symver _ZNK3mir8dispatch16LegacyReadableFd8watch_fdEv,_ZNK3mir8dispatch10ReadableFd8watch_fdEv@MIR_COMMON_5.1"); |
142 | +__asm__(".symver _ZNK3mir8dispatch16LegacyReadableFd15relevant_eventsEv,_ZNK3mir8dispatch10ReadableFd15relevant_eventsEv@MIR_COMMON_5.1"); |
143 | + |
144 | +#include "./readable_fd.cpp" |
145 | |
146 | === modified file 'src/common/symbols.map' |
147 | --- src/common/symbols.map 2016-07-20 12:09:17 +0000 |
148 | +++ src/common/symbols.map 2016-09-28 12:03:27 +0000 |
149 | @@ -382,7 +382,16 @@ |
150 | android::MotionEvent::initialize*; |
151 | mir::dispatch::epoll_to_fd_event*; |
152 | mir::dispatch::fd_event_to_epoll*; |
153 | + |
154 | + # |
155 | + # This entry is a bug LP: #1617865 which now overrides the other entries |
156 | + # for ReadableFd in MIR_COMMON_5.1 above. But rather than remove it and |
157 | + # break the ABI again we have re-exported the old MIR_COMMON_5.1 |
158 | + # symbols using assembler directives in: |
159 | + # src/common/dispatch/legacy_readable_fd.cpp |
160 | + # |
161 | mir::dispatch::ReadableFd*; |
162 | + |
163 | vtable?for?mir::dispatch::ReadableFd; |
164 | }; |
165 | } MIR_COMMON_0.22; |
166 | |
167 | === modified file 'src/platforms/eglstream-kms/client/client_platform.cpp' |
168 | --- src/platforms/eglstream-kms/client/client_platform.cpp 2016-05-31 01:21:42 +0000 |
169 | +++ src/platforms/eglstream-kms/client/client_platform.cpp 2016-09-28 12:03:27 +0000 |
170 | @@ -29,8 +29,7 @@ |
171 | namespace mcle=mir::client::eglstream; |
172 | namespace geom=mir::geometry; |
173 | |
174 | -mcle::ClientPlatform::ClientPlatform(ClientContext* const context) |
175 | - : context{context} |
176 | +mcle::ClientPlatform::ClientPlatform(ClientContext* const) |
177 | { |
178 | } |
179 | |
180 | |
181 | === modified file 'src/platforms/eglstream-kms/client/client_platform.h' |
182 | --- src/platforms/eglstream-kms/client/client_platform.h 2016-05-31 01:21:42 +0000 |
183 | +++ src/platforms/eglstream-kms/client/client_platform.h 2016-09-28 12:03:27 +0000 |
184 | @@ -30,7 +30,7 @@ |
185 | class ClientPlatform : public client::ClientPlatform |
186 | { |
187 | public: |
188 | - ClientPlatform(ClientContext* const context); |
189 | + ClientPlatform(ClientContext* const); |
190 | |
191 | MirPlatformType platform_type() const override; |
192 | void populate(MirPlatformPackage& package) const override; |
193 | @@ -40,9 +40,6 @@ |
194 | std::shared_ptr<EGLNativeDisplayType> create_egl_native_display() override; |
195 | MirNativeBuffer* convert_native_buffer(graphics::NativeBuffer*) const override; |
196 | MirPixelFormat get_egl_pixel_format(EGLDisplay, EGLConfig) const override; |
197 | - |
198 | -private: |
199 | - ClientContext* const context; |
200 | }; |
201 | |
202 | } |
203 | |
204 | === modified file 'src/platforms/eglstream-kms/server/platform.cpp' |
205 | --- src/platforms/eglstream-kms/server/platform.cpp 2016-07-20 04:54:07 +0000 |
206 | +++ src/platforms/eglstream-kms/server/platform.cpp 2016-09-28 12:03:27 +0000 |
207 | @@ -55,8 +55,7 @@ |
208 | EGLDeviceEXT device, |
209 | std::shared_ptr<EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, |
210 | std::shared_ptr<DisplayReport> const& /*report*/) |
211 | - : device{device}, |
212 | - display{EGL_NO_DISPLAY}, |
213 | + : display{EGL_NO_DISPLAY}, |
214 | drm_node{open(drm_node_for_device(device), O_RDWR | O_CLOEXEC)} |
215 | { |
216 | using namespace std::literals; |
217 | |
218 | === modified file 'src/platforms/eglstream-kms/server/platform.h' |
219 | --- src/platforms/eglstream-kms/server/platform.h 2016-07-20 04:54:07 +0000 |
220 | +++ src/platforms/eglstream-kms/server/platform.h 2016-09-28 12:03:27 +0000 |
221 | @@ -53,7 +53,6 @@ |
222 | UniqueModulePtr<PlatformIpcOperations> make_ipc_operations() const override; |
223 | |
224 | private: |
225 | - EGLDeviceEXT device; |
226 | EGLDisplay display; |
227 | mir::Fd const drm_node; |
228 | }; |
229 | |
230 | === modified file 'src/server/graphics/nested/display_buffer.cpp' |
231 | --- src/server/graphics/nested/display_buffer.cpp 2016-06-10 13:50:29 +0000 |
232 | +++ src/server/graphics/nested/display_buffer.cpp 2016-09-28 12:03:27 +0000 |
233 | @@ -93,6 +93,7 @@ |
234 | |
235 | mgn::detail::DisplayBuffer::~DisplayBuffer() noexcept |
236 | { |
237 | + host_surface->set_event_handler(nullptr, nullptr); |
238 | } |
239 | |
240 | void mgn::detail::DisplayBuffer::event_thunk( |
241 | |
242 | === modified file 'src/server/shell/abstract_shell.cpp' |
243 | --- src/server/shell/abstract_shell.cpp 2016-07-01 20:32:34 +0000 |
244 | +++ src/server/shell/abstract_shell.cpp 2016-09-28 12:03:27 +0000 |
245 | @@ -193,12 +193,14 @@ |
246 | std::unique_lock<std::mutex> lock(focus_mutex); |
247 | auto const focused_session = focus_session.lock(); |
248 | auto successor = session_coordinator->successor_of(focused_session); |
249 | + auto const sentinel = successor; |
250 | |
251 | while (successor != nullptr && |
252 | - successor != focused_session && |
253 | successor->default_surface() == nullptr) |
254 | { |
255 | successor = session_coordinator->successor_of(successor); |
256 | + if (successor == sentinel) |
257 | + break; |
258 | } |
259 | |
260 | auto const surface = successor ? successor->default_surface() : nullptr; |
261 | |
262 | === modified file 'tests/unit-tests/client/input/test_xkb_mapper.cpp' |
263 | --- tests/unit-tests/client/input/test_xkb_mapper.cpp 2016-07-14 09:18:37 +0000 |
264 | +++ tests/unit-tests/client/input/test_xkb_mapper.cpp 2016-09-28 12:03:27 +0000 |
265 | @@ -325,3 +325,12 @@ |
266 | map_event(keyboard_cz, mir_keyboard_action_up, KEY_CAPSLOCK); |
267 | map_event(keyboard_cz, mir_keyboard_action_down, KEY_2); |
268 | } |
269 | + |
270 | +TEST_F(XKBMapper, setting_keymap_again_overwrites_keymap) |
271 | +{ |
272 | + auto keyboard = MirInputDeviceId{3}; |
273 | + mapper.set_keymap_for_device(keyboard, mi::Keymap{"pc105", "us", "",""}); |
274 | + EXPECT_EQ(XKB_KEY_y, map_key(keyboard, mir_keyboard_action_down, KEY_Y)); |
275 | + mapper.set_keymap_for_device(keyboard, mi::Keymap{"pc105", "de", "",""}); |
276 | + EXPECT_EQ(XKB_KEY_y, map_key(keyboard, mir_keyboard_action_down, KEY_Z)); |
277 | +} |
278 | |
279 | === modified file 'tests/unit-tests/graphics/mesa/test_ipc_operations.cpp' |
280 | --- tests/unit-tests/graphics/mesa/test_ipc_operations.cpp 2016-05-06 01:56:46 +0000 |
281 | +++ tests/unit-tests/graphics/mesa/test_ipc_operations.cpp 2016-09-28 12:03:27 +0000 |
282 | @@ -84,7 +84,11 @@ |
283 | EXPECT_CALL(mock_buffer_msg, pack_fd(mtd::RawFdMatcher(native_handle.fd[i]))); |
284 | for(auto i = 0; i < native_handle.data_items; i++) |
285 | EXPECT_CALL(mock_buffer_msg, pack_data(native_handle.data[i])); |
286 | +#ifndef __clang__ |
287 | + // FIXME: Why can't clang compile this on yakkety (with the |
288 | + // gcc6 headers)? (LP: #1609612) |
289 | EXPECT_CALL(mock_buffer_msg, pack_stride(dummy_stride)); |
290 | +#endif |
291 | EXPECT_CALL(mock_buffer_msg, pack_flags(testing::_)); |
292 | EXPECT_CALL(mock_buffer_msg, pack_size(dummy_size)); |
293 | |
294 | |
295 | === modified file 'tests/unit-tests/graphics/nested/CMakeLists.txt' |
296 | --- tests/unit-tests/graphics/nested/CMakeLists.txt 2015-06-17 05:20:42 +0000 |
297 | +++ tests/unit-tests/graphics/nested/CMakeLists.txt 2016-09-28 12:03:27 +0000 |
298 | @@ -1,6 +1,7 @@ |
299 | list(APPEND UNIT_TEST_SOURCES |
300 | ${CMAKE_CURRENT_SOURCE_DIR}/test_nested_display_configuration.cpp |
301 | ${CMAKE_CURRENT_SOURCE_DIR}/test_nested_display.cpp |
302 | + ${CMAKE_CURRENT_SOURCE_DIR}/test_nested_display_buffer.cpp |
303 | ${CMAKE_CURRENT_SOURCE_DIR}/mir_display_configuration_builder.cpp |
304 | ${CMAKE_CURRENT_SOURCE_DIR}/test_nested_cursor.cpp |
305 | ) |
306 | |
307 | === added file 'tests/unit-tests/graphics/nested/test_nested_display_buffer.cpp' |
308 | --- tests/unit-tests/graphics/nested/test_nested_display_buffer.cpp 1970-01-01 00:00:00 +0000 |
309 | +++ tests/unit-tests/graphics/nested/test_nested_display_buffer.cpp 2016-09-28 12:03:27 +0000 |
310 | @@ -0,0 +1,105 @@ |
311 | +/* |
312 | + * Copyright © 2016 Canonical Ltd. |
313 | + * |
314 | + * This program is free software: you can redistribute it and/or modify |
315 | + * it under the terms of the GNU General Public License version 3 as |
316 | + * published by the Free Software Foundation. |
317 | + * |
318 | + * This program is distributed in the hope that it will be useful, |
319 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
320 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
321 | + * GNU General Public License for more details. |
322 | + * |
323 | + * You should have received a copy of the GNU General Public License |
324 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
325 | + * |
326 | + * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com> |
327 | + */ |
328 | + |
329 | +#include "src/server/graphics/nested/display_buffer.h" |
330 | + |
331 | +#include "mir/events/event_builders.h" |
332 | + |
333 | +#include "mir/test/doubles/mock_egl.h" |
334 | +#include "mir/test/doubles/stub_gl_config.h" |
335 | +#include "mir/test/doubles/stub_host_connection.h" |
336 | +#include "mir/test/fake_shared.h" |
337 | + |
338 | +#include <gtest/gtest.h> |
339 | +#include <gmock/gmock.h> |
340 | + |
341 | +namespace mgn = mir::graphics::nested; |
342 | +namespace mgnd = mgn::detail; |
343 | +namespace mt = mir::test; |
344 | +namespace mtd = mir::test::doubles; |
345 | + |
346 | +namespace |
347 | +{ |
348 | + |
349 | +class EventHostSurface : public mgn::HostSurface |
350 | +{ |
351 | +public: |
352 | + EGLNativeWindowType egl_native_window() override { return {}; } |
353 | + |
354 | + void set_event_handler(mir_surface_event_callback cb, void* ctx) override |
355 | + { |
356 | + std::lock_guard<std::mutex> lock{event_mutex}; |
357 | + event_handler = cb; |
358 | + event_context = ctx; |
359 | + } |
360 | + |
361 | + void emit_input_event() |
362 | + { |
363 | + auto const ev = mir::events::make_event( |
364 | + MirInputDeviceId(), {}, std::vector<uint8_t>{}, |
365 | + MirKeyboardAction(), 0, 0, MirInputEventModifiers()); |
366 | + |
367 | + std::lock_guard<std::mutex> lock{event_mutex}; |
368 | + // Normally we shouldn't call external code under lock, but, for our |
369 | + // test use case, doing so is safe and simplifies the test code. |
370 | + if (event_handler) |
371 | + event_handler(nullptr, ev.get(), event_context); |
372 | + } |
373 | + |
374 | +private: |
375 | + std::mutex event_mutex; |
376 | + mir_surface_event_callback event_handler; |
377 | + void* event_context; |
378 | +}; |
379 | + |
380 | +struct NestedDisplayBuffer : testing::Test |
381 | +{ |
382 | + auto create_display_buffer() |
383 | + { |
384 | + return std::make_shared<mgnd::DisplayBuffer>( |
385 | + egl_display, |
386 | + mt::fake_shared(host_surface), |
387 | + mir::geometry::Rectangle{}, |
388 | + MirPixelFormat{}, |
389 | + std::make_shared<mtd::StubHostConnection>() |
390 | + ); |
391 | + } |
392 | + |
393 | + testing::NiceMock<mtd::MockEGL> mock_egl; |
394 | + mgnd::EGLDisplayHandle egl_display{nullptr, std::make_shared<mtd::StubGLConfig>()}; |
395 | + EventHostSurface host_surface; |
396 | +}; |
397 | + |
398 | +} |
399 | + |
400 | +// Regression test for LP: #1612012 |
401 | +// This test is trying to reproduce a race, so it's not deterministic, but |
402 | +// in practice the reproduction rate is very close to 100%. |
403 | +TEST_F(NestedDisplayBuffer, event_dispatch_does_not_race_with_destruction) |
404 | +{ |
405 | + auto display_buffer = create_display_buffer(); |
406 | + std::thread t{ |
407 | + [&] |
408 | + { |
409 | + for (int i = 0; i < 100; ++i) |
410 | + host_surface.emit_input_event(); |
411 | + }}; |
412 | + |
413 | + display_buffer.reset(); |
414 | + t.join(); |
415 | +} |
416 | |
417 | === modified file 'tests/unit-tests/scene/test_abstract_shell.cpp' |
418 | --- tests/unit-tests/scene/test_abstract_shell.cpp 2016-07-01 20:32:34 +0000 |
419 | +++ tests/unit-tests/scene/test_abstract_shell.cpp 2016-09-28 12:03:27 +0000 |
420 | @@ -544,9 +544,9 @@ |
421 | session->destroy_surface(surface_id); |
422 | |
423 | EXPECT_CALL(session_container, successor_of(session)). |
424 | - WillOnce(Return(session1)); |
425 | + WillRepeatedly(Return(session1)); |
426 | EXPECT_CALL(session_container, successor_of(session1)). |
427 | - WillOnce(Return(session)); |
428 | + WillRepeatedly(Return(session)); |
429 | |
430 | EXPECT_CALL(session_event_sink, handle_no_focus()); |
431 | |
432 | @@ -589,6 +589,30 @@ |
433 | shell.modify_surface(session, surface, stream_modification); |
434 | } |
435 | |
436 | +// lp:1625401 |
437 | +TEST_F(AbstractShell, when_remaining_session_has_no_surface_focus_next_session_doesnt_loop_endlessly) |
438 | +{ |
439 | + std::shared_ptr<ms::Session> empty_session = |
440 | + shell.open_session(__LINE__, "empty_session", std::shared_ptr<mf::EventSink>()); |
441 | + |
442 | + { |
443 | + std::shared_ptr<ms::Session> another_session = |
444 | + shell.open_session(__LINE__, "another_session", std::shared_ptr<mf::EventSink>()); |
445 | + |
446 | + auto creation_params = ms::a_surface() |
447 | + .with_buffer_stream(another_session->create_buffer_stream(properties)); |
448 | + auto surface_id = shell.create_surface(another_session, creation_params, nullptr); |
449 | + |
450 | + shell.set_focus_to(another_session, another_session->surface(surface_id)); |
451 | + |
452 | + shell.close_session(another_session); |
453 | + } |
454 | + |
455 | + ON_CALL(session_container, successor_of(_)).WillByDefault(Return(empty_session)); |
456 | + |
457 | + shell.focus_next_session(); |
458 | +} |
459 | + |
460 | namespace mir |
461 | { |
462 | namespace scene |
FAILED: Continuous integration, rev:3634 /mir-jenkins. ubuntu. com/job/ mir-ci/ 1821/ /mir-jenkins. ubuntu. com/job/ build-mir/ 2284/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/2347/ console /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 2338/console /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial+ overlay/ 2338/console /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= yakkety/ 2338/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= yakkety/ 2311/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2311/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= yakkety/ 2311/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 2311/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial+ overlay/ 2311/console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 1821/rebuild
https:/