Documentation
¶
Overview ¶
Package imetest has test doubles for the input method of the Linux backends: an input method that records its calls, and a poster that lets the test run what the bridge hands to the UI thread.
Flutter: no counterpart
Index ¶
- type IM
- func (f *IM) Close() error
- func (f *IM) FocusIn(context.Context) error
- func (f *IM) FocusOut(context.Context) error
- func (f *IM) Log() []string
- func (f *IM) Name() string
- func (f *IM) Open(_ context.Context, events func(dbus.IMEEvent)) (dbus.InputMethod, error)
- func (f *IM) ProcessKey(ctx context.Context, k dbus.IMEKey) (bool, error)
- func (f *IM) Reset(context.Context) error
- func (f *IM) SetContent(_ context.Context, c dbus.IMEContent) error
- func (f *IM) SetCursorRect(_ context.Context, x, y, w, h int) error
- func (f *IM) SetSurroundingText(_ context.Context, text string, cursor, anchor int) error
- func (f *IM) WaitCalls(t *testing.T, n int) []string
- type Poster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IM ¶
type IM struct {
// Handled decides whether ProcessKey consumes a key; nil consumes none.
Handled func(dbus.IMEKey) bool
// Fail makes the calls whose name is a key fail with the error.
Fail map[string]error
// Events is the function the bridge gave to open; call it to send the
// bridge a change of the input method.
Events func(dbus.IMEEvent)
// Block, when set, makes ProcessKey wait for it to be closed (or for its
// context to end).
Block chan struct{}
// contains filtered or unexported fields
}
IM is a dbus.InputMethod that records the calls as text such as "SetCursorRect(1,2,3,4)" and answers ProcessKey with Handled.
Flutter: no counterpart
func (*IM) Open ¶
Open is an ime.Opener that returns f, and keeps the events function.
Flutter: no counterpart
func (*IM) ProcessKey ¶
ProcessKey records the call as "ProcessKey(<char>,<keycode>,<state>,<release>)".
func (*IM) SetContent ¶
SetContent records the call.
func (*IM) SetCursorRect ¶
SetCursorRect records the call.
func (*IM) SetSurroundingText ¶
SetSurroundingText records the call.
type Poster ¶
type Poster struct {
// contains filtered or unexported fields
}
Poster is an ime.Poster that keeps the posted functions until the test runs them on its own goroutine.
Flutter: no counterpart