aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2021-11-17 10:19:43 +0100
committerRobert Tari <robert@tari.in>2021-11-18 14:25:17 +0100
commitea5f8163231a81e4f0769a518db819c8a1fc78f6 (patch)
tree3bc2775ba0106e6c39bc8a129d6789d00c3bf841 /tests
parentdc16358bcceeb687df7f0a37fdcd3593844dcc7e (diff)
downloadayatana-indicator-datetime-ea5f8163231a81e4f0769a518db819c8a1fc78f6.tar.gz
ayatana-indicator-datetime-ea5f8163231a81e4f0769a518db819c8a1fc78f6.tar.bz2
ayatana-indicator-datetime-ea5f8163231a81e4f0769a518db819c8a1fc78f6.zip
Re-enable haptic using hfd-service
fixes https://github.com/AyatanaIndicators/ayatana-indicator-datetime/issues/67
Diffstat (limited to 'tests')
-rw-r--r--tests/manual2
-rw-r--r--tests/notification-fixture.h10
-rw-r--r--tests/test-notification.cpp4
3 files changed, 7 insertions, 9 deletions
diff --git a/tests/manual b/tests/manual
index d9e192c..cafc292 100644
--- a/tests/manual
+++ b/tests/manual
@@ -35,7 +35,7 @@ Test-case ayatana-indicator-datetime/new-alarm-wakeup
<dt>Unplug the phone from any USB connection and put it to sleep</dt>
<dd>Confirm that the alarm sounds on time even if the phone is asleep. (Note: if in doubt about sleep you can see in the syslog whether the device actually suspended or whether the suspend was aborted)</dd>
<dd>Confirm that the screen comes on when the alarm is triggered.<dd>
- <dd>[FIXME: No haptic support right now. Remove this comment after https://github.com/AyatanaIndicators/ayatana-indicator-datetime/issues/67 is resolved] If the device supports haptic feedback, confirm the alarm vibrates.</dd>
+ <dd>If the device supports haptic feedback, confirm the alarm vibrates.</dd>
</dl>
Test-case ayatana-indicator-datetime/disabled-alarms
diff --git a/tests/notification-fixture.h b/tests/notification-fixture.h
index acb3e63..2349bab 100644
--- a/tests/notification-fixture.h
+++ b/tests/notification-fixture.h
@@ -52,7 +52,7 @@ protected:
static constexpr char const * NOTIFY_INTERFACE {"org.freedesktop.Notifications"};
static constexpr char const * NOTIFY_PATH {"/org/freedesktop/Notifications"};
- static constexpr char const * HAPTIC_METHOD_VIBRATE_PATTERN {"VibratePattern"};
+ static constexpr char const * HAPTIC_METHOD_VIBRATE {"vibrate"};
static constexpr int SCREEN_COOKIE {8675309};
static constexpr char const * SCREEN_METHOD_KEEP_DISPLAY_ON {"keepDisplayOn"};
@@ -279,8 +279,6 @@ protected:
g_assert_no_error (error);
dbus_test_service_add_task(service, DBUS_TEST_TASK(screen_mock));
- //TODO: Reimplement using hfd-service
- /*
///
/// Add the haptic mock
///
@@ -292,13 +290,13 @@ protected:
&error);
dbus_test_dbus_mock_object_add_method(haptic_mock,
haptic_obj,
- HAPTIC_METHOD_VIBRATE_PATTERN,
- G_VARIANT_TYPE("(auu)"),
+ HAPTIC_METHOD_VIBRATE,
+ G_VARIANT_TYPE("i"),
nullptr,
"",
&error);
g_assert_no_error (error);
- dbus_test_service_add_task(service, DBUS_TEST_TASK(haptic_mock));*/
+ dbus_test_service_add_task(service, DBUS_TEST_TASK(haptic_mock));
startDbusMock();
}
diff --git a/tests/test-notification.cpp b/tests/test-notification.cpp
index 80eb04c..7dccb96 100644
--- a/tests/test-notification.cpp
+++ b/tests/test-notification.cpp
@@ -158,9 +158,9 @@ TEST_F(NotificationFixture,Notification)
// confirm that the vibration was as expected
if (expected_vibrate_called) {
- EXPECT_METHOD_CALLED_EVENTUALLY(haptic_mock, haptic_obj, HAPTIC_METHOD_VIBRATE_PATTERN);
+ EXPECT_METHOD_CALLED_EVENTUALLY(haptic_mock, haptic_obj, HAPTIC_METHOD_VIBRATE);
} else {
- EXPECT_METHOD_NOT_CALLED_EVENTUALLY(haptic_mock, haptic_obj, HAPTIC_METHOD_VIBRATE_PATTERN);
+ EXPECT_METHOD_NOT_CALLED_EVENTUALLY(haptic_mock, haptic_obj, HAPTIC_METHOD_VIBRATE);
}
// confirm that the notification was as expected