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
1=== modified file 'debian/control'
2--- debian/control 2016-09-01 23:13:26 +0000
3+++ debian/control 2016-09-06 20:27:50 +0000
4@@ -47,6 +47,7 @@
5 libxfixes-dev (>= 1:5.0.1),
6 libxi-dev (>= 2:1.7.1.901),
7 libxpathselect-dev (>=1.4),
8+ libxtst-dev,
9 libzeitgeist-2.0-dev,
10 pkg-config,
11 python (>= 2.7),
12
13=== modified file 'tests/CMakeLists.txt'
14--- tests/CMakeLists.txt 2015-12-17 22:32:37 +0000
15+++ tests/CMakeLists.txt 2016-09-06 20:27:50 +0000
16@@ -8,7 +8,7 @@
17 #
18 # Unit tests
19 #
20-set (TEST_DEPS "${UNITY_PLUGIN_DEPS};unity>=4.99.0;libupstart;")
21+set (TEST_DEPS "${UNITY_PLUGIN_DEPS};unity>=4.99.0;libupstart;xtst")
22 pkg_check_modules (TEST_UNIT_DEPS REQUIRED ${TEST_DEPS})
23
24 string (REPLACE ";" " " TEST_UNIT_DEPS_CFLAGS_OTHER "${TEST_UNIT_CFLAGS_OTHER}")
25
26=== modified file 'tests/test_xdnd_start_stop_notifier_imp.cpp'
27--- tests/test_xdnd_start_stop_notifier_imp.cpp 2015-09-30 20:59:26 +0000
28+++ tests/test_xdnd_start_stop_notifier_imp.cpp 2016-09-06 20:27:50 +0000
29@@ -24,7 +24,7 @@
30
31 #include <Nux/Nux.h>
32 #include <X11/Xlib.h>
33-//#include <X11/extensions/XTest.h>
34+#include <X11/extensions/XTest.h>
35
36 #include "unity-shared/WindowManager.h"
37 #include "test_utils.h"
38@@ -47,7 +47,7 @@
39 unity::XdndStartStopNotifierImp xdnd_start_stop_notifier;
40 };
41
42-TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalStarted))
43+TEST_F(TestXdndStartStopNotifierImp, SignalStarted)
44 {
45 bool signal_received = false;
46 xdnd_start_stop_notifier.started.connect([&](){
47@@ -55,15 +55,15 @@
48 });
49
50 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
51- //XTestFakeButtonEvent(display_, 1, True, CurrentTime);
52+ XTestFakeButtonEvent(display_, 1, True, CurrentTime);
53 auto& wm = unity::WindowManager::Default();
54 wm.window_mapped.emit(0);
55
56 Utils::WaitUntil(signal_received);
57- //XTestFakeButtonEvent(display_, 1, False, CurrentTime);
58+ XTestFakeButtonEvent(display_, 1, False, CurrentTime);
59 }
60
61-TEST_F(TestXdndStartStopNotifierImp, UNSTABLE_TEST(SignalFinished))
62+TEST_F(TestXdndStartStopNotifierImp, SignalFinished)
63 {
64 bool signal_received = false;
65 xdnd_start_stop_notifier.finished.connect([&](){
66@@ -71,34 +71,34 @@
67 });
68
69 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
70- //XTestFakeButtonEvent(display_, 1, True, CurrentTime);
71+ XTestFakeButtonEvent(display_, 1, True, CurrentTime);
72 auto& wm = unity::WindowManager::Default();
73 wm.window_mapped.emit(0);
74
75 Utils::WaitForTimeoutMSec(500);
76
77 XSetSelectionOwner(display_, selection_, None, CurrentTime);
78- //XTestFakeButtonEvent(display_, 1, False, CurrentTime);
79+ XTestFakeButtonEvent(display_, 1, False, CurrentTime);
80 wm.window_unmapped.emit(0);
81
82 Utils::WaitUntil(signal_received);
83 }
84
85-TEST_F(TestXdndStartStopNotifierImp, DISABLED_SignalFinished_QT)
86+TEST_F(TestXdndStartStopNotifierImp, SignalFinished_QT)
87 {
88 bool signal_received = false;
89- xdnd_start_stop_notifier.finished.connect([&](){
90+ xdnd_start_stop_notifier.finished.connect([&signal_received] {
91 signal_received = true;
92 });
93
94 XSetSelectionOwner(display_, selection_, owner_, CurrentTime);
95- //XTestFakeButtonEvent(display_, 1, True, CurrentTime);
96+ XTestFakeButtonEvent(display_, 1, True, CurrentTime);
97 auto& wm = unity::WindowManager::Default();
98 wm.window_mapped.emit(0);
99
100 Utils::WaitForTimeoutMSec(500);
101
102- //XTestFakeButtonEvent(display_, 1, False, CurrentTime);
103+ XTestFakeButtonEvent(display_, 1, False, CurrentTime);
104 wm.window_unmapped.emit(0);
105
106 Utils::WaitUntil(signal_received);