Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
44a51fef
Commit
44a51fef
authored
Sep 22, 2014
by
Martin Flöser
Browse files
Add test case for Surface::destroy
parent
610e8ce4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wayland/autotests/client/test_wayland_surface.cpp
View file @
44a51fef
...
...
@@ -46,6 +46,7 @@ private Q_SLOTS:
void
testDamage
();
void
testFrameCallback
();
void
testAttachBuffer
();
void
testDestroy
();
private:
KWayland
::
Server
::
Display
*
m_display
;
...
...
@@ -343,5 +344,28 @@ void TestWaylandSurface::testAttachBuffer()
buffer
->
unref
();
}
void
TestWaylandSurface
::
testDestroy
()
{
using
namespace
KWayland
::
Client
;
Surface
*
s
=
m_compositor
->
createSurface
();
connect
(
m_connection
,
&
ConnectionThread
::
connectionDied
,
s
,
&
Surface
::
destroy
);
connect
(
m_connection
,
&
ConnectionThread
::
connectionDied
,
m_compositor
,
&
Compositor
::
destroy
);
QVERIFY
(
s
->
isValid
());
QSignalSpy
connectionDiedSpy
(
m_connection
,
SIGNAL
(
connectionDied
()));
QVERIFY
(
connectionDiedSpy
.
isValid
());
delete
m_display
;
m_display
=
nullptr
;
m_compositorInterface
=
nullptr
;
QVERIFY
(
connectionDiedSpy
.
wait
());
// now the Surface should be destroyed;
QVERIFY
(
!
s
->
isValid
());
// calling destroy again should not fail
s
->
destroy
();
}
QTEST_MAIN
(
TestWaylandSurface
)
#include
"test_wayland_surface.moc"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment