summaryrefslogtreecommitdiff
path: root/tests
diff options
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2015-10-16 08:45:50 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-10-16 08:45:50 +0000
commitf4633e5c51f2e1620a533b2c6b2f7c3a1a83d7b6 (patch)
tree8102f8a4c9823e12ce5c09a04c7a31f3c2e8dcca /tests
parentf0ec717da2c30b5bfbee99d6b6f60f4154f18567 (diff)
parent70dd0ea470cc4d742d07f0e68ea86c6c621b48fc (diff)
TestDash: Use local results in PreviewNavigateTests instead of online ones
They're just more reliable Approved by: Andrea Azzarone (bzr r4021)
Diffstat (limited to 'tests')
-rw-r--r--tests/autopilot/unity/tests/test_dash.py12
-rw-r--r--tests/test_icon_loader.cpp2
-rw-r--r--tests/test_launcher.cpp1
-rw-r--r--tests/test_main.cpp1
4 files changed, 9 insertions, 7 deletions
diff --git a/tests/autopilot/unity/tests/test_dash.py b/tests/autopilot/unity/tests/test_dash.py
index 26fb000f7..606144b8e 100644
--- a/tests/autopilot/unity/tests/test_dash.py
+++ b/tests/autopilot/unity/tests/test_dash.py
@@ -983,8 +983,8 @@ class PreviewInvocationTests(DashTestCase):
scope = self.unity.dash.reveal_application_scope()
self.addCleanup(self.unity.dash.ensure_hidden)
- # wait for "More suggestions" category
- category = self.wait_for_category(scope, _("More suggestions"))
+ # wait for "Installed" category
+ category = self.wait_for_category(scope, _("Installed"))
# wait for results
self.assertThat(lambda: len(category.get_results()), Eventually(GreaterThan(0), timeout=20))
@@ -1006,15 +1006,15 @@ class PreviewNavigateTests(DashTestCase):
scope = self.unity.dash.reveal_application_scope()
self.addCleanup(self.unity.dash.ensure_hidden)
- # wait for "More suggestions" category
- category = self.wait_for_category(scope, _("More suggestions"))
+ # wait for "Installed" category
+ category = self.wait_for_category(scope, _("Installed"))
# wait for results (we need 4 results to perorm the multi-navigation tests)
self.assertThat(lambda: len(category.get_results()), Eventually(GreaterThan(4), timeout=20))
results = category.get_results()
- result = results[2] # 2 so we can navigate left
- result.preview()
+ result = results[3] # 3 so we can navigate left multiple times
+ result.preview(button=3)
self.assertThat(self.unity.dash.view.preview_displaying, Eventually(Equals(True)))
self.assertThat(self.unity.dash.view.get_preview_container, Eventually(NotEquals(None)))
diff --git a/tests/test_icon_loader.cpp b/tests/test_icon_loader.cpp
index e14a67620..6b63f61ac 100644
--- a/tests/test_icon_loader.cpp
+++ b/tests/test_icon_loader.cpp
@@ -91,6 +91,8 @@ struct TestIconLoader : testing::Test
{
for (auto handle : handles_)
icon_loader.DisconnectHandle(handle);
+
+ Utils::WaitPendingEvents();
}
IconLoader& icon_loader;
diff --git a/tests/test_launcher.cpp b/tests/test_launcher.cpp
index 138716b4d..33893151a 100644
--- a/tests/test_launcher.cpp
+++ b/tests/test_launcher.cpp
@@ -224,7 +224,6 @@ TEST_F(TestLauncher, TestQuirksDuringDnd)
.WillRepeatedly(Return(false));
launcher_->DndStarted("");
- Utils::WaitPendingEvents();
EXPECT_FALSE(first->GetQuirk(launcher::AbstractLauncherIcon::Quirk::DESAT, launcher_->monitor()));
EXPECT_FALSE(second->GetQuirk(launcher::AbstractLauncherIcon::Quirk::DESAT, launcher_->monitor()));
diff --git a/tests/test_main.cpp b/tests/test_main.cpp
index 5321f8e52..5ce3aeca4 100644
--- a/tests/test_main.cpp
+++ b/tests/test_main.cpp
@@ -18,6 +18,7 @@ int main(int argc, char** argv)
const std::string LOCAL_DATA_DIR = BUILDDIR"/tests/data:/usr/share";
g_setenv("XDG_DATA_DIRS", LOCAL_DATA_DIR.c_str(), TRUE);
g_setenv("LC_ALL", "C", TRUE);
+ g_unsetenv("UPSTART_SESSION");
Utils::init_gsettings_test_environment();
gtk_init(&argc, &argv);