diff options
author | William Hua <william.hua@canonical.com> | 2013-06-27 01:04:55 -0400 |
---|---|---|
committer | William Hua <william.hua@canonical.com> | 2013-06-27 01:04:55 -0400 |
commit | ae6ef44de8fabb6728b66d95147d99f0a0d13880 (patch) | |
tree | 4070de7c98799eab59c2715653cd7d06357300d1 /tests/main.vala | |
parent | b68e1b1cb9063a081dc301d17a64c8bc1e19d7d2 (diff) | |
download | ayatana-indicator-keyboard-ae6ef44de8fabb6728b66d95147d99f0a0d13880.tar.gz ayatana-indicator-keyboard-ae6ef44de8fabb6728b66d95147d99f0a0d13880.tar.bz2 ayatana-indicator-keyboard-ae6ef44de8fabb6728b66d95147d99f0a0d13880.zip |
Continued tests work-in-progress.
Diffstat (limited to 'tests/main.vala')
-rw-r--r-- | tests/main.vala | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/main.vala b/tests/main.vala index 20704001..d308ef04 100644 --- a/tests/main.vala +++ b/tests/main.vala @@ -46,6 +46,7 @@ static void begin_test (void *data) { (connection, name) => { if (loop.is_running ()) { fixture.connection = connection; + loop.quit (); } }, @@ -87,14 +88,14 @@ static void end_test (void *data) { fixture.object_name = 0; } - fixture.service = null; - fixture.connection = null; - if (fixture.service_name != 0) { Bus.unown_name (fixture.service_name); fixture.service_name = 0; } + fixture.service = null; + fixture.connection = null; + if (fixture.bus != null) { ((!) fixture.bus).down (); fixture.bus = null; @@ -113,6 +114,10 @@ static void test_activate_character_map (void *data) { return; } + var settings = new Settings ("org.gnome.desktop.input-sources"); + settings.set_uint ("current", 0); + settings.set_value ("sources", new Variant.parsed ("[('xkb', 'us'), ('ibus', 'pinyin')]")); + var cancellable = new Cancellable (); DBusProxy action_proxy; DBusProxy menu_proxy; @@ -165,6 +170,17 @@ static void test_activate_character_map (void *data) { return; } + { + var builder = new VariantBuilder (new VariantType ("(au)")); + builder.open (new VariantType ("au")); + builder.add ("u", 0); + builder.add ("u", 1); + builder.close (); + var variant = builder.end (); + stdout.printf ("%s\n", menu_proxy.call_sync ("Start", variant, DBusCallFlags.NONE, SHORT_TIMEOUT).print (true)); + menu_proxy.call_sync ("End", variant, DBusCallFlags.NONE, SHORT_TIMEOUT); + } + var loop = new MainLoop (null, false); var signal_name = ((!) fixture.service).notify["command"].connect ((pspec) => { @@ -199,9 +215,12 @@ static void test_update_input_source (void *data) { } static void test_update_input_sources (void *data) { + Test.fail (); } public int main (string[] args) { + Environment.set_variable ("DCONF_PROFILE", DCONF_PROFILE, true); + Test.init (ref args, null); var suite = new TestSuite ("indicator-keyboard"); |