Merge branch 'deedra' into testing
Combine relation-only edit-label capture while retaining bounded text reads, password-target exclusion, UTF-8 output limits and menu checkability capture. Keep both label regression fixtures and the existing foreground test dispatch. Preserve Wine helper diagnostics and recovery documentation, and retain the current parity records alongside the incoming edit-label entry. Validation: - go test ./... -count=1 -timeout=180s - go vet ./... - CTHULHU_NATIVE_EDIT_LABELS=1 python3 tests/native_atspi.py - Isolated TestNativeTextLabelRelations - python3 tests/native_atspi.py - Parity ledger validation: 65 rows - Python syntax and staged diff checks Native GTK table fixtures emitted ATK warnings; all assertions passed. Live speech and physical Braille were not retested.
This commit is contained in:
commit
dcdeab256e
7 files changed
+229
-24
No files matched your search
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Edit fields whose labels are exposed only through AT-SPI relations."""
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
gi.require_version("Atk", "1.0")
|
||||
from gi.repository import Atk, Gtk
|
||||
|
||||
window = Gtk.Window(title="Edit label probe")
|
||||
window.connect("destroy", Gtk.main_quit)
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=8)
|
||||
window.add(box)
|
||||
|
||||
|
||||
def field(identifier, labels, name="", password=False):
|
||||
entry = Gtk.Entry()
|
||||
entry.set_text("secret value" if password else "sample value")
|
||||
entry.set_visibility(not password)
|
||||
accessible = entry.get_accessible()
|
||||
accessible.set_name(name)
|
||||
accessible.set_description(identifier)
|
||||
for text in labels:
|
||||
label = Gtk.Label(label=text)
|
||||
box.pack_start(label, False, False, 0)
|
||||
accessible.add_relationship(Atk.RelationType.LABELLED_BY, label.get_accessible())
|
||||
box.pack_start(entry, False, False, 0)
|
||||
|
||||
|
||||
field("related", ["Nickname"])
|
||||
field("multiple", ["Account", "identifier"])
|
||||
field("named", ["Other label"], name="Explicit name")
|
||||
field("unlabelled", [])
|
||||
field("protected", ["Password"], password=True)
|
||||
window.show_all()
|
||||
Gtk.main()
|
||||
@@ -23,6 +23,9 @@ def wait_for(check, message, timeout=15):
|
||||
|
||||
|
||||
def run_inside():
|
||||
if os.environ.get("CTHULHU_NATIVE_EDIT_LABELS") == "1":
|
||||
run_edit_label_probe()
|
||||
return
|
||||
if os.environ.get("CTHULHU_FOREGROUND_PID") == "1":
|
||||
if os.environ.get("CTHULHU_FOREGROUND_PROXY") == "1":
|
||||
run_proxy_probe()
|
||||
@@ -52,6 +55,27 @@ def run_inside():
|
||||
run_thunar_probe()
|
||||
|
||||
|
||||
def run_edit_label_probe():
|
||||
fixture = subprocess.Popen([sys.executable, str(Path(__file__).with_name("gtk_edit_labels.py"))])
|
||||
try:
|
||||
import pyatspi
|
||||
|
||||
def find_window():
|
||||
return any(window.name == "Edit label probe"
|
||||
for app in pyatspi.Registry.getDesktop(0) for window in app)
|
||||
|
||||
wait_for(find_window, "edit label probe missing")
|
||||
environment = dict(os.environ, GOCACHE="/tmp/cthulhu-go-cache", GOPROXY="off")
|
||||
subprocess.run(
|
||||
["go", "test", "./internal/atspi", "-run", "^TestNativeEditFieldLabels$",
|
||||
"-count=1", "-timeout=25s", "-v"],
|
||||
cwd=Path(__file__).resolve().parents[1], env=environment, check=True,
|
||||
)
|
||||
finally:
|
||||
fixture.terminate()
|
||||
fixture.wait(timeout=3)
|
||||
|
||||
|
||||
def run_thunar_probe():
|
||||
with tempfile.TemporaryDirectory(prefix="cthulhu-thunar-") as temporary:
|
||||
home = Path(temporary)
|
||||
|
||||
Reference in new issue
Block a user