summaryrefslogtreecommitdiff
path: root/tests
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-09-06 22:24:00 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-09-06 22:24:00 +0200
commit117d97e12da2131ddcf5d325b0f8947b3f9c4333 (patch)
tree4a498e2d920e5ae0b524693962242cb667af1c4c /tests
parent858e4ed48b5a2a96ef6227b36017a419b9ad69dd (diff)
TestXdndStartStopNotifierImp: enable some unstable tests by adding XTest support
(bzr r4192.1.1)
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt2
-rw-r--r--tests/test_xdnd_start_stop_notifier_imp.cpp22
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 17ea9b758..35494138a 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -8,7 +8,7 @@ file (COPY ${CMAKE_CURRENT_SOURCE_DIR}/data DESTINATION ${CMAKE_BINARY_DIR}/test
#
# Unit tests
#
-set (TEST_DEPS "${UNITY_PLUGIN_DEPS};unity>=4.99.0;libupstart;")
+set (TEST_DEPS "${UNITY_PLUGIN_DEPS};unity>=4.99.0;libupstart;xtst")
pkg_check_modules (TEST_UNIT_DEPS REQUIRED ${TEST_DEPS})
string (REPLACE ";" " " TEST_UNIT_DEPS_CFLAGS_OTHER "${TEST_UNIT_CFLAGS_OTHER}")
diff --git a/tests/test_xdnd_start_stop_notifier_imp.cpp b/tests/test_xdnd_start_stop_notifier_imp.cpp
index 9811664ee..c8bf74b26 100644
--- a/tests/test_xdnd_start_stop_notifier_imp.cpp
+++ b/tests/test_xdnd_start_stop_notifier_imp.cpp
@@ -24,7 +24,7 @@ using namespace testing;
#include <Nux/Nux.h>
#include <X11/Xlib.h>
-//#include <X11/extensions/XTest.h>
+#include <X11/extensions/XTest.h>
#include "unity-shared/WindowManager.h"
#include "test_utils.h"
@@ -47,7 +47,7 @@ struct TestXdndStartStopNotifierImp : public Test {
unity::XdndStartStopNotifierImp xdnd_start_stop_notifier;
};
-TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalStarted))
+TEST_F(TestXdndStartStopNotifierImp, SignalStarted)
{
bool signal_received = false;
xdnd_start_stop_notifier.started.connect([&](){
@@ -55,15 +55,15 @@ TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalStarted))
});
XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
- //XTestFakeButtonEvent(display_, 1, True, CurrentTime);
+ XTestFakeButtonEvent(display_, 1, True, CurrentTime);
auto& wm = unity::WindowManager::Default();
wm.window_mapped.emit(0);
Utils::WaitUntil(signal_received);
- //XTestFakeButtonEvent(display_, 1, False, CurrentTime);
+ XTestFakeButtonEvent(display_, 1, False, CurrentTime);
}
-TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalFinished))
+TEST_F(TestXdndStartStopNotifierImp, SignalFinished)
{
bool signal_received = false;
xdnd_start_stop_notifier.finished.connect([&](){
@@ -71,34 +71,34 @@ TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalFinished))
});
XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
- //XTestFakeButtonEvent(display_, 1, True, CurrentTime);
+ XTestFakeButtonEvent(display_, 1, True, CurrentTime);
auto& wm = unity::WindowManager::Default();
wm.window_mapped.emit(0);
Utils::WaitForTimeoutMSec(500);
XSetSelectionOwner(display_, selection_, None, CurrentTime);
- //XTestFakeButtonEvent(display_, 1, False, CurrentTime);
+ XTestFakeButtonEvent(display_, 1, False, CurrentTime);
wm.window_unmapped.emit(0);
Utils::WaitUntil(signal_received);
}
-TEST_F(TestXdndStartStopNotifierImp, DISABLED_SignalFinished_QT)
+TEST_F(TestXdndStartStopNotifierImp, SignalFinished_QT)
{
bool signal_received = false;
- xdnd_start_stop_notifier.finished.connect([&](){
+ xdnd_start_stop_notifier.finished.connect([&signal_received] {
signal_received = true;
});
XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
- //XTestFakeButtonEvent(display_, 1, True, CurrentTime);
+ XTestFakeButtonEvent(display_, 1, True, CurrentTime);
auto& wm = unity::WindowManager::Default();
wm.window_mapped.emit(0);
Utils::WaitForTimeoutMSec(500);
- //XTestFakeButtonEvent(display_, 1, False, CurrentTime);
+ XTestFakeButtonEvent(display_, 1, False, CurrentTime);
wm.window_unmapped.emit(0);
Utils::WaitUntil(signal_received);