atspitest

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package atspitest runs real at-spi2-core for a test and reads the accessible tree the way an assistive technology does: the bus launcher brings up the accessibility bus on a private session bus, the registry daemon serves the desktop, and the test walks the applications under it over the accessibility bus.

Index

Constants

View Source
const LibexecEnv = "ATSPI_LIBEXEC"

LibexecEnv names the environment variable that points at at-spi2-core's libexec directory, where at-spi-bus-launcher and at-spi2-registryd live off PATH.

View Source
const SchemaDirEnv = "ATSPI_GSETTINGS_SCHEMA_DIR"

SchemaDirEnv names the environment variable that points at the compiled GSettings schemas holding org.gnome.desktop.interface: the bus launcher keeps the accessibility switch in its toolkit-accessibility key, and without the schema IsEnabled reads false whatever was set.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessible

type Accessible struct {
	Bus  string
	Path dbus.ObjectPath
	// contains filtered or unexported fields
}

Accessible is one object on the accessibility bus.

func (Accessible) Children

func (a Accessible) Children() ([]Accessible, error)

Children are the accessible's children in order.

func (Accessible) Name

func (a Accessible) Name() (string, error)

Name is the accessible's name, as a screen reader speaks it.

func (Accessible) Names

func (a Accessible) Names() ([]string, error)

Names walks the tree under a, a first, depth first in child order, and lists every name read.

func (Accessible) Object

func (a Accessible) Object() dbus.BusObject

Object is the accessible's D-Bus object, for the interfaces this package does not read.

type Core

type Core struct {
	// Session is the private session bus the test now runs on:
	// DBUS_SESSION_BUS_ADDRESS names it, so an application started
	// after Start discovers the accessibility bus through it.
	Session *dbustest.Bus
	// AT is the assistive technology's connection to the
	// accessibility bus.
	AT *dbus.Conn
}

Core is real at-spi2-core serving one test.

func Start

func Start(t *testing.T) *Core

Start brings up at-spi-bus-launcher on a private session bus and at-spi2-registryd on the accessibility bus it starts, and waits until the registry owns its name; everything stops at cleanup, and a daemon left behind fails the test. Without LibexecEnv the test skips.

func (*Core) Application

func (c *Core) Application(t *testing.T, toolkit string) Accessible

Application waits until exactly one application whose toolkit is toolkit sits under the desktop and returns its root.

func (*Core) Desktop

func (c *Core) Desktop() Accessible

Desktop is the registry's desktop, the root every application embeds under.

func (*Core) Enable

func (c *Core) Enable(t *testing.T)

Enable turns the desktop's accessibility switch on (org.a11y.Status IsEnabled), as the desktop's accessibility setting does: toolkits that follow the switch start serving.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL