Merge lp:~3v1n0/unity/xdnd-tests-enable into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: no longer in the source branch.
Merged at revision: 4196
Proposed branch: lp:~3v1n0/unity/xdnd-tests-enable
Merge into: lp:unity
Diff against target: 106 lines (+13/-12)
3 files modified
debian/control (+1/-0)
tests/CMakeLists.txt (+1/-1)
tests/test_xdnd_start_stop_notifier_imp.cpp (+11/-11)
To merge this branch: bzr merge lp:~3v1n0/unity/xdnd-tests-enable
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+305052@code.launchpad.net

Commit message

TestXdndStartStopNotifierImp: enable some unstable tests by adding XTest support

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2016-09-01 23:13:26 +0000
+++ debian/control 2016-09-06 20:27:50 +0000
@@ -47,6 +47,7 @@
47 libxfixes-dev (>= 1:5.0.1),47 libxfixes-dev (>= 1:5.0.1),
48 libxi-dev (>= 2:1.7.1.901),48 libxi-dev (>= 2:1.7.1.901),
49 libxpathselect-dev (>=1.4),49 libxpathselect-dev (>=1.4),
50 libxtst-dev,
50 libzeitgeist-2.0-dev,51 libzeitgeist-2.0-dev,
51 pkg-config,52 pkg-config,
52 python (>= 2.7),53 python (>= 2.7),
5354
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2015-12-17 22:32:37 +0000
+++ tests/CMakeLists.txt 2016-09-06 20:27:50 +0000
@@ -8,7 +8,7 @@
8#8#
9# Unit tests9# Unit tests
10#10#
11set (TEST_DEPS "${UNITY_PLUGIN_DEPS};unity>=4.99.0;libupstart;")11set (TEST_DEPS "${UNITY_PLUGIN_DEPS};unity>=4.99.0;libupstart;xtst")
12pkg_check_modules (TEST_UNIT_DEPS REQUIRED ${TEST_DEPS})12pkg_check_modules (TEST_UNIT_DEPS REQUIRED ${TEST_DEPS})
1313
14string (REPLACE ";" " " TEST_UNIT_DEPS_CFLAGS_OTHER "${TEST_UNIT_CFLAGS_OTHER}")14string (REPLACE ";" " " TEST_UNIT_DEPS_CFLAGS_OTHER "${TEST_UNIT_CFLAGS_OTHER}")
1515
=== modified file 'tests/test_xdnd_start_stop_notifier_imp.cpp'
--- tests/test_xdnd_start_stop_notifier_imp.cpp 2015-09-30 20:59:26 +0000
+++ tests/test_xdnd_start_stop_notifier_imp.cpp 2016-09-06 20:27:50 +0000
@@ -24,7 +24,7 @@
2424
25#include <Nux/Nux.h>25#include <Nux/Nux.h>
26#include <X11/Xlib.h>26#include <X11/Xlib.h>
27//#include <X11/extensions/XTest.h>27#include <X11/extensions/XTest.h>
2828
29#include "unity-shared/WindowManager.h"29#include "unity-shared/WindowManager.h"
30#include "test_utils.h"30#include "test_utils.h"
@@ -47,7 +47,7 @@
47 unity::XdndStartStopNotifierImp xdnd_start_stop_notifier;47 unity::XdndStartStopNotifierImp xdnd_start_stop_notifier;
48};48};
4949
50TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalStarted))50TEST_F(TestXdndStartStopNotifierImp, SignalStarted)
51{51{
52 bool signal_received = false;52 bool signal_received = false;
53 xdnd_start_stop_notifier.started.connect([&](){53 xdnd_start_stop_notifier.started.connect([&](){
@@ -55,15 +55,15 @@
55 });55 });
5656
57 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);57 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
58 //XTestFakeButtonEvent(display_, 1, True, CurrentTime);58 XTestFakeButtonEvent(display_, 1, True, CurrentTime);
59 auto& wm = unity::WindowManager::Default();59 auto& wm = unity::WindowManager::Default();
60 wm.window_mapped.emit(0);60 wm.window_mapped.emit(0);
6161
62 Utils::WaitUntil(signal_received);62 Utils::WaitUntil(signal_received);
63 //XTestFakeButtonEvent(display_, 1, False, CurrentTime);63 XTestFakeButtonEvent(display_, 1, False, CurrentTime);
64}64}
6565
66TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalFinished))66TEST_F(TestXdndStartStopNotifierImp, SignalFinished)
67{67{
68 bool signal_received = false;68 bool signal_received = false;
69 xdnd_start_stop_notifier.finished.connect([&](){69 xdnd_start_stop_notifier.finished.connect([&](){
@@ -71,34 +71,34 @@
71 });71 });
7272
73 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);73 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
74 //XTestFakeButtonEvent(display_, 1, True, CurrentTime);74 XTestFakeButtonEvent(display_, 1, True, CurrentTime);
75 auto& wm = unity::WindowManager::Default();75 auto& wm = unity::WindowManager::Default();
76 wm.window_mapped.emit(0);76 wm.window_mapped.emit(0);
7777
78 Utils::WaitForTimeoutMSec(500);78 Utils::WaitForTimeoutMSec(500);
7979
80 XSetSelectionOwner(display_, selection_, None, CurrentTime);80 XSetSelectionOwner(display_, selection_, None, CurrentTime);
81 //XTestFakeButtonEvent(display_, 1, False, CurrentTime);81 XTestFakeButtonEvent(display_, 1, False, CurrentTime);
82 wm.window_unmapped.emit(0);82 wm.window_unmapped.emit(0);
8383
84 Utils::WaitUntil(signal_received);84 Utils::WaitUntil(signal_received);
85}85}
8686
87TEST_F(TestXdndStartStopNotifierImp, DISABLED_SignalFinished_QT)87TEST_F(TestXdndStartStopNotifierImp, SignalFinished_QT)
88{88{
89 bool signal_received = false;89 bool signal_received = false;
90 xdnd_start_stop_notifier.finished.connect([&](){90 xdnd_start_stop_notifier.finished.connect([&signal_received] {
91 signal_received = true;91 signal_received = true;
92 });92 });
9393
94 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);94 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
95 //XTestFakeButtonEvent(display_, 1, True, CurrentTime);95 XTestFakeButtonEvent(display_, 1, True, CurrentTime);
96 auto& wm = unity::WindowManager::Default();96 auto& wm = unity::WindowManager::Default();
97 wm.window_mapped.emit(0);97 wm.window_mapped.emit(0);
9898
99 Utils::WaitForTimeoutMSec(500);99 Utils::WaitForTimeoutMSec(500);
100100
101 //XTestFakeButtonEvent(display_, 1, False, CurrentTime);101 XTestFakeButtonEvent(display_, 1, False, CurrentTime);
102 wm.window_unmapped.emit(0);102 wm.window_unmapped.emit(0);
103103
104 Utils::WaitUntil(signal_received);104 Utils::WaitUntil(signal_received);