Merge lp:~azzar1/unity/fix-lc-failing-tests into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 3037
Proposed branch: lp:~azzar1/unity/fix-lc-failing-tests
Merge into: lp:unity
Diff against target: 59 lines (+20/-4)
1 file modified
tests/test_launcher_controller.cpp (+20/-4)
To merge this branch: bzr merge lp:~azzar1/unity/fix-lc-failing-tests
Reviewer Review Type Date Requested Status
Brandon Schaefer (community) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+143186@code.launchpad.net

Commit message

First attempt to fix failing gtest tests.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Looks good to me :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/test_launcher_controller.cpp'
2--- tests/test_launcher_controller.cpp 2012-12-13 12:29:02 +0000
3+++ tests/test_launcher_controller.cpp 2013-01-14 21:40:26 +0000
4@@ -459,8 +459,12 @@
5 uscreen.SetupFakeMultiMonitor();
6 lc.options()->hide_mode = LAUNCHER_HIDE_NEVER;
7
8+ auto check_fn = [this](int index) {
9+ return lc.launchers()[index]->GetParent()->InputWindowStrutsEnabled();
10+ };
11+
12 for (int i = 0; i < max_num_monitors; ++i)
13- ASSERT_TRUE(lc.launchers()[i]->GetParent()->InputWindowStrutsEnabled());
14+ Utils::WaitUntil(std::bind(check_fn, i));
15 }
16
17 TEST_F(TestLauncherController, DisabledStrutsOnAutoHide)
18@@ -469,8 +473,12 @@
19 uscreen.SetupFakeMultiMonitor();
20 lc.options()->hide_mode = LAUNCHER_HIDE_AUTOHIDE;
21
22+ auto check_fn = [this](int index) {
23+ return !(lc.launchers()[index]->GetParent()->InputWindowStrutsEnabled());
24+ };
25+
26 for (int i = 0; i < max_num_monitors; ++i)
27- ASSERT_FALSE(lc.launchers()[i]->GetParent()->InputWindowStrutsEnabled());
28+ Utils::WaitUntil(std::bind(check_fn, i));
29 }
30
31 TEST_F(TestLauncherController, EnabledStrutsAddingNewLaunchersOnAutoHide)
32@@ -486,8 +494,12 @@
33 // This makes the controller to add again new launchers
34 lc.multiple_launchers = true;
35
36+ auto check_fn = [this](int index) {
37+ return lc.launchers()[index]->GetParent()->InputWindowStrutsEnabled();
38+ };
39+
40 for (int i = 0; i < max_num_monitors; ++i)
41- ASSERT_TRUE(lc.launchers()[i]->GetParent()->InputWindowStrutsEnabled());
42+ Utils::WaitUntil(std::bind(check_fn, i));
43 }
44
45 TEST_F(TestLauncherController, DisabledStrutsAddingNewLaunchersOnNeverHide)
46@@ -503,8 +515,12 @@
47 // This makes the controller to add again new launchers
48 lc.multiple_launchers = true;
49
50+ auto check_fn = [this](int index) {
51+ return !(lc.launchers()[index]->GetParent()->InputWindowStrutsEnabled());
52+ };
53+
54 for (int i = 0; i < max_num_monitors; ++i)
55- ASSERT_FALSE(lc.launchers()[i]->GetParent()->InputWindowStrutsEnabled());
56+ Utils::WaitUntil(std::bind(check_fn, i));
57 }
58
59 TEST_F(TestLauncherController, CreateFavoriteInvalid)