aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-10-14 14:09:32 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-10-14 14:09:32 -0500
commitf599c1b1f4b7bc40d71b36409826dcab47e4b7af (patch)
tree423db66720b2b1e3c9e2f8a3d139175d337f6c1b /tests
parent407c63c08ab7c08085230712cf0d1020f01f1cc3 (diff)
downloadayatana-indicator-power-f599c1b1f4b7bc40d71b36409826dcab47e4b7af.tar.gz
ayatana-indicator-power-f599c1b1f4b7bc40d71b36409826dcab47e4b7af.tar.bz2
ayatana-indicator-power-f599c1b1f4b7bc40d71b36409826dcab47e4b7af.zip
move the mock battery from GSettings to DBus
Diffstat (limited to 'tests')
-rw-r--r--tests/manual34
1 files changed, 27 insertions, 7 deletions
diff --git a/tests/manual b/tests/manual
index a7351bc..1e6febd 100644
--- a/tests/manual
+++ b/tests/manual
@@ -1,17 +1,37 @@
Notes on Battery Testing
-Mock battery settings are available for testing purposes.
+Mock battery propreties are available for testing purposes.
-The indicator's schema name is "com.canonical.indicator.power" and there are four keys: "mock-battery-enabled" (a boolean), "mock-battery-level" (charger percent, an integer from 0-100), "mock-battery-charging" (a boolean of whether the mock battery is charging or discharging), and "mock-battery-minutes-left" (minutes remaining to charge/discharge).
+The testing properties are DBus properties published on busname "com.canonical.indicator.power", object path "/com/canonical/indicator/power/Testing", and interface "com.canonical.indicator.power.Testing". The four properties are "MockBatteryEnabled" (boolean, default false), "MockBatteryLevel" (uint32 [0-100], default 50), "MockBatteryState" (string, default 'discharging'), "MockBatteryMinutesLeft" (minutes remaining to charge/discharge, uint32, default 30).
Example use:
-$ gsettings reset-recursively com.canonical.indicator.power # reset settings to the default state
-$ gsettings list-recursively com.canonical.indicator.power | grep mock # show the current mock settings
-$ gsettings set com.canonical.indicator.power mock-battery-enabled true # use the mock battery
-$ gsettings set com.canonical.indicator.power mock-battery-level 10 # set the mock battery's charge to 10%
-$ gsettings set com.canonical.indicator.power mock-battery-enabled false # go back to production settings
+Show the testing properties:
+
+$ gdbus call --session --dest "com.canonical.indicator.power" \
+ --object-path /com/canonical/indicator/power/Testing \
+ --method org.freedesktop.DBus.Properties.GetAll \
+ com.canonical.indicator.power.Testing
+({'MockBatteryEnabled': <false>, 'MockBatteryLevel': <uint32 50>, 'MockBatteryState': <'discharging'>, 'MockBatteryMinutesLeft': <uint32 30>},)
+
+Enable the mock battery:
+
+$ gdbus call --session --dest "com.canonical.indicator.power" \
+ --object-path /com/canonical/indicator/power/Testing \
+ --method org.freedesktop.DBus.Properties.Set \
+ com.canonical.indicator.power.Testing \
+ MockBatteryEnabled \
+ "<true>"
+
+Set the mock battery's charge to 10%
+
+$ gdbus call --session --dest "com.canonical.indicator.power" \
+ --object-path /com/canonical/indicator/power/Testing \
+ --method org.freedesktop.DBus.Properties.Set \
+ com.canonical.indicator.power.Testing \
+ MockBatteryLevel \
+ "<uint32 10>"
Test-case indicator-power/unity7-items-check