From cf943b8c9564a0cc8d215a7bc76a147bdd027aaf Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 9 Sep 2023 08:27:33 +0200 Subject: Drop custom notification hints --- tests/integration/indicator-sound-test-base.cpp | 10 ++-------- tests/notifications-mock.h | 4 ++-- tests/notifications-test.cc | 11 +---------- 3 files changed, 5 insertions(+), 20 deletions(-) (limited to 'tests') diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp index c201e27..eb4ee8c 100644 --- a/tests/integration/indicator-sound-test-base.cpp +++ b/tests/integration/indicator-sound-test-base.cpp @@ -1,6 +1,6 @@ /* * Copyright 2015 Canonical Ltd. - * Copyright 2021 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -72,7 +72,7 @@ void IndicatorSoundTestBase::SetUp() "GetCapabilities", "", "as", - "ret = ['actions', 'body', 'body-markup', 'icon-static', 'image/svg+xml', 'x-lomiri-private-synchronous', 'x-canonical-append', 'x-lomiri-private-icon-only', 'x-lomiri-truncation', 'x-canonical-truncation', 'private-synchronous', 'append', 'private-icon-only', 'truncation']" + "ret = ['actions', 'body', 'body-markup', 'icon-static', 'image/svg+xml', 'private-synchronous', 'append', 'private-icon-only', 'truncation']" ).waitForFinished(); int waitedTime = 0; @@ -647,14 +647,8 @@ void IndicatorSoundTestBase::checkVolumeNotification(double volume, QString cons QVariantMap hints; ASSERT_TRUE(qDBusArgumentToMap(args.at(6), hints)); ASSERT_TRUE(hints.contains("value")); - ASSERT_TRUE(hints.contains("x-lomiri-non-shaped-icon")); - ASSERT_TRUE(hints.contains("x-lomiri-value-bar-tint")); - ASSERT_TRUE(hints.contains("x-lomiri-private-synchronous")); EXPECT_EQ(volume*100, hints["value"]); - EXPECT_EQ(true, hints["x-lomiri-non-shaped-icon"]); - EXPECT_EQ(isLoud, hints["x-lomiri-value-bar-tint"]); - EXPECT_EQ(true, hints["x-lomiri-private-synchronous"]); } void IndicatorSoundTestBase::checkHighVolumeNotification(QVariantList call) diff --git a/tests/notifications-mock.h b/tests/notifications-mock.h index ad042d2..3ae8da5 100644 --- a/tests/notifications-mock.h +++ b/tests/notifications-mock.h @@ -1,6 +1,6 @@ /* * Copyright 2015 Canonical Ltd. - * Copyright 2021 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ class NotificationsMock DbusTestDbusMockObject * baseobj = nullptr; public: - NotificationsMock (const std::vector& capabilities = {"actions", "body", "body-markup", "icon-static", "image/svg+xml", "x-lomiri-private-synchronous", "x-canonical-append", "x-lomiri-private-icon-only", "x-lomiri-truncation", "x-canonical-truncation", "private-synchronous", "append", "private-icon-only", "truncation"}) { + NotificationsMock (const std::vector& capabilities = {"actions", "body", "body-markup", "icon-static", "image/svg+xml", "private-synchronous", "append", "private-icon-only", "truncation"}) { mock = dbus_test_dbus_mock_new("org.freedesktop.Notifications"); dbus_test_task_set_bus(DBUS_TEST_TASK(mock), DBUS_TEST_SERVICE_BUS_SESSION); dbus_test_task_set_name(DBUS_TEST_TASK(mock), "Notify"); diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc index 7f65104..0233ca6 100644 --- a/tests/notifications-test.cc +++ b/tests/notifications-test.cc @@ -1,6 +1,6 @@ /* * Copyright 2015-2016 Canonical Ltd. - * Copyright 2021 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -259,7 +259,6 @@ TEST_F(NotificationsTest, VolumeChanges) { EXPECT_EQ("ayatana-indicator-sound", notev[0].app_name); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ(0, notev[0].actions.size()); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-private-synchronous"]); EXPECT_GVARIANT_EQ("@i 50", notev[0].hints["value"]); /* Set a different volume */ @@ -432,7 +431,6 @@ TEST_F(NotificationsTest, DISABLED_HighVolume) { ASSERT_EQ(1, notev.size()); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ("Speakers", notev[0].body); - EXPECT_GVARIANT_EQ("@s 'false'", notev[0].hints["x-lomiri-value-bar-tint"]); /* Set high volume with volume change */ notifications->clearNotifications(); @@ -443,7 +441,6 @@ TEST_F(NotificationsTest, DISABLED_HighVolume) { ASSERT_LT(0, notev.size()); /* This passes with one or two since it would just be an update to the first if a second was sent */ EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ("Speakers", notev[0].body); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-value-bar-tint"]); /* Move it back */ volume_warning_mock_set_high_volume(VOLUME_WARNING_MOCK(volumeWarning.get()), false); @@ -459,7 +456,6 @@ TEST_F(NotificationsTest, DISABLED_HighVolume) { ASSERT_EQ(1, notev.size()); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ("Speakers", notev[0].body); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-value-bar-tint"]); } TEST_F(NotificationsTest, DISABLED_MenuHide) { @@ -513,7 +509,6 @@ TEST_F(NotificationsTest, DISABLED_ExtendendVolumeNotification) { EXPECT_EQ("ayatana-indicator-sound", notev[0].app_name); EXPECT_EQ("Volume", notev[0].summary); EXPECT_EQ(0, notev[0].actions.size()); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-private-synchronous"]); EXPECT_GVARIANT_EQ("@i 50", notev[0].hints["value"]); /* Allow an amplified volume */ @@ -628,14 +623,10 @@ TEST_F(NotificationsTest, DISABLED_TriggerWarning) { if (warning_expected) { EXPECT_TRUE(volume_warning_get_active(volumeWarning.get())); ASSERT_EQ(1, notev.size()); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-snap-decisions"]); - EXPECT_GVARIANT_EQ(nullptr, notev[0].hints["x-lomiri-private-synchronous"]); } else { EXPECT_FALSE(volume_warning_get_active(volumeWarning.get())); ASSERT_EQ(1, notev.size()); - EXPECT_GVARIANT_EQ(nullptr, notev[0].hints["x-lomiri-snap-decisions"]); - EXPECT_GVARIANT_EQ("@s 'true'", notev[0].hints["x-lomiri-private-synchronous"]); } } // multimedia_active -- cgit v1.2.3