aboutsummaryrefslogtreecommitdiff
path: root/tests/client
diff options
context:
space:
mode:
Diffstat (limited to 'tests/client')
-rw-r--r--tests/client/actiongrouptest.cpp9
-rwxr-xr-xtests/client/script_actiongrouptest.py5
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/client/actiongrouptest.cpp b/tests/client/actiongrouptest.cpp
index 3e0065f..d187ea7 100644
--- a/tests/client/actiongrouptest.cpp
+++ b/tests/client/actiongrouptest.cpp
@@ -141,11 +141,16 @@ private Q_SLOTS:
QStateAction *act = m_actionGroup.action(action.toString());
QVERIFY(act);
- act->activate();
+ // test action name
+ QCOMPARE(act->property("name").toString(), QString("Menu1Act"));
+
+ act->activate(QVariant("42"));
// wait for dbus propagation
QTest::qWait(500);
- QCOMPARE(m_script.popActivatedAction(), QString("Menu1Act"));
+ QPair<QString, QVariant> result = m_script.popActivatedAction();
+ QCOMPARE(result.first, QString("Menu1Act"));
+ QCOMPARE(result.second.toString(), QString("42"));
}
/*
diff --git a/tests/client/script_actiongrouptest.py b/tests/client/script_actiongrouptest.py
index 2af4841..bb54dae 100755
--- a/tests/client/script_actiongrouptest.py
+++ b/tests/client/script_actiongrouptest.py
@@ -3,10 +3,11 @@
import time
from gi.repository import GLib
from menuscript import Script, ActionList, MENU_OBJECT_PATH
+from gi._gi import variant_type_from_string
al = ActionList(MENU_OBJECT_PATH)
-al.appendItem("Menu0", "Menu0Act")
-al.appendItem("Menu1", "Menu1Act")
+al.appendItem("Menu0", "Menu0Act", actionStateType=variant_type_from_string('s'))
+al.appendItem("Menu1", "Menu1Act", actionStateType=variant_type_from_string('s'))
al.removeItem("1", "Menu1Act")
t = Script.create(al)