Files
cthulhu/docs/testing/mozilla-reading.md

4.5 KiB

Firefox and Thunderbird reading baseline

The first Mozilla release-readiness slice covers reading an ordinary Firefox page and a saved HTML message in Thunderbird. Both applications can expose a heading or link as a text-bearing leaf without a static text child. Document capture previously recorded zero characters for these roles. Structural heading navigation still worked, but arrow reading and Read All skipped their content. Capturing their native text counts fixes this at the shared AT-SPI boundary. It does not add browser- or application-specific navigation rules.

Automated verification

Build a separate reader and run:

go build -o /tmp/cthulhu-mozilla-review ./cmd/cthulhu
python3 tests/native_firefox.py
CTHULHU_BINARY=/tmp/cthulhu-mozilla-review /usr/bin/python3 tests/native_mozilla.py

The last command requires Firefox, Thunderbird, i3, Xvfb, xdotool, D-Bus and Python with pyatspi. Pass firefox or thunderbird to run just one application. It creates a separate X display, accessibility/session buses, application profile, reader configuration and speech protocol recorder for each run. Thunderbird uses a synthetic local identity and a saved message; no mail account credentials or SMTP server are configured. Existing profiles and the active desktop reader are not used.

The evidence directory printed for each application retains the profile, fixture, reader/application/session logs, speech.json and report.json. The test checks:

  • Ctrl+Home reads the initial heading.
  • Down and Up traverse all six content items in order, including headings and the link.
  • Heading jumps followed by Down reach the following paragraph.
  • Link navigation reaches the expected link.
  • Read All emits every content item in order, with heading/link roles.

The original Firefox metadata test now asserts heading and link character counts in the captured document. This assertion fails on the original implementation. It also retains the existing address-bar/page handoff and browser-tab checks. The reader-level checks passed with Firefox 158.0 and Thunderbird 158.0. Each run completed 17 navigation commands and Read All; the recorded navigation results contained no native caret synchronization errors.

Shared capture changes also need Chromium checks:

go test -race ./internal/atspi ./internal/review ./internal/presentation ./internal/app -count=1 -timeout=120s
CTHULHU_NATIVE_BROWSER_TESTS=fragments,linkedheadings,document,editing,selection,modes python3 tests/native_browser.py

These cover plausible regressions in child-text traversal, linked headings, structural movement, native editing, selection, Braille routing and focus modes.

Human review and live acceptance

Review the diff and test through the normal rebuilt reader before submission, as required by the contribution policy. Protocol recordings prove requested speech, not audible output, physical keyboard behavior or physical Braille. The Mozilla reader-level harness disables Braille.

  1. Open the retained reading.html in Firefox and message.eml in Thunderbird. Move focus into their content.
  2. Press Ctrl+Home. Expect "Reading start", heading level 1. Down must read "First readable paragraph.", "Reading section", "Second readable paragraph.", "Local destination link" and "Final readable paragraph." in that order. Up must reverse that order. Check spoken roles and matching Braille.
  3. From the first heading, press H and then Down. Expect "Reading section" followed by "Second readable paragraph.". Check ordinary character and word movement within a heading and link as well.
  4. Return to the start and invoke Read All. Expect every content item, including both headings and the link. Interrupt it and verify the next navigation command reads from the expected position.
  5. In Firefox, use Ctrl+L and browser-tab switching, then return to the page. In Thunderbird, move between message headers and body. Verify native controls retain their keyboard behavior and reading resumes in the correct document.
  6. Repeat with representative plain-text and HTML email and ordinary websites. Check existing Chromium reading, linked headings, editing and selection too.

This is a reading baseline, not complete Thunderbird acceptance. Folder and message-list navigation and unsent composition now have their own local-mail workflow checks. Settings and real mailbox workflows still need dedicated acceptance checks. Page summaries, automatic Read All on load and math support remain separate work.