aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-26 19:55:23 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-03-26 19:55:23 +0000
commitb39526c27c44302c34fce26163919a0c4c7aecd3 (patch)
treebe0d3759a081f90b73aa90e0cf1b5a2a6a9783f3 /tests
parent8dbc66cab4eadfdde3809340d03c4cc10b2032eb (diff)
downloadayatana-indicator-datetime-b39526c27c44302c34fce26163919a0c4c7aecd3.tar.gz
ayatana-indicator-datetime-b39526c27c44302c34fce26163919a0c4c7aecd3.tar.bz2
ayatana-indicator-datetime-b39526c27c44302c34fce26163919a0c4c7aecd3.zip
URL dispatcher support: Build phone code, even if URL dispatcher is unavailable.
Diffstat (limited to 'tests')
-rw-r--r--tests/manual-test-snap.cpp4
-rw-r--r--tests/test-actions.cpp4
-rw-r--r--tests/test-exporter.cpp8
-rw-r--r--tests/test-formatter.cpp2
-rw-r--r--tests/test-live-actions.cpp2
-rw-r--r--tests/test-menus.cpp8
6 files changed, 4 insertions, 24 deletions
diff --git a/tests/manual-test-snap.cpp b/tests/manual-test-snap.cpp
index 04ba2c3..a0f80f2 100644
--- a/tests/manual-test-snap.cpp
+++ b/tests/manual-test-snap.cpp
@@ -18,8 +18,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifdef HAS_URLDISPATCHER
-
#include <datetime/appointment.h>
#include <datetime/settings-live.h>
#include <datetime/snap.h>
@@ -101,5 +99,3 @@ int main(int argc, const char* argv[])
g_main_loop_unref(loop);
return 0;
}
-
-#endif
diff --git a/tests/test-actions.cpp b/tests/test-actions.cpp
index 1352ddb..f8d1102 100644
--- a/tests/test-actions.cpp
+++ b/tests/test-actions.cpp
@@ -157,12 +157,10 @@ TEST_F(ActionsFixture, ActionsExist)
"desktop.open-alarm-app",
"desktop.open-calendar-app",
"desktop.open-settings-app",
-#ifdef HAS_URLDISPATCHER
"phone.open-appointment",
"phone.open-alarm-app",
"phone.open-calendar-app",
"phone.open-settings-app"
-#endif
};
for(const auto& name: names)
@@ -203,7 +201,6 @@ TEST_F(ActionsFixture, DesktopOpenSettingsApp)
****
***/
-#ifdef HAS_URLDISPATCHER
TEST_F(ActionsFixture, PhoneOpenAlarmApp)
{
test_action_with_no_args("phone.open-alarm-app",
@@ -227,7 +224,6 @@ TEST_F(ActionsFixture, PhoneOpenSettingsApp)
test_action_with_no_args("phone.open-settings-app",
MockActions::PhoneOpenSettingsApp);
}
-#endif
/***
****
diff --git a/tests/test-exporter.cpp b/tests/test-exporter.cpp
index 04c8445..647d6ff 100644
--- a/tests/test-exporter.cpp
+++ b/tests/test-exporter.cpp
@@ -111,19 +111,19 @@ TEST_F(ExporterFixture, Publish)
EXPECT_EQ(1, names.count("desktop.open-appointment"));
EXPECT_EQ(1, names.count("desktop.open-calendar-app"));
EXPECT_EQ(1, names.count("desktop.open-settings-app"));
-#ifdef HAS_URLDISPATCHER
+
EXPECT_EQ(1, names.count("phone.open-alarm-app"));
EXPECT_EQ(1, names.count("phone.open-appointment"));
EXPECT_EQ(1, names.count("phone.open-calendar-app"));
EXPECT_EQ(1, names.count("phone.open-settings-app"));
-#endif
+
EXPECT_EQ(1, names.count("calendar"));
EXPECT_EQ(1, names.count("desktop_greeter-header"));
EXPECT_EQ(1, names.count("desktop-header"));
-#ifdef HAS_URLDISPATCHER
+
EXPECT_EQ(1, names.count("phone_greeter-header"));
EXPECT_EQ(1, names.count("phone-header"));
-#endif
+
EXPECT_EQ(1, names.count("set-location"));
// try closing the connection prematurely
diff --git a/tests/test-formatter.cpp b/tests/test-formatter.cpp
index 4436ed1..855d4c5 100644
--- a/tests/test-formatter.cpp
+++ b/tests/test-formatter.cpp
@@ -84,7 +84,6 @@ class FormatterFixture: public GlibFixture
};
-#ifdef HAS_URLDISPATCHER
/**
* Test the phone header format
*/
@@ -109,7 +108,6 @@ TEST_F(FormatterFixture, TestPhoneHeader)
EXPECT_EQ(std::string(" 6:30 PM"), formatter.header.get());
}
}
-#endif
#define EM_SPACE "\u2003"
diff --git a/tests/test-live-actions.cpp b/tests/test-live-actions.cpp
index aade9c7..9f17001 100644
--- a/tests/test-live-actions.cpp
+++ b/tests/test-live-actions.cpp
@@ -94,7 +94,6 @@ namespace
const std::string calendar_app_url = "appid://com.ubuntu.calendar/calendar/current-user-version";
}
-#ifdef HAS_URLDISPATCHER
TEST_F(TimedateFixture, PhoneOpenAlarmApp)
{
m_actions->phone_open_alarm_app();
@@ -129,7 +128,6 @@ TEST_F(TimedateFixture, PhoneOpenSettingsApp)
const std::string expected = "settings:///system/time-date";
EXPECT_EQ(expected, m_live_actions->last_url);
}
-#endif
/***
****
diff --git a/tests/test-menus.cpp b/tests/test-menus.cpp
index e6d222a..c1dbb2d 100644
--- a/tests/test-menus.cpp
+++ b/tests/test-menus.cpp
@@ -97,10 +97,8 @@ protected:
if (profile == Menu::Desktop)
expected_action = "indicator.desktop.open-calendar-app";
-#ifdef HAS_URLDISPATCHER
else if (profile == Menu::Phone)
expected_action = "indicator.phone.open-calendar-app";
-#endif
else
expected_action = nullptr;
@@ -324,7 +322,6 @@ private:
g_clear_object(&submenu);
}
-#ifdef HAS_URLDISPATCHER
void InspectPhoneAppointments(GMenuModel* menu_model, bool can_open_planner)
{
auto submenu = g_menu_model_get_item_link(menu_model, 0, G_MENU_LINK_SUBMENU);
@@ -357,7 +354,6 @@ private:
// cleanup
g_clear_object(&submenu);
}
-#endif
protected:
@@ -375,7 +371,6 @@ protected:
InspectEmptySection(menu_model, Menu::Appointments);
break;
-#ifdef HAS_URLDISPATCHER
case Menu::Phone:
InspectPhoneAppointments(menu_model, can_open_planner);
break;
@@ -383,7 +378,6 @@ protected:
case Menu::PhoneGreeter:
InspectEmptySection(menu_model, Menu::Appointments);
break;
-#endif
default:
g_warn_if_reached();
@@ -455,10 +449,8 @@ protected:
if (profile == Menu::Desktop)
expected_action = "indicator.desktop.open-settings-app";
-#ifdef HAS_URLDISPATCHER
else if (profile == Menu::Phone)
expected_action = "indicator.phone.open-settings-app";
-#endif
// get the Settings section
auto submenu = g_menu_model_get_item_link(menu_model, 0, G_MENU_LINK_SUBMENU);