Merge lp:~aacid/qtmir/system_includes into lp:qtmir
- system_includes
- Merge into trunk
Proposed by
Albert Astals Cid
Status: | Superseded |
---|---|
Proposed branch: | lp:~aacid/qtmir/system_includes |
Merge into: | lp:qtmir |
Diff against target: |
1237 lines (+304/-75) 36 files modified
CMakeLists.txt (+12/-7) debian/changelog (+25/-0) debian/control (+1/-1) demos/qml-demo-client/CMakeLists.txt (+3/-6) demos/qml-demo-shell/CMakeLists.txt (+3/-6) src/common/debughelpers.cpp (+1/-0) src/modules/Unity/Application/CMakeLists.txt (+6/-2) src/modules/Unity/Application/application.cpp (+16/-12) src/modules/Unity/Application/application.h (+5/-4) src/modules/Unity/Application/mirsurfacelistmodel.cpp (+30/-4) src/modules/Unity/Application/mirsurfacelistmodel.h (+3/-0) src/modules/Unity/Application/session.cpp (+21/-22) src/modules/Unity/Application/sessionmanager.h (+0/-1) src/modules/Unity/Application/ubuntukeyboardinfo.cpp (+2/-0) src/modules/Unity/Application/upstart/taskcontroller.cpp (+2/-2) src/modules/Unity/Screens/CMakeLists.txt (+4/-0) src/platforms/mirserver/CMakeLists.txt (+5/-0) src/platforms/mirserver/mirwindowmanager.cpp (+1/-1) tests/framework/CMakeLists.txt (+5/-1) tests/framework/mock_mir_session.cpp (+1/-0) tests/mirserver/Clipboard/CMakeLists.txt (+4/-0) tests/mirserver/QtEventFeeder/CMakeLists.txt (+4/-0) tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h (+12/-1) tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp (+2/-2) tests/mirserver/Screen/CMakeLists.txt (+4/-0) tests/mirserver/ScreensModel/CMakeLists.txt (+4/-0) tests/mirserver/ScreensModel/screensmodel_test.cpp (+1/-0) tests/mirserver/WindowManager/CMakeLists.txt (+4/-0) tests/modules/Application/CMakeLists.txt (+4/-1) tests/modules/Application/application_test.cpp (+32/-0) tests/modules/ApplicationManager/CMakeLists.txt (+5/-1) tests/modules/ApplicationManager/application_manager_test.cpp (+64/-0) tests/modules/SessionManager/CMakeLists.txt (+5/-1) tests/modules/SessionManager/session_test.cpp (+5/-0) tests/modules/SharedWakelock/CMakeLists.txt (+4/-0) tests/modules/SurfaceManager/CMakeLists.txt (+4/-0) |
To merge this branch: | bzr merge lp:~aacid/qtmir/system_includes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir development team | Pending | ||
Review via email: mp+296597@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-06-06.
Commit message
Mark system includes as such
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
Prereq
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
To post a comment you must log in.
lp:~aacid/qtmir/system_includes
updated
- 519. By Albert Astals Cid
-
spacing++
- 520. By Albert Astals Cid
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2016-05-18 20:56:14 +0000 |
3 | +++ CMakeLists.txt 2016-06-06 19:37:34 +0000 |
4 | @@ -13,6 +13,13 @@ |
5 | # Find includes in corresponding build directories |
6 | set(CMAKE_INCLUDE_CURRENT_DIR ON) |
7 | |
8 | +find_package (ECM 1.7.0 QUIET NO_MODULE) |
9 | +if (ECM_FOUND) |
10 | + # Provides us with -DECM_ENABLE_SANITIZERS='X' |
11 | + # Where X can be address, thread, memory, leak, undefined |
12 | + include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake") |
13 | +endif() |
14 | + |
15 | # add custom cmake modules |
16 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) |
17 | |
18 | @@ -76,23 +83,21 @@ |
19 | pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt) |
20 | pkg_check_modules(QTDBUSTEST libqtdbustest-1 REQUIRED) |
21 | pkg_check_modules(QTDBUSMOCK libqtdbusmock-1 REQUIRED) |
22 | -pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=17) |
23 | +pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=18) |
24 | |
25 | -include_directories(${APPLICATION_API_INCLUDE_DIRS}) |
26 | +include_directories(SYSTEM ${APPLICATION_API_INCLUDE_DIRS}) |
27 | |
28 | add_definitions(-DMIR_REQUIRE_DEPRECATED_EVENT_OPT_IN=1) |
29 | |
30 | # Use the fast string builder |
31 | add_definitions(-DQT_USE_QSTRINGBUILDER) |
32 | |
33 | -include_directories( ${APPLICATION_API_INCLUDE_DIRS} ) |
34 | - |
35 | # We expect this to be set via debian/rules for GLES builds |
36 | if ("${USE_OPENGLES}" STREQUAL 1) |
37 | message(STATUS "Qt5 determined to be compiled with GLES support") |
38 | pkg_check_modules(GLESv2 glesv2) |
39 | add_definitions(-DQT_USING_GLES) |
40 | - include_directories (${GLESv2_INCLUDE_DIRS}) |
41 | + include_directories (SYSTEM ${GLESv2_INCLUDE_DIRS}) |
42 | set (GL_LIBRARIES "${GLESv2_LIBRARIES}") |
43 | # Because qt/gl and qt/gles are not parallel installable we have a difficulty |
44 | # building qtmir-desktop on armhf. We would like to link against opengl and bind the |
45 | @@ -103,13 +108,13 @@ |
46 | message(STATUS "Linking against OpenGL ES but binding OpenGL API") |
47 | pkg_check_modules(GLESv2 glesv2) |
48 | add_definitions(-DQT_USING_GL) |
49 | - include_directories (${GLESv2_INCLUDE_DIRS}) |
50 | + include_directories (SYSTEM ${GLESv2_INCLUDE_DIRS}) |
51 | set (GL_LIBRARIES "${GLESv2_LIBRARIES}") |
52 | else() |
53 | message(STATUS "Qt5 determined to be compiled with OpenGL support") |
54 | pkg_check_modules(GL gl) |
55 | add_definitions(-DQT_USING_OPENGL) |
56 | - include_directories (${GL_INCLUDE_DIRS}) |
57 | + include_directories (SYSTEM ${GL_INCLUDE_DIRS}) |
58 | endif() |
59 | |
60 | # Standard install paths |
61 | |
62 | === modified file 'debian/changelog' |
63 | --- debian/changelog 2016-05-25 13:54:56 +0000 |
64 | +++ debian/changelog 2016-06-06 19:37:34 +0000 |
65 | @@ -1,3 +1,28 @@ |
66 | +qtmir (0.4.8+16.10.20160606.1-0ubuntu1) yakkety; urgency=medium |
67 | + |
68 | + [ Albert Astals Cid ] |
69 | + * Add support for compiler sanitizers via ECM |
70 | + * Compile with -fsanitize=undefined |
71 | + * Fix leak in ScreensModelTest (LP: #1585502) |
72 | + * Fix leak in SessionManager test (LP: #1585498) |
73 | + * Remove unused m_sessions member |
74 | + * Add missing breaks |
75 | + * Initialize m_lastX and m_lastY |
76 | + * Initialize m_sessionId |
77 | + * Give the locker a name |
78 | + * Fix memory leak in QtEventFeederTest (LP: #1585503) |
79 | + * Fix leaks in application_manager_test (LP: #1585501) |
80 | + |
81 | + [ Daniel d'Andrada ] |
82 | + * Improve Session debug logging |
83 | + * MirSurfaceListModel: prepending a surface always causes |
84 | + firstChanged() emission |
85 | + |
86 | + [ Michael Zanetti ] |
87 | + * Adding ApplicationInfo::surfaceCount property |
88 | + |
89 | + -- MichaĆ Sawicz <michal.sawicz@canonical.com> Mon, 06 Jun 2016 15:45:57 +0000 |
90 | + |
91 | qtmir (0.4.8+16.10.20160525.2-0ubuntu1) yakkety; urgency=medium |
92 | |
93 | [ Alan Griffiths ] |
94 | |
95 | === modified file 'debian/control' |
96 | --- debian/control 2016-05-18 20:56:14 +0000 |
97 | +++ debian/control 2016-06-06 19:37:34 +0000 |
98 | @@ -22,7 +22,7 @@ |
99 | libubuntu-app-launch2-dev (>= 0.9), |
100 | libubuntu-application-api-dev (>= 2.1.0), |
101 | libudev-dev, |
102 | - libunity-api-dev (>= 7.113), |
103 | + libunity-api-dev (>= 7.114), |
104 | liburl-dispatcher1-dev, |
105 | libxkbcommon-dev, |
106 | libxrender-dev, |
107 | |
108 | === modified file 'demos/qml-demo-client/CMakeLists.txt' |
109 | --- demos/qml-demo-client/CMakeLists.txt 2015-09-01 16:16:47 +0000 |
110 | +++ demos/qml-demo-client/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
111 | @@ -2,19 +2,16 @@ |
112 | configure_file(${DEMO_CLIENT}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${DEMO_CLIENT}.desktop @ONLY) |
113 | |
114 | include_directories( |
115 | + SYSTEM |
116 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
117 | + ${Qt5Qml_PRIVATE_INCLUDE_DIRS} |
118 | + ${Qt5Quick_PRIVATE_INCLUDE_DIRS} |
119 | ) |
120 | |
121 | add_executable(${DEMO_CLIENT} |
122 | main.cpp |
123 | ) |
124 | |
125 | -include_directories( |
126 | - ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
127 | - ${Qt5Qml_PRIVATE_INCLUDE_DIRS} |
128 | - ${Qt5Quick_PRIVATE_INCLUDE_DIRS} |
129 | -) |
130 | - |
131 | target_link_libraries( |
132 | ${DEMO_CLIENT} |
133 | Qt5::Core |
134 | |
135 | === modified file 'demos/qml-demo-shell/CMakeLists.txt' |
136 | --- demos/qml-demo-shell/CMakeLists.txt 2015-09-01 16:16:47 +0000 |
137 | +++ demos/qml-demo-shell/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
138 | @@ -1,19 +1,16 @@ |
139 | set(DEMO_SHELL qtmir-demo-shell) |
140 | |
141 | include_directories( |
142 | + SYSTEM |
143 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
144 | + ${Qt5Qml_PRIVATE_INCLUDE_DIRS} |
145 | + ${Qt5Quick_PRIVATE_INCLUDE_DIRS} |
146 | ) |
147 | |
148 | add_executable(${DEMO_SHELL} |
149 | main.cpp |
150 | ) |
151 | |
152 | -include_directories( |
153 | - ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
154 | - ${Qt5Qml_PRIVATE_INCLUDE_DIRS} |
155 | - ${Qt5Quick_PRIVATE_INCLUDE_DIRS} |
156 | -) |
157 | - |
158 | target_link_libraries( |
159 | ${DEMO_SHELL} |
160 | Qt5::Core |
161 | |
162 | === modified file 'src/common/debughelpers.cpp' |
163 | --- src/common/debughelpers.cpp 2015-11-10 11:07:23 +0000 |
164 | +++ src/common/debughelpers.cpp 2016-06-06 19:37:34 +0000 |
165 | @@ -54,6 +54,7 @@ |
166 | break; |
167 | case QEvent::TouchCancel: |
168 | message.append("TouchCancel "); |
169 | + break; |
170 | default: |
171 | message.append("TouchUNKNOWN "); |
172 | } |
173 | |
174 | === modified file 'src/modules/Unity/Application/CMakeLists.txt' |
175 | --- src/modules/Unity/Application/CMakeLists.txt 2016-04-26 08:56:36 +0000 |
176 | +++ src/modules/Unity/Application/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
177 | @@ -1,4 +1,10 @@ |
178 | include_directories( |
179 | + ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
180 | + ${CMAKE_SOURCE_DIR}/src/common |
181 | +) |
182 | + |
183 | +include_directories( |
184 | + SYSTEM |
185 | ${GLIB_INCLUDE_DIRS} |
186 | ${GIO_INCLUDE_DIRS} |
187 | ${GIO_UNIX_INCLUDE_DIRS} |
188 | @@ -7,8 +13,6 @@ |
189 | ${PROCESS_CPP_INCLUDE_DIRS} |
190 | ${UBUNTU_PLATFORM_API_INCLUDE_DIRS} |
191 | ${UBUNTU_APP_LAUNCH_INCLUDE_DIRS} |
192 | - ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
193 | - ${CMAKE_SOURCE_DIR}/src/common |
194 | ${GSETTINGS_QT_INCLUDE_DIRS} |
195 | |
196 | ${LTTNG_INCLUDE_DIRS} |
197 | |
198 | === modified file 'src/modules/Unity/Application/application.cpp' |
199 | --- src/modules/Unity/Application/application.cpp 2016-05-25 13:54:52 +0000 |
200 | +++ src/modules/Unity/Application/application.cpp 2016-06-06 19:37:34 +0000 |
201 | @@ -55,6 +55,8 @@ |
202 | , m_processState(ProcessUnknown) |
203 | , m_stopTimer(nullptr) |
204 | , m_exemptFromLifecycle(false) |
205 | + , m_proxySurfaceList(new ProxySurfaceListModel(this)) |
206 | + , m_proxyPromptSurfaceList(new ProxySurfaceListModel(this)) |
207 | { |
208 | DEBUG_MSG << "()"; |
209 | |
210 | @@ -66,6 +68,8 @@ |
211 | m_rotatesWindowContents = m_appInfo->rotatesWindowContents(); |
212 | |
213 | setStopTimer(new Timer); |
214 | + |
215 | + connect(m_proxySurfaceList, &unityapp::MirSurfaceListInterface::countChanged, this, &unityapp::ApplicationInfoInterface::surfaceCountChanged); |
216 | } |
217 | |
218 | Application::~Application() |
219 | @@ -411,8 +415,8 @@ |
220 | bool Application::focused() const |
221 | { |
222 | bool someSurfaceHasFocus = false; // to be proven wrong |
223 | - for (int i = 0; i < m_proxySurfaceList.rowCount() && !someSurfaceHasFocus; ++i) { |
224 | - someSurfaceHasFocus |= m_proxySurfaceList.get(i)->focused(); |
225 | + for (int i = 0; i < m_proxySurfaceList->rowCount() && !someSurfaceHasFocus; ++i) { |
226 | + someSurfaceHasFocus |= m_proxySurfaceList->get(i)->focused(); |
227 | } |
228 | return someSurfaceHasFocus; |
229 | } |
230 | @@ -475,8 +479,8 @@ |
231 | return; |
232 | |
233 | if (m_session) { |
234 | - m_proxySurfaceList.setSourceList(nullptr); |
235 | - m_proxyPromptSurfaceList.setSourceList(nullptr); |
236 | + m_proxySurfaceList->setSourceList(nullptr); |
237 | + m_proxyPromptSurfaceList->setSourceList(nullptr); |
238 | m_session->disconnect(this); |
239 | m_session->surfaceList()->disconnect(this); |
240 | m_session->setApplication(nullptr); |
241 | @@ -517,8 +521,8 @@ |
242 | if (oldFullscreen != fullscreen()) |
243 | Q_EMIT fullscreenChanged(fullscreen()); |
244 | |
245 | - m_proxySurfaceList.setSourceList(m_session->surfaceList()); |
246 | - m_proxyPromptSurfaceList.setSourceList(m_session->promptSurfaceList()); |
247 | + m_proxySurfaceList->setSourceList(m_session->surfaceList()); |
248 | + m_proxyPromptSurfaceList->setSourceList(m_session->promptSurfaceList()); |
249 | } else { |
250 | // this can only happen after the session has stopped |
251 | Q_ASSERT(m_state == InternalState::Stopped || m_state == InternalState::StoppedResumable |
252 | @@ -852,21 +856,21 @@ |
253 | } |
254 | } |
255 | |
256 | -unityapp::MirSurfaceListInterface* Application::surfaceList() |
257 | +unityapp::MirSurfaceListInterface* Application::surfaceList() const |
258 | { |
259 | - return &m_proxySurfaceList; |
260 | + return m_proxySurfaceList; |
261 | } |
262 | |
263 | -unityapp::MirSurfaceListInterface* Application::promptSurfaceList() |
264 | +unityapp::MirSurfaceListInterface* Application::promptSurfaceList() const |
265 | { |
266 | - return &m_proxyPromptSurfaceList; |
267 | + return m_proxyPromptSurfaceList; |
268 | } |
269 | |
270 | void Application::requestFocus() |
271 | { |
272 | - if (m_proxySurfaceList.rowCount() > 0) { |
273 | + if (m_proxySurfaceList->rowCount() > 0) { |
274 | DEBUG_MSG << "() - Requesting focus for most recent app surface"; |
275 | - m_proxySurfaceList.get(0)->requestFocus(); |
276 | + m_proxySurfaceList->get(0)->requestFocus(); |
277 | } else { |
278 | DEBUG_MSG << "() - emitting focusRequested()"; |
279 | Q_EMIT focusRequested(); |
280 | |
281 | === modified file 'src/modules/Unity/Application/application.h' |
282 | --- src/modules/Unity/Application/application.h 2016-05-20 08:41:17 +0000 |
283 | +++ src/modules/Unity/Application/application.h 2016-06-06 19:37:34 +0000 |
284 | @@ -108,8 +108,9 @@ |
285 | void setExemptFromLifecycle(bool) override; |
286 | QSize initialSurfaceSize() const override; |
287 | void setInitialSurfaceSize(const QSize &size) override; |
288 | - unity::shell::application::MirSurfaceListInterface* surfaceList() override; |
289 | - unity::shell::application::MirSurfaceListInterface* promptSurfaceList() override; |
290 | + unity::shell::application::MirSurfaceListInterface* surfaceList() const override; |
291 | + unity::shell::application::MirSurfaceListInterface* promptSurfaceList() const override; |
292 | + int surfaceCount() const override { return surfaceList()->count(); } |
293 | |
294 | ProcessState processState() const { return m_processState; } |
295 | void setProcessState(ProcessState value); |
296 | @@ -190,8 +191,8 @@ |
297 | QSize m_initialSurfaceSize; |
298 | bool m_closing{false}; |
299 | |
300 | - ProxySurfaceListModel m_proxySurfaceList; |
301 | - ProxySurfaceListModel m_proxyPromptSurfaceList; |
302 | + ProxySurfaceListModel *m_proxySurfaceList; |
303 | + ProxySurfaceListModel *m_proxyPromptSurfaceList; |
304 | |
305 | friend class ApplicationManager; |
306 | friend class SessionManager; |
307 | |
308 | === modified file 'src/modules/Unity/Application/mirsurfacelistmodel.cpp' |
309 | --- src/modules/Unity/Application/mirsurfacelistmodel.cpp 2016-05-17 19:57:52 +0000 |
310 | +++ src/modules/Unity/Application/mirsurfacelistmodel.cpp 2016-06-06 19:37:34 +0000 |
311 | @@ -20,6 +20,9 @@ |
312 | |
313 | #include <paths.h> |
314 | |
315 | +#include <QDebug> |
316 | +#include <QDebugStateSaver> |
317 | + |
318 | namespace unityapp = unity::shell::application; |
319 | using namespace qtmir; |
320 | |
321 | @@ -65,11 +68,11 @@ |
322 | m_surfaceList.prepend(surface); |
323 | connectSurface(surface); |
324 | endInsertRows(); |
325 | - Q_EMIT countChanged(); |
326 | + Q_EMIT countChanged(m_surfaceList.count()); |
327 | if (count() == 1) { |
328 | Q_EMIT emptyChanged(); |
329 | - Q_EMIT firstChanged(); |
330 | } |
331 | + Q_EMIT firstChanged(); |
332 | } |
333 | |
334 | void MirSurfaceListModel::connectSurface(MirSurfaceInterface *surface) |
335 | @@ -85,7 +88,7 @@ |
336 | beginRemoveRows(QModelIndex(), i, i); |
337 | m_surfaceList.removeAt(i); |
338 | endRemoveRows(); |
339 | - Q_EMIT countChanged(); |
340 | + Q_EMIT countChanged(m_surfaceList.count()); |
341 | if (count() == 0) { |
342 | Q_EMIT emptyChanged(); |
343 | } |
344 | @@ -147,7 +150,7 @@ |
345 | }); |
346 | } |
347 | endInsertRows(); |
348 | - Q_EMIT countChanged(); |
349 | + Q_EMIT countChanged(m_surfaceList.count()); |
350 | if (wasEmpty) { |
351 | Q_EMIT emptyChanged(); |
352 | } |
353 | @@ -207,6 +210,11 @@ |
354 | // ProxySurfaceListModel |
355 | ////////////////////////////////////////////////////////////////////////////// |
356 | |
357 | +ProxySurfaceListModel::ProxySurfaceListModel(QObject *parent): |
358 | + unity::shell::application::MirSurfaceListInterface(parent) |
359 | +{ |
360 | +} |
361 | + |
362 | void ProxySurfaceListModel::setSourceList(MirSurfaceListModel *sourceList) |
363 | { |
364 | if (m_sourceList == sourceList) |
365 | @@ -284,3 +292,21 @@ |
366 | |
367 | return m_sourceList->data(index, role); |
368 | } |
369 | + |
370 | +QDebug operator<<(QDebug dbg, const unityapp::MirSurfaceListInterface &surfaceListConst) |
371 | +{ |
372 | + auto surfaceList = const_cast<unityapp::MirSurfaceListInterface*>(&surfaceListConst); |
373 | + |
374 | + QDebugStateSaver saver(dbg); |
375 | + dbg.nospace(); |
376 | + dbg << "MirSurfaceList("; |
377 | + for (int i = 0; i < surfaceList->count(); ++i) { |
378 | + if (i > 0) { |
379 | + dbg << ", "; |
380 | + } |
381 | + auto surface = surfaceList->get(i); |
382 | + dbg << (void*)surface; |
383 | + } |
384 | + dbg << ')'; |
385 | + return dbg; |
386 | +} |
387 | |
388 | === modified file 'src/modules/Unity/Application/mirsurfacelistmodel.h' |
389 | --- src/modules/Unity/Application/mirsurfacelistmodel.h 2016-05-10 21:06:21 +0000 |
390 | +++ src/modules/Unity/Application/mirsurfacelistmodel.h 2016-06-06 19:37:34 +0000 |
391 | @@ -81,6 +81,7 @@ |
392 | { |
393 | Q_OBJECT |
394 | public: |
395 | + ProxySurfaceListModel(QObject *parent = nullptr); |
396 | void setSourceList(MirSurfaceListModel *sourceList); |
397 | |
398 | Q_INVOKABLE unity::shell::application::MirSurfaceInterface *get(int index) override; |
399 | @@ -94,4 +95,6 @@ |
400 | |
401 | } // namespace qtmir |
402 | |
403 | +QDebug operator<<(QDebug, const unity::shell::application::MirSurfaceListInterface &); |
404 | + |
405 | #endif // QTMIR_MIRSURFACELISTMODEL_H |
406 | |
407 | === modified file 'src/modules/Unity/Application/session.cpp' |
408 | --- src/modules/Unity/Application/session.cpp 2016-05-17 19:18:44 +0000 |
409 | +++ src/modules/Unity/Application/session.cpp 2016-06-06 19:37:34 +0000 |
410 | @@ -38,6 +38,8 @@ |
411 | |
412 | using unity::shell::application::ApplicationInfoInterface; |
413 | |
414 | +#define DEBUG_MSG qCDebug(QTMIR_SURFACES).nospace() << "Session[" << (void*)this << ",name=" << name() << "]::" << __func__ |
415 | + |
416 | namespace qtmir |
417 | { |
418 | |
419 | @@ -75,7 +77,7 @@ |
420 | , m_live(true) |
421 | , m_promptSessionManager(promptSessionManager) |
422 | { |
423 | - qCDebug(QTMIR_SESSIONS) << "Session::Session() " << this->name(); |
424 | + DEBUG_MSG << "()"; |
425 | |
426 | setSuspendTimer(new Timer); |
427 | |
428 | @@ -84,7 +86,7 @@ |
429 | |
430 | Session::~Session() |
431 | { |
432 | - qCDebug(QTMIR_SESSIONS) << "Session::~Session() " << name(); |
433 | + DEBUG_MSG << "()"; |
434 | stopPromptSessions(); |
435 | |
436 | QList<SessionInterface*> children(m_children->list()); |
437 | @@ -107,7 +109,7 @@ |
438 | Q_ASSERT(m_state == Session::Suspending); |
439 | |
440 | if (m_surfaceList.count() == 0) { |
441 | - qCDebug(QTMIR_SESSIONS) << "Application::suspend - no surface to call stopFrameDropper() on!"; |
442 | + DEBUG_MSG << " no surface to call stopFrameDropper() on!"; |
443 | } else { |
444 | for (int i = 0; i < m_surfaceList.count(); ++i) { |
445 | auto surface = static_cast<MirSurfaceInterface*>(m_surfaceList.get(i)); |
446 | @@ -153,8 +155,7 @@ |
447 | return; |
448 | } |
449 | |
450 | - qCDebug(QTMIR_SESSIONS) << "Session::setState - session=" << name() |
451 | - << "state=" << sessionStateToString(state); |
452 | + DEBUG_MSG << "(state=" << sessionStateToString(state) << ")"; |
453 | |
454 | if (m_state == Suspending) { |
455 | m_suspendTimer->stop(); |
456 | @@ -198,7 +199,7 @@ |
457 | |
458 | void Session::registerSurface(MirSurfaceInterface *newSurface) |
459 | { |
460 | - qCDebug(QTMIR_SESSIONS) << "Session::resgisterSurface - session=" << name() << "surface=" << newSurface; |
461 | + DEBUG_MSG << "(surface=" << newSurface << ")"; |
462 | |
463 | // Only notify QML of surface creation once it has drawn its first frame. |
464 | if (newSurface->isFirstFrameDrawn()) { |
465 | @@ -214,7 +215,7 @@ |
466 | |
467 | void Session::prependSurface(MirSurfaceInterface *newSurface) |
468 | { |
469 | - qCDebug(QTMIR_SESSIONS) << "Session::prependSurface - session=" << name() << "surface=" << newSurface; |
470 | + DEBUG_MSG << "(surface=" << newSurface << ")"; |
471 | |
472 | connect(newSurface, &MirSurfaceInterface::stateChanged, |
473 | this, &Session::updateFullscreenProperty); |
474 | @@ -246,7 +247,7 @@ |
475 | |
476 | void Session::removeSurface(MirSurfaceInterface* surface) |
477 | { |
478 | - qCDebug(QTMIR_SESSIONS) << "Session::removeSurface - session=" << name() << "surface=" << surface; |
479 | + DEBUG_MSG << "(surface=" << surface << ")"; |
480 | |
481 | surface->disconnect(this); |
482 | |
483 | @@ -277,8 +278,8 @@ |
484 | |
485 | void Session::setFullscreen(bool fullscreen) |
486 | { |
487 | - qCDebug(QTMIR_SESSIONS) << "Session::setFullscreen - session=" << this << "fullscreen=" << fullscreen; |
488 | if (m_fullscreen != fullscreen) { |
489 | + DEBUG_MSG << "(" << fullscreen << ")"; |
490 | m_fullscreen = fullscreen; |
491 | Q_EMIT fullscreenChanged(m_fullscreen); |
492 | } |
493 | @@ -286,7 +287,7 @@ |
494 | |
495 | void Session::suspend() |
496 | { |
497 | - qCDebug(QTMIR_SESSIONS) << "Session::suspend - session=" << this << "state=" << sessionStateToString(m_state); |
498 | + DEBUG_MSG << " state=" << sessionStateToString(m_state); |
499 | if (m_state == Running) { |
500 | session()->set_lifecycle_state(mir_lifecycle_state_will_suspend); |
501 | m_suspendTimer->start(); |
502 | @@ -305,7 +306,7 @@ |
503 | |
504 | void Session::resume() |
505 | { |
506 | - qCDebug(QTMIR_SESSIONS) << "Session::resume - session=" << this << "state=" << sessionStateToString(m_state); |
507 | + DEBUG_MSG << " state=" << sessionStateToString(m_state); |
508 | |
509 | if (m_state == Suspending || m_state == Suspended) { |
510 | doResume(); |
511 | @@ -336,7 +337,7 @@ |
512 | |
513 | void Session::close() |
514 | { |
515 | - qCDebug(QTMIR_SESSIONS) << "Session::close - " << name(); |
516 | + DEBUG_MSG << "()"; |
517 | |
518 | if (m_state == Stopped) return; |
519 | |
520 | @@ -348,7 +349,7 @@ |
521 | |
522 | void Session::stop() |
523 | { |
524 | - qCDebug(QTMIR_SESSIONS) << "Session::stop - " << name(); |
525 | + DEBUG_MSG << "()"; |
526 | |
527 | if (m_state != Stopped) { |
528 | |
529 | @@ -372,7 +373,7 @@ |
530 | void Session::setLive(const bool live) |
531 | { |
532 | if (m_live != live) { |
533 | - qCDebug(QTMIR_SESSIONS) << "Session::setLive - " << name() << "live=" << live; |
534 | + DEBUG_MSG << "(" << live << ")"; |
535 | |
536 | m_live = live; |
537 | Q_EMIT liveChanged(m_live); |
538 | @@ -396,7 +397,7 @@ |
539 | |
540 | void Session::insertChildSession(uint index, SessionInterface* session) |
541 | { |
542 | - qCDebug(QTMIR_SESSIONS) << "Session::insertChildSession - " << session->name() << " to " << name() << " @ " << index; |
543 | + DEBUG_MSG << "(index=" << index << ", Session[" << (void*)session << ",name=" << session->name() << "])"; |
544 | Q_ASSERT(!m_children->contains(session)); |
545 | |
546 | m_children->insert(index, session); |
547 | @@ -424,7 +425,7 @@ |
548 | |
549 | void Session::removeChildSession(SessionInterface* session) |
550 | { |
551 | - qCDebug(QTMIR_SESSIONS) << "Session::removeChildSession - " << session->name() << " from " << name(); |
552 | + DEBUG_MSG << "(Session[" << (void*)session << ",name=" << session->name() << "])"; |
553 | |
554 | disconnect(session, 0, this, 0); |
555 | |
556 | @@ -452,16 +453,14 @@ |
557 | |
558 | void Session::appendPromptSession(const std::shared_ptr<ms::PromptSession>& promptSession) |
559 | { |
560 | - qCDebug(QTMIR_SESSIONS) << "Session::appendPromptSession session=" << name() |
561 | - << "promptSession=" << (promptSession ? promptSession.get() : nullptr); |
562 | + DEBUG_MSG << "(promptSession=" << (promptSession ? promptSession.get() : nullptr) << ")"; |
563 | |
564 | m_promptSessions.append(promptSession); |
565 | } |
566 | |
567 | void Session::removePromptSession(const std::shared_ptr<ms::PromptSession>& promptSession) |
568 | { |
569 | - qCDebug(QTMIR_SESSIONS) << "Session::removePromptSession session=" << name() |
570 | - << "promptSession=" << (promptSession ? promptSession.get() : nullptr); |
571 | + DEBUG_MSG << "(promptSession=" << (promptSession ? promptSession.get() : nullptr) << ")"; |
572 | |
573 | m_promptSessions.removeAll(promptSession); |
574 | } |
575 | @@ -477,7 +476,7 @@ |
576 | QListIterator<std::shared_ptr<ms::PromptSession>> it(copy); |
577 | for ( it.toBack(); it.hasPrevious(); ) { |
578 | std::shared_ptr<ms::PromptSession> promptSession = it.previous(); |
579 | - qCDebug(QTMIR_SESSIONS) << "Session::stopPromptSessions - promptSession=" << promptSession.get(); |
580 | + DEBUG_MSG << " - promptSession=" << promptSession.get(); |
581 | |
582 | m_promptSessionManager->stop_prompt_session(promptSession); |
583 | } |
584 | @@ -500,7 +499,7 @@ |
585 | void Session::deleteIfZombieAndEmpty() |
586 | { |
587 | if (!m_live && m_children->rowCount() == 0 && m_surfaceList.isEmpty()) { |
588 | - qCDebug(QTMIR_SESSIONS).nospace() << "Session::deleteIfZombieAndEmpty[" << name() << "] - deleteLater()"; |
589 | + DEBUG_MSG << " - deleteLater()"; |
590 | deleteLater(); |
591 | } |
592 | } |
593 | |
594 | === modified file 'src/modules/Unity/Application/sessionmanager.h' |
595 | --- src/modules/Unity/Application/sessionmanager.h 2015-08-11 12:08:32 +0000 |
596 | +++ src/modules/Unity/Application/sessionmanager.h 2016-06-06 19:37:34 +0000 |
597 | @@ -81,7 +81,6 @@ |
598 | ApplicationManager* m_applicationManager; |
599 | static SessionManager *the_session_manager; |
600 | |
601 | - QList<Session*> m_sessions; |
602 | QHash<const mir::scene::PromptSession *, SessionInterface *> m_mirPromptToSessionHash; |
603 | }; |
604 | |
605 | |
606 | === modified file 'src/modules/Unity/Application/ubuntukeyboardinfo.cpp' |
607 | --- src/modules/Unity/Application/ubuntukeyboardinfo.cpp 2015-08-11 12:08:32 +0000 |
608 | +++ src/modules/Unity/Application/ubuntukeyboardinfo.cpp 2016-06-06 19:37:34 +0000 |
609 | @@ -36,6 +36,8 @@ |
610 | UbuntuKeyboardInfo::UbuntuKeyboardInfo(QObject *parent) |
611 | : QObject(parent), |
612 | m_consecutiveAttempts(0), |
613 | + m_lastX(0), |
614 | + m_lastY(0), |
615 | m_lastWidth(0), |
616 | m_lastHeight(0) |
617 | { |
618 | |
619 | === modified file 'src/modules/Unity/Application/upstart/taskcontroller.cpp' |
620 | --- src/modules/Unity/Application/upstart/taskcontroller.cpp 2016-05-04 16:35:50 +0000 |
621 | +++ src/modules/Unity/Application/upstart/taskcontroller.cpp 2016-06-06 19:37:34 +0000 |
622 | @@ -127,8 +127,8 @@ |
623 | TaskController::Error error; |
624 | switch(failureType) |
625 | { |
626 | - case UBUNTU_APP_LAUNCH_APP_FAILED_CRASH: error = TaskController::Error::APPLICATION_CRASHED; |
627 | - case UBUNTU_APP_LAUNCH_APP_FAILED_START_FAILURE: error = TaskController::Error::APPLICATION_FAILED_TO_START; |
628 | + case UBUNTU_APP_LAUNCH_APP_FAILED_CRASH: error = TaskController::Error::APPLICATION_CRASHED; break; |
629 | + case UBUNTU_APP_LAUNCH_APP_FAILED_START_FAILURE: error = TaskController::Error::APPLICATION_FAILED_TO_START; break; |
630 | } |
631 | |
632 | auto thiz = static_cast<TaskController*>(userData); |
633 | |
634 | === modified file 'src/modules/Unity/Screens/CMakeLists.txt' |
635 | --- src/modules/Unity/Screens/CMakeLists.txt 2016-01-28 22:33:35 +0000 |
636 | +++ src/modules/Unity/Screens/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
637 | @@ -1,5 +1,9 @@ |
638 | include_directories( |
639 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
640 | +) |
641 | + |
642 | +include_directories( |
643 | + SYSTEM |
644 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
645 | ${Qt5Quick_INCLUDE_DIRS} |
646 | ${MIRSERVER_INCLUDE_DIRS} |
647 | |
648 | === modified file 'src/platforms/mirserver/CMakeLists.txt' |
649 | --- src/platforms/mirserver/CMakeLists.txt 2016-05-25 13:54:30 +0000 |
650 | +++ src/platforms/mirserver/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
651 | @@ -26,6 +26,10 @@ |
652 | include_directories( |
653 | ${CMAKE_SOURCE_DIR}/src/common |
654 | |
655 | +) |
656 | + |
657 | +include_directories( |
658 | + SYSTEM |
659 | ${MIRCOMMON_INCLUDE_DIRS} |
660 | ${MIRSERVER_INCLUDE_DIRS} |
661 | ${MIRRENDERERGLDEV_INCLUDE_DIRS} |
662 | @@ -82,6 +86,7 @@ |
663 | tracepoints.c |
664 | # We need to run moc on these headers |
665 | ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/Mir.h |
666 | + ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/MirMousePointerInterface.h |
667 | ) |
668 | |
669 | add_library(qpa-mirserver SHARED |
670 | |
671 | === modified file 'src/platforms/mirserver/mirwindowmanager.cpp' |
672 | --- src/platforms/mirserver/mirwindowmanager.cpp 2016-04-28 12:48:48 +0000 |
673 | +++ src/platforms/mirserver/mirwindowmanager.cpp 2016-06-06 19:37:34 +0000 |
674 | @@ -196,7 +196,7 @@ |
675 | const std::shared_ptr<mir::scene::Surface>& surface, |
676 | const mir::shell::SurfaceSpecification& modifications) |
677 | { |
678 | - QMutexLocker(&SurfaceObserver::mutex); |
679 | + QMutexLocker locker(&SurfaceObserver::mutex); |
680 | SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get()); |
681 | if (observer) { |
682 | observer->notifySurfaceModifications(modifications); |
683 | |
684 | === modified file 'tests/framework/CMakeLists.txt' |
685 | --- tests/framework/CMakeLists.txt 2016-05-24 20:13:10 +0000 |
686 | +++ tests/framework/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
687 | @@ -1,7 +1,11 @@ |
688 | include_directories( |
689 | - ${APPLICATION_API_INCLUDE_DIRS} |
690 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
691 | ${CMAKE_SOURCE_DIR}/src/modules |
692 | +) |
693 | + |
694 | +include_directories( |
695 | + SYSTEM |
696 | + ${APPLICATION_API_INCLUDE_DIRS} |
697 | ${MIRSERVER_INCLUDE_DIRS} |
698 | ${MIRRENDERERGLDEV_INCLUDE_DIRS} |
699 | |
700 | |
701 | === modified file 'tests/framework/mock_mir_session.cpp' |
702 | --- tests/framework/mock_mir_session.cpp 2015-10-19 10:45:42 +0000 |
703 | +++ tests/framework/mock_mir_session.cpp 2016-06-06 19:37:34 +0000 |
704 | @@ -22,6 +22,7 @@ |
705 | { |
706 | |
707 | MockSession::MockSession() |
708 | + : m_sessionId(-1) |
709 | { |
710 | } |
711 | |
712 | |
713 | === modified file 'tests/mirserver/Clipboard/CMakeLists.txt' |
714 | --- tests/mirserver/Clipboard/CMakeLists.txt 2014-12-03 08:56:35 +0000 |
715 | +++ tests/mirserver/Clipboard/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
716 | @@ -6,6 +6,10 @@ |
717 | |
718 | include_directories( |
719 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
720 | +) |
721 | + |
722 | +include_directories( |
723 | + SYSTEM |
724 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
725 | ${MIRSERVER_INCLUDE_DIRS} |
726 | ) |
727 | |
728 | === modified file 'tests/mirserver/QtEventFeeder/CMakeLists.txt' |
729 | --- tests/mirserver/QtEventFeeder/CMakeLists.txt 2014-12-03 08:56:35 +0000 |
730 | +++ tests/mirserver/QtEventFeeder/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
731 | @@ -7,6 +7,10 @@ |
732 | include_directories( |
733 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
734 | ${CMAKE_SOURCE_DIR}/src/common |
735 | +) |
736 | + |
737 | +include_directories( |
738 | + SYSTEM |
739 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
740 | ${MIRSERVER_INCLUDE_DIRS} |
741 | ) |
742 | |
743 | === modified file 'tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h' |
744 | --- tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h 2016-01-07 11:37:55 +0000 |
745 | +++ tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h 2016-06-06 19:37:34 +0000 |
746 | @@ -28,7 +28,6 @@ |
747 | MOCK_METHOD1(getWindowForTouchPoint, QWindow*(const QPoint &point)); |
748 | MOCK_METHOD0(lastWindow, QWindow*()); |
749 | MOCK_METHOD0(focusedWindow, QWindow*()); |
750 | - MOCK_METHOD1(registerTouchDevice, void(QTouchDevice* device)); |
751 | |
752 | // Wanted to use GMock, but MOCK_METHOD11 not implemented |
753 | void handleExtendedKeyEvent(QWindow */*window*/, ulong /*timestamp*/, QEvent::Type /*type*/, int /*key*/, |
754 | @@ -43,6 +42,18 @@ |
755 | Qt::KeyboardModifiers mods)); |
756 | MOCK_METHOD4(handleMouseEvent, void(ulong timestamp, QPointF point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)); |
757 | MOCK_METHOD3(handleWheelEvent, void(ulong timestamp, QPoint angleDelta, Qt::KeyboardModifiers mods)); |
758 | + |
759 | + ~MockQtWindowSystem() |
760 | + { |
761 | + qDeleteAll(m_devices); |
762 | + } |
763 | + |
764 | + void registerTouchDevice(QTouchDevice* device) |
765 | + { |
766 | + m_devices << device; |
767 | + } |
768 | + |
769 | + QVector<QTouchDevice*> m_devices; |
770 | }; |
771 | |
772 | namespace testing |
773 | |
774 | === modified file 'tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp' |
775 | --- tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp 2016-04-29 15:41:00 +0000 |
776 | +++ tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp 2016-06-06 19:37:34 +0000 |
777 | @@ -78,11 +78,11 @@ |
778 | mockWindowSystem = new MockQtWindowSystem; |
779 | auto screens = QSharedPointer<ScreensModel>(); |
780 | |
781 | - EXPECT_CALL(*mockWindowSystem, registerTouchDevice(_)); |
782 | + ASSERT_TRUE(mockWindowSystem->m_devices.count() == 0); |
783 | |
784 | qtEventFeeder = new QtEventFeeder(screens, mockWindowSystem); |
785 | |
786 | - ASSERT_TRUE(Mock::VerifyAndClearExpectations(mockWindowSystem)); |
787 | + ASSERT_TRUE(mockWindowSystem->m_devices.count() == 1); |
788 | |
789 | int argc = 0; |
790 | char **argv = nullptr; |
791 | |
792 | === modified file 'tests/mirserver/Screen/CMakeLists.txt' |
793 | --- tests/mirserver/Screen/CMakeLists.txt 2015-11-11 10:43:36 +0000 |
794 | +++ tests/mirserver/Screen/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
795 | @@ -8,6 +8,10 @@ |
796 | ${CMAKE_SOURCE_DIR}/tests/framework |
797 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
798 | ${CMAKE_SOURCE_DIR}/src/common |
799 | +) |
800 | + |
801 | +include_directories( |
802 | + SYSTEM |
803 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
804 | ${MIRSERVER_INCLUDE_DIRS} |
805 | ) |
806 | |
807 | === modified file 'tests/mirserver/ScreensModel/CMakeLists.txt' |
808 | --- tests/mirserver/ScreensModel/CMakeLists.txt 2016-02-16 11:48:35 +0000 |
809 | +++ tests/mirserver/ScreensModel/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
810 | @@ -11,6 +11,10 @@ |
811 | ${CMAKE_SOURCE_DIR}/tests/framework |
812 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
813 | ${CMAKE_SOURCE_DIR}/src/common |
814 | +) |
815 | + |
816 | +include_directories( |
817 | + SYSTEM |
818 | ${Qt5Gui_PRIVATE_INCLUDE_DIRS} |
819 | ${MIRSERVER_INCLUDE_DIRS} |
820 | ${MIRRENDERERGLDEV_INCLUDE_DIRS} |
821 | |
822 | === modified file 'tests/mirserver/ScreensModel/screensmodel_test.cpp' |
823 | --- tests/mirserver/ScreensModel/screensmodel_test.cpp 2016-04-29 15:41:00 +0000 |
824 | +++ tests/mirserver/ScreensModel/screensmodel_test.cpp 2016-06-06 19:37:34 +0000 |
825 | @@ -64,6 +64,7 @@ |
826 | void ScreensModelTest::TearDown() |
827 | { |
828 | delete screensModel; |
829 | + delete app; |
830 | } |
831 | |
832 | TEST_F(ScreensModelTest, SingleScreenFound) |
833 | |
834 | === modified file 'tests/mirserver/WindowManager/CMakeLists.txt' |
835 | --- tests/mirserver/WindowManager/CMakeLists.txt 2016-03-10 11:55:28 +0000 |
836 | +++ tests/mirserver/WindowManager/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
837 | @@ -1,5 +1,9 @@ |
838 | include_directories( |
839 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
840 | +) |
841 | + |
842 | +include_directories( |
843 | + SYSTEM |
844 | ${MIRSERVER_INCLUDE_DIRS} |
845 | ) |
846 | |
847 | |
848 | === modified file 'tests/modules/Application/CMakeLists.txt' |
849 | --- tests/modules/Application/CMakeLists.txt 2015-12-15 10:03:32 +0000 |
850 | +++ tests/modules/Application/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
851 | @@ -7,8 +7,11 @@ |
852 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
853 | ${CMAKE_SOURCE_DIR}/src/modules |
854 | ${CMAKE_SOURCE_DIR}/tests/framework |
855 | +) |
856 | + |
857 | +include_directories( |
858 | + SYSTEM |
859 | ${MIRSERVER_INCLUDE_DIRS} |
860 | - |
861 | ${Qt5Core_INCLUDE_DIRS} |
862 | ${Qt5GUI_INCLUDE_DIRS} |
863 | ${Qt5Quick_INCLUDE_DIRS} |
864 | |
865 | === modified file 'tests/modules/Application/application_test.cpp' |
866 | --- tests/modules/Application/application_test.cpp 2016-05-02 12:57:40 +0000 |
867 | +++ tests/modules/Application/application_test.cpp 2016-06-06 19:37:34 +0000 |
868 | @@ -590,6 +590,38 @@ |
869 | EXPECT_EQ(Application::InternalState::StoppedResumable, application->internalState()); |
870 | } |
871 | |
872 | +TEST_F(ApplicationTests, surfaceCountPropertyUpdates) |
873 | +{ |
874 | + using namespace ::testing; |
875 | + |
876 | + QScopedPointer<Application> application(createApplicationWithFakes()); |
877 | + |
878 | + application->setProcessState(Application::ProcessRunning); |
879 | + Session *session = createSessionWithFakes(); |
880 | + |
881 | + application->setSession(session); |
882 | + |
883 | + QSignalSpy surfaceCountChangedSpy(application.data(), &Application::surfaceCountChanged); |
884 | + |
885 | + EXPECT_EQ(application->surfaceCount(), 0); |
886 | + EXPECT_EQ(surfaceCountChangedSpy.count(), 0); |
887 | + |
888 | + FakeMirSurface *surface = new FakeMirSurface; |
889 | + session->registerSurface(surface); |
890 | + surface->drawFirstFrame(); |
891 | + |
892 | + EXPECT_EQ(application->surfaceCount(), 1); |
893 | + EXPECT_EQ(surfaceCountChangedSpy.count(), 1); |
894 | + |
895 | + FakeMirSurface *surface2 = new FakeMirSurface; |
896 | + session->registerSurface(surface2); |
897 | + surface2->drawFirstFrame(); |
898 | + |
899 | + EXPECT_EQ(application->surfaceCount(), 2); |
900 | + EXPECT_EQ(surfaceCountChangedSpy.count(), 2); |
901 | + |
902 | +} |
903 | + |
904 | /* |
905 | Regression test for bug "App respawns if manually closed while it's launching" |
906 | https://bugs.launchpad.net/ubuntu/+source/qtmir/+bug/1575577 |
907 | |
908 | === modified file 'tests/modules/ApplicationManager/CMakeLists.txt' |
909 | --- tests/modules/ApplicationManager/CMakeLists.txt 2015-09-30 15:45:17 +0000 |
910 | +++ tests/modules/ApplicationManager/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
911 | @@ -5,10 +5,14 @@ |
912 | ) |
913 | |
914 | include_directories( |
915 | - ${APPLICATION_API_INCLUDE_DIRS} |
916 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
917 | ${CMAKE_SOURCE_DIR}/src/modules |
918 | ${CMAKE_SOURCE_DIR}/tests/framework |
919 | +) |
920 | + |
921 | +include_directories( |
922 | + SYSTEM |
923 | + ${APPLICATION_API_INCLUDE_DIRS} |
924 | ${MIRSERVER_INCLUDE_DIRS} |
925 | ) |
926 | |
927 | |
928 | === modified file 'tests/modules/ApplicationManager/application_manager_test.cpp' |
929 | --- tests/modules/ApplicationManager/application_manager_test.cpp 2016-05-03 15:27:26 +0000 |
930 | +++ tests/modules/ApplicationManager/application_manager_test.cpp 2016-06-06 19:37:34 +0000 |
931 | @@ -118,6 +118,8 @@ |
932 | |
933 | EXPECT_FALSE(authed); |
934 | EXPECT_EQ(application, applicationManager.findApplication(dialer_app_id)); |
935 | + |
936 | + delete surface; |
937 | } |
938 | |
939 | TEST_F(ApplicationManagerTests,application_dies_while_starting) |
940 | @@ -271,6 +273,10 @@ |
941 | |
942 | TEST_F(ApplicationManagerTests,two_session_on_one_application) |
943 | { |
944 | + int argc = 0; |
945 | + char* argv[0]; |
946 | + QCoreApplication qtApp(argc, argv); // app for deleteLater event |
947 | + |
948 | using namespace ::testing; |
949 | const pid_t a_procId = 5921; |
950 | const char an_app_id[] = "some_app"; |
951 | @@ -293,10 +299,18 @@ |
952 | |
953 | EXPECT_EQ(true, authed); |
954 | EXPECT_EQ(second_session, the_app->session()->session()); |
955 | + |
956 | + onSessionStopping(first_session); |
957 | + onSessionStopping(second_session); |
958 | + qtApp.sendPostedEvents(nullptr, QEvent::DeferredDelete); |
959 | } |
960 | |
961 | TEST_F(ApplicationManagerTests,two_session_on_one_application_after_starting) |
962 | { |
963 | + int argc = 0; |
964 | + char* argv[0]; |
965 | + QCoreApplication qtApp(argc, argv); // app for deleteLater event |
966 | + |
967 | using namespace ::testing; |
968 | const pid_t a_procId = 5921; |
969 | const char an_app_id[] = "some_app"; |
970 | @@ -323,6 +337,11 @@ |
971 | EXPECT_EQ(true, authed); |
972 | EXPECT_EQ(Application::Running, the_app->state()); |
973 | EXPECT_EQ(first_session, the_app->session()->session()); |
974 | + |
975 | + onSessionStopping(first_session); |
976 | + onSessionStopping(second_session); |
977 | + delete aSurface; |
978 | + qtApp.sendPostedEvents(nullptr, QEvent::DeferredDelete); |
979 | } |
980 | |
981 | TEST_F(ApplicationManagerTests,starting_app_is_suspended_when_it_gets_ready_if_requested) |
982 | @@ -357,6 +376,8 @@ |
983 | |
984 | // now that its ready, suspend process should have begun |
985 | EXPECT_EQ(Application::InternalState::SuspendingWaitSession, app->internalState()); |
986 | + |
987 | + delete aSurface; |
988 | } |
989 | |
990 | TEST_F(ApplicationManagerTests,requestFocusApplication) |
991 | @@ -746,6 +767,8 @@ |
992 | // Check application state is correctly set |
993 | Application *theApp = applicationManager.findApplication(appId); |
994 | EXPECT_EQ(theApp->state(), Application::Running); |
995 | + |
996 | + delete surface; |
997 | } |
998 | |
999 | /* |
1000 | @@ -879,6 +902,8 @@ |
1001 | |
1002 | EXPECT_EQ(2, countSpy.count()); //FIXME(greyback) |
1003 | EXPECT_EQ(0, applicationManager.count()); |
1004 | + |
1005 | + delete surface; |
1006 | } |
1007 | |
1008 | /* |
1009 | @@ -921,6 +946,8 @@ |
1010 | |
1011 | EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback) |
1012 | EXPECT_EQ(applicationManager.count(), 0); |
1013 | + |
1014 | + delete surface; |
1015 | } |
1016 | |
1017 | /* |
1018 | @@ -971,6 +998,8 @@ |
1019 | |
1020 | EXPECT_EQ(0, countSpy.count()); |
1021 | EXPECT_EQ(1, applicationManager.count()); |
1022 | + |
1023 | + delete surface; |
1024 | } |
1025 | |
1026 | /* |
1027 | @@ -1023,6 +1052,8 @@ |
1028 | |
1029 | EXPECT_EQ(countSpy.count(), 0); |
1030 | EXPECT_EQ(applicationManager.count(), 1); |
1031 | + |
1032 | + delete surface; |
1033 | } |
1034 | |
1035 | /* |
1036 | @@ -1092,6 +1123,8 @@ |
1037 | |
1038 | EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback) |
1039 | EXPECT_EQ(applicationManager.count(), 0); |
1040 | + |
1041 | + delete surface; |
1042 | } |
1043 | |
1044 | /* |
1045 | @@ -1133,6 +1166,8 @@ |
1046 | |
1047 | Application *app = applicationManager.findApplication(appId); |
1048 | EXPECT_EQ(nullptr, app); |
1049 | + |
1050 | + delete surface; |
1051 | } |
1052 | |
1053 | /* |
1054 | @@ -1187,6 +1222,8 @@ |
1055 | EXPECT_EQ(1, applicationManager.count()); |
1056 | |
1057 | EXPECT_EQ(Application::Stopped, app->state()); |
1058 | + |
1059 | + delete surface; |
1060 | } |
1061 | |
1062 | /* |
1063 | @@ -1236,6 +1273,10 @@ |
1064 | */ |
1065 | TEST_F(ApplicationManagerTests,unexpectedStopOfForegroundWebapp) |
1066 | { |
1067 | + int argc = 0; |
1068 | + char* argv[0]; |
1069 | + QCoreApplication qtApp(argc, argv); // app for deleteLater event |
1070 | + |
1071 | using namespace ::testing; |
1072 | const QString appId("webapp"); |
1073 | const pid_t procId1 = 5551; |
1074 | @@ -1279,6 +1320,10 @@ |
1075 | |
1076 | EXPECT_EQ(countSpy.count(), 2); //FIXME(greyback) |
1077 | EXPECT_EQ(applicationManager.count(), 0); |
1078 | + |
1079 | + delete surface; |
1080 | + |
1081 | + qtApp.sendPostedEvents(nullptr, QEvent::DeferredDelete); |
1082 | } |
1083 | |
1084 | /* |
1085 | @@ -1287,6 +1332,10 @@ |
1086 | */ |
1087 | TEST_F(ApplicationManagerTests,unexpectedStopOfBackgroundWebapp) |
1088 | { |
1089 | + int argc = 0; |
1090 | + char* argv[0]; |
1091 | + QCoreApplication qtApp(argc, argv); // app for deleteLater event |
1092 | + |
1093 | using namespace ::testing; |
1094 | const QString appId("webapp"); |
1095 | const pid_t procId1 = 5551; |
1096 | @@ -1336,6 +1385,11 @@ |
1097 | onSessionStopping(session1); |
1098 | |
1099 | EXPECT_EQ(0, countSpy.count()); |
1100 | + |
1101 | + delete surface1; |
1102 | + delete surface2; |
1103 | + |
1104 | + qtApp.sendPostedEvents(nullptr, QEvent::DeferredDelete); |
1105 | } |
1106 | |
1107 | /* |
1108 | @@ -1460,6 +1514,8 @@ |
1109 | |
1110 | EXPECT_EQ(Application::Running, the_app->state()); |
1111 | ASSERT_EQ(Application::InternalState::Running, the_app->internalState()); |
1112 | + |
1113 | + delete surface; |
1114 | } |
1115 | |
1116 | /* |
1117 | @@ -1499,6 +1555,8 @@ |
1118 | EXPECT_FALSE(sharedWakelock.enabled()); |
1119 | ASSERT_EQ(Application::InternalState::RunningInBackground, application->internalState()); |
1120 | EXPECT_EQ(Application::Running, application->state()); |
1121 | + |
1122 | + delete surface; |
1123 | } |
1124 | |
1125 | /* |
1126 | @@ -1628,6 +1686,8 @@ |
1127 | |
1128 | EXPECT_EQ(0, applicationManager.count()); |
1129 | EXPECT_TRUE(dir.exists()); |
1130 | + |
1131 | + delete aSurface; |
1132 | } |
1133 | |
1134 | /* |
1135 | @@ -1652,6 +1712,8 @@ |
1136 | applicationManager.stopApplication(appId); |
1137 | |
1138 | EXPECT_EQ(1, spy.count()); |
1139 | + |
1140 | + delete surface; |
1141 | } |
1142 | |
1143 | |
1144 | @@ -1899,4 +1961,6 @@ |
1145 | surface->requestFocus(); |
1146 | |
1147 | EXPECT_EQ(1, focusRequestedSpy.count()); |
1148 | + |
1149 | + delete surface; |
1150 | } |
1151 | |
1152 | === modified file 'tests/modules/SessionManager/CMakeLists.txt' |
1153 | --- tests/modules/SessionManager/CMakeLists.txt 2015-09-30 15:45:17 +0000 |
1154 | +++ tests/modules/SessionManager/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
1155 | @@ -6,10 +6,14 @@ |
1156 | ) |
1157 | |
1158 | include_directories( |
1159 | - ${APPLICATION_API_INCLUDE_DIRS} |
1160 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
1161 | ${CMAKE_SOURCE_DIR}/src/modules |
1162 | ${CMAKE_SOURCE_DIR}/tests/framework |
1163 | +) |
1164 | + |
1165 | +include_directories( |
1166 | + SYSTEM |
1167 | + ${APPLICATION_API_INCLUDE_DIRS} |
1168 | ${MIRSERVER_INCLUDE_DIRS} |
1169 | ) |
1170 | |
1171 | |
1172 | === modified file 'tests/modules/SessionManager/session_test.cpp' |
1173 | --- tests/modules/SessionManager/session_test.cpp 2016-05-24 21:32:06 +0000 |
1174 | +++ tests/modules/SessionManager/session_test.cpp 2016-06-06 19:37:34 +0000 |
1175 | @@ -62,6 +62,8 @@ |
1176 | |
1177 | surface->drawFirstFrame(); |
1178 | EXPECT_EQ(Session::Running, session->state()); |
1179 | + |
1180 | + delete surface; |
1181 | } |
1182 | |
1183 | TEST_F(SessionTests, AddChildSession) |
1184 | @@ -220,6 +222,7 @@ |
1185 | FakeMirSurface *surface = new FakeMirSurface; |
1186 | session->registerSurface(surface); |
1187 | surface->drawFirstFrame(); |
1188 | + delete surface; |
1189 | } |
1190 | EXPECT_EQ(Session::Running, session->state()); |
1191 | |
1192 | @@ -251,6 +254,7 @@ |
1193 | FakeMirSurface *surface = new FakeMirSurface; |
1194 | session->registerSurface(surface); |
1195 | surface->drawFirstFrame(); |
1196 | + delete surface; |
1197 | } |
1198 | EXPECT_EQ(Session::Running, session->state()); |
1199 | |
1200 | @@ -296,6 +300,7 @@ |
1201 | FakeMirSurface *surface = new FakeMirSurface; |
1202 | session->registerSurface(surface); |
1203 | surface->drawFirstFrame(); |
1204 | + delete surface; |
1205 | } |
1206 | EXPECT_EQ(Session::Running, session->state()); |
1207 | |
1208 | |
1209 | === modified file 'tests/modules/SharedWakelock/CMakeLists.txt' |
1210 | --- tests/modules/SharedWakelock/CMakeLists.txt 2015-09-30 15:45:17 +0000 |
1211 | +++ tests/modules/SharedWakelock/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
1212 | @@ -5,6 +5,10 @@ |
1213 | |
1214 | include_directories( |
1215 | ${CMAKE_SOURCE_DIR}/src/modules |
1216 | +) |
1217 | + |
1218 | +include_directories( |
1219 | + SYSTEM |
1220 | ${QTDBUSTEST_INCLUDE_DIRS} |
1221 | ${QTDBUSMOCK_INCLUDE_DIRS} |
1222 | ) |
1223 | |
1224 | === modified file 'tests/modules/SurfaceManager/CMakeLists.txt' |
1225 | --- tests/modules/SurfaceManager/CMakeLists.txt 2016-05-24 20:13:10 +0000 |
1226 | +++ tests/modules/SurfaceManager/CMakeLists.txt 2016-06-06 19:37:34 +0000 |
1227 | @@ -9,6 +9,10 @@ |
1228 | ${CMAKE_SOURCE_DIR}/src/modules |
1229 | ${CMAKE_SOURCE_DIR}/src/platforms/mirserver |
1230 | ${CMAKE_SOURCE_DIR}/tests/framework |
1231 | +) |
1232 | + |
1233 | +include_directories( |
1234 | + SYSTEM |
1235 | ${MIRSERVER_INCLUDE_DIRS} |
1236 | ${Qt5Quick_PRIVATE_INCLUDE_DIRS} |
1237 | ) |