From e917d3a28a238208ecf786cfda93dcd2893e3df2 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Thu, 26 Oct 2017 23:19:26 +0200 Subject: Fork from Ubuntu's Indicator Messages. --- tests/Makefile.am | 7 +++---- tests/accounts-service-mock.h | 2 +- tests/indicator-test.cpp | 18 +++++++++--------- tests/test-client.py | 6 +++--- tests/test-gactionmuxer.cpp | 10 +++++----- 5 files changed, 21 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.am b/tests/Makefile.am index bd559fd..7e23adc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,3 @@ - CLEANFILES= check_LTLIBRARIES = libgtest.la check_PROGRAMS = test-gactionmuxer @@ -47,7 +46,7 @@ indicator_test_SOURCES = \ indicator-test.cpp indicator_test_CPPFLAGS = \ - -DINDICATOR_MESSAGES_SERVICE_BINARY="\"$(abs_top_builddir)/src/indicator-messages-service\"" \ + -DINDICATOR_MESSAGES_SERVICE_BINARY="\"$(abs_top_builddir)/src/ayatana-indicator-messages-service\"" \ -DSCHEMA_DIR="\"$(SCHEMA_COMPILED_DIR)\"" \ -DXDG_DATA_DIRS="\"$(abs_srcdir)/\"" \ -I$(top_srcdir)/libmessaging-menu \ @@ -91,7 +90,7 @@ libindicator_messages_service_la_SOURCES = \ $(top_srcdir)/src/dbus-data.h libindicator_messages_service_ladir = \ - $(includedir)/libindicator-messages-service/ + $(includedir)/libayatana-indicator-messages-service/ libindicator_messages_service_la_CFLAGS = \ $(APPLET_CFLAGS) \ @@ -103,7 +102,7 @@ libindicator_messages_service_la_CFLAGS = \ -Wl,-z,defs \ -Wl,--as-needed \ -Werror -Wno-error=deprecated-declarations \ - -DG_LOG_DOMAIN=\"Indicator-Messages\" + -DG_LOG_DOMAIN=\"Ayatana-Indicator-Messages\" libindicator_messages_service_la_LIBADD = \ $(APPLET_LIBS) diff --git a/tests/accounts-service-mock.h b/tests/accounts-service-mock.h index 301fcd4..268183a 100644 --- a/tests/accounts-service-mock.h +++ b/tests/accounts-service-mock.h @@ -60,7 +60,7 @@ class AccountsServiceMock "SetXHasMessages", G_VARIANT_TYPE_BOOLEAN, nullptr, "", NULL); - soundobj = dbus_test_dbus_mock_get_object(mock, "/user", "com.canonical.indicator.sound.AccountsService", NULL); + soundobj = dbus_test_dbus_mock_get_object(mock, "/user", "org.ayatana.indicator.sound.AccountsService", NULL); dbus_test_dbus_mock_object_add_property(mock, soundobj, "Timestamp", G_VARIANT_TYPE_UINT64, g_variant_new_uint64(0), NULL); diff --git a/tests/indicator-test.cpp b/tests/indicator-test.cpp index 0991db5..6c256fb 100644 --- a/tests/indicator-test.cpp +++ b/tests/indicator-test.cpp @@ -30,7 +30,7 @@ class IndicatorTest : public IndicatorFixture { protected: IndicatorTest (void) : - IndicatorFixture(INDICATOR_MESSAGES_SERVICE_BINARY, "com.canonical.indicator.messages") + IndicatorFixture(INDICATOR_MESSAGES_SERVICE_BINARY, "org.ayatana.indicator.messages") { } @@ -60,7 +60,7 @@ protected: TEST_F(IndicatorTest, RootAction) { - setActions("/com/canonical/indicator/messages"); + setActions("/org/ayatana/indicator/messages"); EXPECT_EVENTUALLY_ACTION_EXISTS("messages"); EXPECT_ACTION_STATE_TYPE("messages", G_VARIANT_TYPE("a{sv}")); @@ -68,7 +68,7 @@ TEST_F(IndicatorTest, RootAction) { } TEST_F(IndicatorTest, SingleMessage) { - setActions("/com/canonical/indicator/messages"); + setActions("/org/ayatana/indicator/messages"); auto app = std::shared_ptr(messaging_menu_app_new("test.desktop"), [](MessagingMenuApp * app) { g_clear_object(&app); }); ASSERT_NE(nullptr, app); @@ -87,9 +87,9 @@ TEST_F(IndicatorTest, SingleMessage) { EXPECT_EVENTUALLY_ACTION_EXISTS("test.msg.testid"); - setMenu("/com/canonical/indicator/messages/phone"); + setMenu("/org/ayatana/indicator/messages/phone"); - EXPECT_EVENTUALLY_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-type", "com.canonical.indicator.messages.messageitem"); + EXPECT_EVENTUALLY_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-type", "org.ayatana.indicator.messages.messageitem"); EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "label", "Test Title"); EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-message-id", "testid"); EXPECT_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-subtitle", "A subtitle too"); @@ -103,7 +103,7 @@ messageReplyActivate (GObject * obj, gchar * name, GVariant * value, gpointer us } TEST_F(IndicatorTest, MessageReply) { - setActions("/com/canonical/indicator/messages"); + setActions("/org/ayatana/indicator/messages"); auto app = std::shared_ptr(messaging_menu_app_new("test.desktop"), [](MessagingMenuApp * app) { g_clear_object(&app); }); ASSERT_NE(nullptr, app); @@ -131,9 +131,9 @@ TEST_F(IndicatorTest, MessageReply) { EXPECT_ACTION_ENABLED("remove-all", true); - setMenu("/com/canonical/indicator/messages/phone"); + setMenu("/org/ayatana/indicator/messages/phone"); - EXPECT_EVENTUALLY_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-type", "com.canonical.indicator.messages.messageitem"); + EXPECT_EVENTUALLY_MENU_ATTRIB(std::vector({0, 0, 0}), "x-canonical-type", "org.ayatana.indicator.messages.messageitem"); std::string activateResponse; g_signal_connect(msg.get(), "activate", G_CALLBACK(messageReplyActivate), &activateResponse); @@ -149,7 +149,7 @@ TEST_F(IndicatorTest, IconNotification) { auto normalicon = std::shared_ptr(g_variant_ref_sink(g_variant_new_parsed("{'icon': <('themed', <['indicator-messages-offline', 'indicator-messages', 'indicator']>)>, 'title': <'Notifications'>, 'accessible-desc': <'Messages'>, 'visible': }")), [](GVariant *var) {if (var != nullptr) g_variant_unref(var); }); auto blueicon = std::shared_ptr(g_variant_ref_sink(g_variant_new_parsed("{'icon': <('themed', <['indicator-messages-new-offline', 'indicator-messages-new', 'indicator-messages', 'indicator']>)>, 'title': <'Notifications'>, 'accessible-desc': <'New Messages'>, 'visible': }")), [](GVariant *var) {if (var != nullptr) g_variant_unref(var); }); - setActions("/com/canonical/indicator/messages"); + setActions("/org/ayatana/indicator/messages"); auto app = std::shared_ptr(messaging_menu_app_new("test.desktop"), [](MessagingMenuApp * app) { g_clear_object(&app); }); ASSERT_NE(nullptr, app); diff --git a/tests/test-client.py b/tests/test-client.py index 0dbf868..5baa795 100755 --- a/tests/test-client.py +++ b/tests/test-client.py @@ -16,9 +16,9 @@ class MessagingMenuTest(dbusmock.DBusTestCase): klass.bus = klass.get_dbus(False) def setUp(self): - name = 'com.canonical.indicator.messages' - obj_path = '/com/canonical/indicator/messages/service' - iface = 'com.canonical.indicator.messages.service' + name = 'org.ayatana.indicator.messages' + obj_path = '/org/ayatana/indicator/messages/service' + iface = 'org.ayatana.indicator.messages.service' self.messaging_service = self.spawn_server(name, obj_path, iface, stdout=subprocess.PIPE) self.mock = dbus.Interface(self.bus.get_object(name, obj_path), dbusmock.MOCK_IFACE) diff --git a/tests/test-gactionmuxer.cpp b/tests/test-gactionmuxer.cpp index 5c98c90..f11f50d 100644 --- a/tests/test-gactionmuxer.cpp +++ b/tests/test-gactionmuxer.cpp @@ -46,11 +46,11 @@ TEST(GActionMuxerTest, Sanity) { g_type_init (); #endif - g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*G_IS_ACTION_MUXER*"); + g_test_expect_message ("Ayatana-Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*G_IS_ACTION_MUXER*"); g_action_muxer_insert (NULL, NULL, NULL); g_test_assert_expected_messages (); - g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*G_IS_ACTION_MUXER*"); + g_test_expect_message ("Ayatana-Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*G_IS_ACTION_MUXER*"); g_action_muxer_remove (NULL, NULL); g_test_assert_expected_messages (); @@ -59,15 +59,15 @@ TEST(GActionMuxerTest, Sanity) { g_action_muxer_insert (muxer, NULL, NULL); g_action_muxer_remove (muxer, NULL); - g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*"); + g_test_expect_message ("Ayatana-Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*"); EXPECT_FALSE (g_action_group_has_action (G_ACTION_GROUP (muxer), NULL)); g_test_assert_expected_messages (); - g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*"); + g_test_expect_message ("Ayatana-Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*"); EXPECT_FALSE (g_action_group_get_action_enabled (G_ACTION_GROUP (muxer), NULL)); g_test_assert_expected_messages (); - g_test_expect_message ("Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*"); + g_test_expect_message ("Ayatana-Indicator-Messages", G_LOG_LEVEL_CRITICAL, "*NULL*"); EXPECT_FALSE (g_action_group_query_action (G_ACTION_GROUP (muxer), NULL, NULL, NULL, NULL, NULL, NULL)); g_test_assert_expected_messages (); -- cgit v1.2.3