More work on LibreOffice support.

This commit is contained in:
Storm Dragon committed 2026-10-15 00:50:49 -04:00
1 parent e0c8c6198c
commit 4ac59d4ced
25 files changed
+392 -57

No files matched your search

+14 -14
View File
@@ -452,7 +452,7 @@ func TestDelayedDocumentCaretCannotOverrideEditableFocus(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
queue := &fakeSpeechQueue{spoken: make(chan string, 8)}
adapter := &fakeAdapter{events: make(chan atspi.Event)}
where := make(chan struct{})
where := make(chan input.Command)
browser := newBrowserModeController(nil, &modeKeys{}, nil)
browser.ready, browser.mode = true, review.BrowseMode
done := make(chan struct{})
@@ -472,7 +472,7 @@ func TestDelayedDocumentCaretCannotOverrideEditableFocus(t *testing.T) {
adapter.events <- atspi.NewEvent(atspi.CaretEvent, oldHeading)
// The event loop must finish processing the caret before it can receive
// this command. Join before inspecting controller state.
where <- struct{}{}
where <- input.WhereAmI
cancel()
<-done
if browser.focus != entry.ID() || browser.generation != 1 {
@@ -524,7 +524,7 @@ func TestBackgroundDocumentLoadPreservesChromeFocus(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
queue := &fakeSpeechQueue{spoken: make(chan string, 8)}
adapter := &fakeAdapter{events: make(chan atspi.Event)}
where := make(chan struct{})
where := make(chan input.Command)
keys := &modeKeys{}
browser := newBrowserModeController(nil, keys, nil)
done := make(chan struct{})
@@ -551,7 +551,7 @@ func TestBackgroundDocumentLoadPreservesChromeFocus(t *testing.T) {
load := atspi.NewEvent(atspi.DocumentLoadCompleteEvent, document)
load.FocusOutsideDocument = entry.ID()
adapter.events <- load
where <- struct{}{}
where <- input.WhereAmI
expect("Address, autocomplete")
// A subsequent load with document focus must still announce and acquire
// the new document, even if the previous chrome snapshot was editable.
@@ -615,7 +615,7 @@ func TestDocumentLifecycleRecoversBrowseFocusWithoutLoadComplete(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
queue := &fakeSpeechQueue{spoken: make(chan string, 8)}
adapter := &fakeAdapter{events: make(chan atspi.Event)}
where := make(chan struct{})
where := make(chan input.Command)
keys := &modeKeys{}
browser := newBrowserModeController(nil, keys, nil)
done := make(chan struct{})
@@ -635,7 +635,7 @@ func TestDocumentLifecycleRecoversBrowseFocusWithoutLoadComplete(t *testing.T) {
if tc.start == atspi.BusyStateEvent {
expectActivationSpeech(t, queue.spoken, "Loading. Please wait.")
}
where <- struct{}{}
where <- input.WhereAmI
expectActivationSpeech(t, queue.spoken, "Example page, document web")
if browser.focus.Valid() || browser.ready || keys.enabled {
t.Fatal("loading retained browse focus")
@@ -646,7 +646,7 @@ func TestDocumentLifecycleRecoversBrowseFocusWithoutLoadComplete(t *testing.T) {
if tc.end == atspi.BusyStateEvent {
expectActivationSpeech(t, queue.spoken, "Finished loading New page.")
}
where <- struct{}{}
where <- input.WhereAmI
expectActivationSpeech(t, queue.spoken, "New page, document web")
if browser.focus != end.Source.ID() || !browser.resolving {
t.Fatalf("load completion did not schedule document recovery: %+v", browser.focus)
@@ -655,7 +655,7 @@ func TestDocumentLifecycleRecoversBrowseFocusWithoutLoadComplete(t *testing.T) {
dead := focus
dead.Type, dead.Detail1 = atspi.DefunctStateEvent, 1
adapter.events <- dead
where <- struct{}{}
where <- input.WhereAmI
expectActivationSpeech(t, queue.spoken, "New page, document web")
})
}
@@ -665,7 +665,7 @@ func TestDocumentLifecycleKeepsChromeFocus(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
queue := &fakeSpeechQueue{spoken: make(chan string, 8)}
adapter := &fakeAdapter{events: make(chan atspi.Event)}
where := make(chan struct{})
where := make(chan input.Command)
browser := newBrowserModeController(nil, &modeKeys{}, nil)
done := make(chan struct{})
go func() {
@@ -683,7 +683,7 @@ func TestDocumentLifecycleKeepsChromeFocus(t *testing.T) {
event.FocusOutsideDocument = entry.Source.ID()
adapter.events <- event
}
where <- struct{}{}
where <- input.WhereAmI
expectActivationSpeech(t, queue.spoken, "Address, entry")
cancel()
<-done
@@ -696,7 +696,7 @@ func TestDocumentBusyCompletionKeepsVerifiedMessageListFocus(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
queue := &fakeSpeechQueue{spoken: make(chan string, 8)}
adapter := &fakeAdapter{events: make(chan atspi.Event)}
where := make(chan struct{})
where := make(chan input.Command)
keys := &modeKeys{}
browser := newBrowserModeController(nil, keys, nil)
done := make(chan struct{})
@@ -718,7 +718,7 @@ func TestDocumentBusyCompletionKeepsVerifiedMessageListFocus(t *testing.T) {
busy.Type, busy.Detail1 = atspi.BusyStateEvent, 0
busy.FocusOutsideDocument = atspi.ObjectID{}
adapter.events <- busy
where <- struct{}{}
where <- input.WhereAmI
expectActivationSpeech(t, queue.spoken, "Message one, table row")
if browser.focus != row.Source.ID() || browser.mode != review.InactiveMode || keys.enabled {
t.Fatalf("preview busy completion took message-list arrows: focus %v, mode %v, grabs %v", browser.focus, browser.mode, keys.enabled)
@@ -761,7 +761,7 @@ func TestDocumentLoadRespectsWindowAndFocusOwnership(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
queue := &fakeSpeechQueue{spoken: make(chan string, 8)}
adapter := &fakeAdapter{events: make(chan atspi.Event)}
where := make(chan struct{})
where := make(chan input.Command)
browser := newBrowserModeController(nil, &modeKeys{}, nil)
done := make(chan struct{})
go func() {
@@ -793,7 +793,7 @@ func TestDocumentLoadRespectsWindowAndFocusOwnership(t *testing.T) {
adapter.events <- dead
}
// The unbuffered command follows event processing, without a sleep.
where <- struct{}{}
where <- input.WhereAmI
expectActivationSpeech(t, queue.spoken, test.want)
cancel()
<-done