This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch up/10-fcitx5
in repository enlightenment.
View the commit online.
commit 9519f35cab471a880104a1fa8c808ef7fae6f30b
Author: Cedric BAIL <[email protected]>
AuthorDate: Fri Nov 27 17:14:02 2026 -0600
tests - type into Firefox, Chromium and Brave through the input method
zwp_text_input_v3 and zwp_input_method_v2 are tested against clients
written for the suite. What users run them with are browsers, as the
text input side, and an input method such as fcitx5. This runs each
installed browser on a page whose only content is a text field, with
the test as the input method: a click focuses the field, which must
activate the input method, and the text the input method commits must
end up in the field. The page reports its field in its title, which is
how the test sees what the browser did.
Firefox drops a click that comes before its first page is ready to
take input, and nothing on the wire says when that is. The test clicks
again, once a second, until the field has the focus. Clicking once
made Firefox look broken: its first tab seemed to ignore all input
until another tab had been opened.
Chromium 157 and Brave speak text-input v3 without the flag they used
to need. Each browser passed 20 runs out of 20: Firefox 160, Chromium
157 and Brave 157. The tests are in the browser suite, left out of a
plain meson test.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
src/tests/wayland/meson.build | 20 +++++
src/tests/wayland/pages/textinput.html | 21 +++++
src/tests/wayland/test_browser_text_input.c | 130 ++++++++++++++++++++++++++++
3 files changed, 171 insertions(+)
diff --git a/src/tests/wayland/meson.build b/src/tests/wayland/meson.build
index f066b927a..d29117f72 100644
--- a/src/tests/wayland/meson.build
+++ b/src/tests/wayland/meson.build
@@ -169,3 +169,23 @@ foreach b: ['firefox', 'chromium', 'brave']
timeout: 300,
)
endforeach
+
+test_browser_text_input = executable('test_wl_browser_text_input',
+ ['test_browser_text_input.c', tk_src, test_proto_src],
+ dependencies: [dependency('wayland-client')],
+)
+foreach b: ['firefox', 'chromium', 'brave']
+ test('browser-text-input-' + b,
+ run_nested,
+ args: [test_browser_text_input, b],
+ env: {
+ 'E_TEST_COMPOSITOR': e_test_compositor,
+ 'E_TEST_APP': ' '.join([browser_run, b,
+ 'file://' + meson.current_source_dir() / 'pages' / 'textinput.html']),
+ 'E_TEST_APP_CHECK': ' '.join([browser_run, '--find', b]),
+ 'E_TEST_WAIT_SECONDS': '60',
+ },
+ suite: 'browser',
+ timeout: 300,
+ )
+endforeach
diff --git a/src/tests/wayland/pages/textinput.html b/src/tests/wayland/pages/textinput.html
new file mode 100644
index 000000000..684e580e0
--- /dev/null
+++ b/src/tests/wayland/pages/textinput.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<title>e-ti</title>
+<!-- The field fills the page, so a click anywhere in it focuses the field
+ and not the address bar. The title reports what the compositor cannot
+ see: e-ti:<focused|blur>:<the field's value>| -->
+<body style="margin:0">
+<textarea id="f" spellcheck="false"
+ style="position:fixed;inset:0;border:0;resize:none;font:28px monospace"></textarea>
+<script>
+var f = document.getElementById('f');
+
+function update() {
+ document.title = 'e-ti:' + (document.activeElement === f ? 'focused' : 'blur') +
+ ':' + f.value + '|';
+}
+f.addEventListener('input', update);
+f.addEventListener('focus', update);
+f.addEventListener('blur', update);
+update();
+</script>
+</body>
diff --git a/src/tests/wayland/test_browser_text_input.c b/src/tests/wayland/test_browser_text_input.c
new file mode 100644
index 000000000..095d6a8cb
--- /dev/null
+++ b/src/tests/wayland/test_browser_text_input.c
@@ -0,0 +1,130 @@
+/* A real browser, as browser-run.sh started it, with this test as its input
+ * method: clicking in the page's text field activates the input method, and
+ * text the input method commits ends up in the field. The page reports its
+ * field in its title, as e-ti:<focused|blur>:<value>|, which the browser
+ * may decorate.
+ *
+ * argv[1] part of the browser's app_id */
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <linux/input-event-codes.h>
+
+#include "e_wl_testkit.h"
+#include "input-method-unstable-v2-client-protocol.h"
+
+#define PROG "test-browser-text-input"
+#define TEXT "eime"
+
+typedef struct
+{
+ struct zwp_input_method_v2 *im;
+ int activates, dones;
+} Ime;
+
+static void
+_activate(void *data, struct zwp_input_method_v2 *im __attribute__((unused)))
+{
+ ((Ime *)data)->activates++;
+}
+
+static void
+_ignore(void *data __attribute__((unused)), struct zwp_input_method_v2 *im __attribute__((unused)))
+{
+}
+
+static void
+_text(void *data __attribute__((unused)), struct zwp_input_method_v2 *im __attribute__((unused)),
+ const char *text __attribute__((unused)), uint32_t cursor __attribute__((unused)),
+ uint32_t anchor __attribute__((unused)))
+{
+}
+
+static void
+_uint(void *data __attribute__((unused)), struct zwp_input_method_v2 *im __attribute__((unused)),
+ uint32_t v __attribute__((unused)))
+{
+}
+
+static void
+_uint2(void *data __attribute__((unused)), struct zwp_input_method_v2 *im __attribute__((unused)),
+ uint32_t a __attribute__((unused)), uint32_t b __attribute__((unused)))
+{
+}
+
+static void
+_done(void *data, struct zwp_input_method_v2 *im __attribute__((unused)))
+{
+ ((Ime *)data)->dones++;
+}
+
+static const struct zwp_input_method_v2_listener _im_listener =
+{
+ _activate, _ignore, _text, _uint, _uint2, _done, _ignore
+};
+
+static int
+_titled(const Tk_Client *c, void *data)
+{
+ return !!strstr(c->title, data);
+}
+
+/* Firefox drops a click that comes before its first page is ready to take
+ * input, with nothing on the wire to tell when it is: click again, once a
+ * second, until the field has the focus. */
+static int
+_focused_by_click(const Tk_Client *c, void *data)
+{
+ static time_t last;
+ Tk *tk = data;
+ time_t now = time(NULL);
+
+ if (strstr(c->title, "e-ti:focused:")) return 1;
+ if (now == last) return 0;
+ last = now;
+ tk_pointer_warp(tk, c->x + (c->w / 2), c->y + ((c->h * 3) / 4));
+ tk_pointer_button(tk, BTN_LEFT, 1);
+ tk_pointer_button(tk, BTN_LEFT, 0);
+ return 0;
+}
+
+static int
+_activated(const Tk_Client *c __attribute__((unused)), void *data)
+{
+ return ((Ime *)data)->activates > 0;
+}
+
+int
+main(int argc, char **argv)
+{
+ struct zwp_input_method_manager_v2 *manager;
+ struct wl_seat *seat;
+ Ime ime = { 0 };
+ char app_id[256];
+ Tk_Client *c;
+ Tk *tk;
+
+ if (argc < 2) return 2;
+ tk_privileges_file(PROG, NULL, "input_method;");
+ tk = tk_connect(PROG);
+ seat = tk_bind(tk, &wl_seat_interface, 1);
+ manager = tk_bind(tk, &zwp_input_method_manager_v2_interface, 1);
+ if ((!seat) || (!manager)) tk_fail(tk, "missing global");
+ ime.im = zwp_input_method_manager_v2_get_input_method(manager, seat);
+ zwp_input_method_v2_add_listener(ime.im, &_im_listener, &ime);
+
+ c = tk_wait_window(tk, argv[1]);
+ snprintf(app_id, sizeof(app_id), "%s", c->app_id);
+ c = tk_wait(tk, app_id, _titled, "e-ti:", "the browser to show the page");
+
+ /* A browser starts with its address bar focused. */
+ tk_wait(tk, app_id, _focused_by_click, tk, "a click to focus the field");
+ tk_wait(tk, app_id, _activated, &ime, "the input method to be activated");
+ zwp_input_method_v2_commit_string(ime.im, TEXT);
+ zwp_input_method_v2_commit(ime.im, ime.dones);
+ c = tk_wait(tk, app_id, _titled, "e-ti:focused:" TEXT "|", "the text to reach the field");
+
+ printf(PROG ": ok, '%s' shows '%s'\n", app_id, c->title);
+ tk_disconnect(tk);
+ return 0;
+}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.