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
8a6cbfd8
Commit
8a6cbfd8
authored
May 12, 2015
by
Martin Flöser
Browse files
[autotest] Make TestWaylandOutput more robust
If we use a thread for the connection we should also have an EventQueue.
parent
aaf64644
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wayland/autotests/client/test_wayland_output.cpp
View file @
8a6cbfd8
...
...
@@ -21,6 +21,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
#include
<QtTest/QtTest>
// KWin
#include
"../../src/client/connection_thread.h"
#include
"../../src/client/event_queue.h"
#include
"../../src/client/output.h"
#include
"../../src/client/registry.h"
#include
"../../src/server/display.h"
...
...
@@ -51,6 +52,7 @@ private:
KWayland
::
Server
::
Display
*
m_display
;
KWayland
::
Server
::
OutputInterface
*
m_serverOutput
;
KWayland
::
Client
::
ConnectionThread
*
m_connection
;
KWayland
::
Client
::
EventQueue
*
m_queue
;
QThread
*
m_thread
;
};
...
...
@@ -92,10 +94,19 @@ void TestWaylandOutput::init()
m_connection
->
initConnection
();
QVERIFY
(
connectedSpy
.
wait
());
m_queue
=
new
KWayland
::
Client
::
EventQueue
(
this
);
QVERIFY
(
!
m_queue
->
isValid
());
m_queue
->
setup
(
m_connection
);
QVERIFY
(
m_queue
->
isValid
());
}
void
TestWaylandOutput
::
cleanup
()
{
if
(
m_queue
)
{
delete
m_queue
;
m_queue
=
nullptr
;
}
if
(
m_thread
)
{
m_thread
->
quit
();
m_thread
->
wait
();
...
...
@@ -164,6 +175,7 @@ void TestWaylandOutput::testModeChanges()
using
namespace
KWayland
::
Client
;
KWayland
::
Client
::
Registry
registry
;
QSignalSpy
announced
(
&
registry
,
SIGNAL
(
outputAnnounced
(
quint32
,
quint32
)));
registry
.
setEventQueue
(
m_queue
);
registry
.
create
(
m_connection
->
display
());
QVERIFY
(
registry
.
isValid
());
registry
.
setup
();
...
...
@@ -201,7 +213,7 @@ void TestWaylandOutput::testModeChanges()
// change the current mode
outputChanged
.
clear
();
QSignalSpy
modeChangedSpy
(
&
output
,
SIGNAL
(
modeChanged
(
KWayland
::
Client
::
Output
::
M
ode
))
);
QSignalSpy
modeChangedSpy
(
&
output
,
&
KWayland
::
Client
::
Output
::
m
ode
Changed
);
QVERIFY
(
modeChangedSpy
.
isValid
());
m_serverOutput
->
setCurrentMode
(
QSize
(
800
,
600
));
QVERIFY
(
modeChangedSpy
.
wait
());
...
...
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