[GTK] Create a framework to test IMContextWrapper
Categories
(Core :: DOM: UI Events & Focus Handling, task, P3)
Tracking
()
People
(Reporter: masayuki, Assigned: masayuki)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Keywords: inputmethod)
Attachments
(3 files)
IMContextWrapper
does really hacky things for handling asynchronous ibus and fcitx's hacky OOP IMEs. For making the maintenance safer, we should have a framework for testing it.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
For making API calls and signal listeners are iteruptible, we need to stop
accessing native API directly. This patch creates GtkIMContextProxy
class which wraps a GtkIMContext
instance and hides it from its users.
Assignee | ||
Comment 2•4 years ago
|
||
Depends on D116444
Assignee | ||
Comment 3•4 years ago
|
||
My idea of the new test framework is, JS class can implement a emulator
of GtkIMContext and API calls with it. In other words, the class is
created per GtkIMContext and can listen to all API calls for it.
For implementing the class, this patch adds nsIGtkIMContextEmulator
which has methods which are called when GtkIMContextProxy
calls an
API.
Additionally, the tests (assuming mochitest-chrome) need to synthesize
native events. For making it possible, this patch adds
nsIGtkIMETester
too. This is impelmented as GtkIMETester
with C++.
When JS attaches an emulator class via nsIDOMWindowUtils
, it'll be
attached to "current" GtkIMContextProxy
on the native window. And
it returns GtkIMETester
instance for making the test can synthesize
native events.
Note that GtkIMETester
is associated with an IMContextWrapper
which
is created per native window, and it may have 3 GtkIMContextProxy
instances at most. This incosistency may be freel complicated, but
in usual tests, only one nsIGtkIMContextEmulator
is required. So,
this should not be a matter.
Depends on D116445
Assignee | ||
Comment 4•4 years ago
|
||
The patches touch all over IMContextWrapper
. So, if you need to touch it, my patches are perhaps broken by the change, but feel free to do it because I cannot finish following patches for them so quickly.
Updated•4 years ago
|
Description
•