aboutsummaryrefslogtreecommitdiff
path: root/tests/main.vala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/main.vala')
-rw-r--r--tests/main.vala25
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");