@@ -24,11 +24,21 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
24
24
auto *m17n = instance->addonManager ().addon (" m17n" , true );
25
25
FCITX_ASSERT (m17n);
26
26
auto defaultGroup = instance->inputMethodManager ().currentGroup ();
27
+ std::string wijesekaraName;
28
+ if (instance->inputMethodManager ().entry (" m17n_si_wijesekera" )) {
29
+ wijesekaraName = " m17n_si_wijesekera" ;
30
+ } else if (instance->inputMethodManager ().entry (" m17n_si_wijesekara" )) {
31
+ wijesekaraName = " m17n_si_wijesekara" ;
32
+ } else {
33
+ FCITX_ERROR ()
34
+ << " wijesekara engine is not available, skip the test" ;
35
+ return ;
36
+ }
27
37
defaultGroup.inputMethodList ().clear ();
28
38
defaultGroup.inputMethodList ().push_back (
29
39
InputMethodGroupItem (" keyboard-us" ));
30
40
defaultGroup.inputMethodList ().push_back (
31
- InputMethodGroupItem (" m17n_si_wijesekera " ));
41
+ InputMethodGroupItem (wijesekaraName ));
32
42
defaultGroup.setDefaultInputMethod (" " );
33
43
instance->inputMethodManager ().setGroup (defaultGroup);
34
44
auto *testfrontend = instance->addonManager ().addon (" testfrontend" );
@@ -56,11 +66,10 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
56
66
uuid, Key (FcitxKey_braceright), false );
57
67
testfrontend->call <ITestFrontend::keyEvent>(uuid, Key (" Control+space" ),
58
68
false );
59
-
60
- dispatcher->schedule ([dispatcher, instance]() {
61
- dispatcher->detach ();
62
- instance->exit ();
63
- });
69
+ });
70
+ dispatcher->schedule ([dispatcher, instance]() {
71
+ dispatcher->detach ();
72
+ instance->exit ();
64
73
});
65
74
}
66
75
0 commit comments