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
bf1168db
Commit
bf1168db
authored
Sep 22, 2014
by
Martin Flöser
Browse files
Add test case for ShellSurface::destroy
parent
44a51fef
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wayland/autotests/client/test_wayland_shell.cpp
View file @
bf1168db
...
...
@@ -46,6 +46,7 @@ private Q_SLOTS:
void
testPing
();
void
testTitle
();
void
testWindowClass
();
void
testDestroy
();
private:
KWayland
::
Server
::
Display
*
m_display
;
...
...
@@ -299,5 +300,33 @@ void TestWaylandShell::testWindowClass()
QCOMPARE
(
windowClassSpy
.
first
().
first
().
toByteArray
(),
testClass
);
}
void
TestWaylandShell
::
testDestroy
()
{
using
namespace
KWayland
::
Client
;
QScopedPointer
<
Surface
>
s
(
m_compositor
->
createSurface
());
QVERIFY
(
!
s
.
isNull
());
QVERIFY
(
s
->
isValid
());
ShellSurface
*
surface
=
m_shell
->
createSurface
(
s
.
data
(),
m_shell
);
QVERIFY
(
surface
->
isValid
());
connect
(
m_connection
,
&
ConnectionThread
::
connectionDied
,
m_shell
,
&
Shell
::
destroy
);
connect
(
m_connection
,
&
ConnectionThread
::
connectionDied
,
m_compositor
,
&
Compositor
::
destroy
);
connect
(
m_connection
,
&
ConnectionThread
::
connectionDied
,
s
.
data
(),
&
Surface
::
destroy
);
QSignalSpy
connectionDiedSpy
(
m_connection
,
SIGNAL
(
connectionDied
()));
QVERIFY
(
connectionDiedSpy
.
isValid
());
delete
m_display
;
m_display
=
nullptr
;
m_compositorInterface
=
nullptr
;
m_shellInterface
=
nullptr
;
QVERIFY
(
connectionDiedSpy
.
wait
());
QVERIFY
(
!
m_shell
->
isValid
());
QVERIFY
(
!
surface
->
isValid
());
m_shell
->
destroy
();
surface
->
destroy
();
}
QTEST_MAIN
(
TestWaylandShell
)
#include
"test_wayland_shell.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