summaryrefslogtreecommitdiff
path: root/tests
diff options
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2016-10-27 08:40:57 +0000
committerBileto Bot <ci-train-bot@canonical.com>2016-10-27 08:40:57 +0000
commitcc89bb5d22c464aa4f87ff7e50912404e7846b3e (patch)
tree046561f31914998b9919b5a8084c589cc8eb5591 /tests
parent576e93f3618d791609da0fd892d001d254f4fed8 (diff)
parent117d97e12da2131ddcf5d325b0f8947b3f9c4333 (diff)
TestXdndStartStopNotifierImp: enable some unstable tests by adding XTest support
Approved by: Andrea Azzarone (bzr r4196)
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 d1f58d33c..4d949ae50 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);