diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-01-31 19:08:17 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-01-31 19:08:17 +0100 |
commit | 2a2db70bedf0c4a96282e417be433d2f23f6c465 (patch) | |
tree | febd31ea544a376d1fd04c0e830463d31d028dd9 /tests/notification-fixture.h | |
parent | d8debd706fe92de09e5c654c4ea2cc5dd5ce0529 (diff) | |
parent | 30b2de458752ad0855b508eb2f8ffeee85628cea (diff) | |
download | ayatana-indicator-datetime-2a2db70bedf0c4a96282e417be433d2f23f6c465.tar.gz ayatana-indicator-datetime-2a2db70bedf0c4a96282e417be433d2f23f6c465.tar.bz2 ayatana-indicator-datetime-2a2db70bedf0c4a96282e417be433d2f23f6c465.zip |
Merge branch 'personal/peat-psuwit/bring-back-lomiri-hints'
Attributes GH PR #115: https://github.com/AyatanaIndicators/ayatana-indicator-datetime/pull/115
Diffstat (limited to 'tests/notification-fixture.h')
-rw-r--r-- | tests/notification-fixture.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/notification-fixture.h b/tests/notification-fixture.h index 33bcd7e..5aedadc 100644 --- a/tests/notification-fixture.h +++ b/tests/notification-fixture.h @@ -77,6 +77,10 @@ protected: static constexpr char const * SIGNAL_CLOSED {"NotificationClosed"}; +#ifdef LOMIRI_FEATURES_ENABLED + static constexpr char const * HINT_LOMIRI_TIMEOUT {"x-lomiri-snap-decisions-timeout"}; +#endif + static constexpr char const * AS_BUSNAME {"org.freedesktop.Accounts"}; static constexpr char const * AS_INTERFACE {"com.lomiri.touch.AccountsService.Sound"}; static constexpr char const * PROP_OTHER_VIBRATIONS {"OtherVibrate"}; @@ -310,20 +314,31 @@ protected: super::TearDown(); } - void make_interactive() + void mock_capabilities(bool mock_lomiri_caps = false) { // GetCapabilities returns an array containing 'actions', // so our notifications will be interactive. - // For this test, it means we should get an expire_timeout - // that matches duration_minutes + + #ifndef LOMIRI_FEATURES_ENABLED + g_assert_false(mock_lomiri_caps); + #endif + + std::string python_code = + std::string("ret = ['actions', 'body'") + + #ifdef LOMIRI_FEATURES_ENABLED + (mock_lomiri_caps ? std::string(", '") + HINT_LOMIRI_TIMEOUT + "'" : "") + + #endif + "]"; + GError * error = nullptr; dbus_test_dbus_mock_object_add_method(notify_mock, notify_obj, METHOD_GET_CAPS, nullptr, G_VARIANT_TYPE_STRING_ARRAY, - "ret = ['actions', 'body']", + python_code.c_str(), &error); + g_assert_no_error (error); } |