From 4fe05a566d91cfb835d4370254f83638824e1ad7 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 17 Jul 2019 02:16:45 -0400 Subject: [PATCH] tests: Test exposing the notification persistence and animation props --- tests/test-naughty-legacy.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/test-naughty-legacy.lua b/tests/test-naughty-legacy.lua index 14875fe3..07d626dd 100644 --- a/tests/test-naughty-legacy.lua +++ b/tests/test-naughty-legacy.lua @@ -3,6 +3,7 @@ local spawn = require("awful.spawn") local naughty = require("naughty" ) local gdebug = require("gears.debug") +local gtable = require("gears.table") local cairo = require("lgi" ).cairo local beautiful = require("beautiful") local Gio = require("lgi" ).Gio @@ -782,6 +783,38 @@ table.insert(steps, function() return true end) +-- Test that exposing support for animations and persistence are exposed to DBus. +table.insert(steps, function() + assert(not naughty.persistence_enabled) + assert(not naughty.image_animations_enabled) + + assert(gtable.hasitem(naughty.dbus._capabilities, "icon-static")) + assert(not gtable.hasitem(naughty.dbus._capabilities, "icon-multi")) + assert(not gtable.hasitem(naughty.dbus._capabilities, "persistence")) + + naughty.persistence_enabled = true + naughty.image_animations_enabled = true + + assert(naughty.persistence_enabled) + assert(naughty.image_animations_enabled) + + assert(gtable.hasitem(naughty.dbus._capabilities, "icon-multi")) + assert(gtable.hasitem(naughty.dbus._capabilities, "persistence")) + assert(not gtable.hasitem(naughty.dbus._capabilities, "icon-static")) + + naughty.persistence_enabled = false + naughty.image_animations_enabled = false + + assert(not naughty.persistence_enabled) + assert(not naughty.image_animations_enabled) + + assert( gtable.hasitem(naughty.dbus._capabilities, "icon-static")) + assert(not gtable.hasitem(naughty.dbus._capabilities, "icon-multi" )) + assert(not gtable.hasitem(naughty.dbus._capabilities, "persistence")) + + return true +end) + -- Now check if the old deprecated (but still supported) APIs don't have errors. table.insert(steps, function() -- Tests are (by default) not allowed to call deprecated APIs