For speech preferences, make sure the selected module is spoken. Also reorder so grouping is more similar to Cthulhu.
This commit is contained in:
1 parent
6168e541cd
commit
87f57912ca
16 files changed
+143
-46
No files matched your search
@@ -24,8 +24,7 @@ func TestApplicationSettingsOnlyExposeRestorableControls(t *testing.T) {
|
||||
if _, exists := values["presentation.speech.voice"]; !exists {
|
||||
t.Fatal("voice control missing")
|
||||
}
|
||||
session.Handle(interaction.Key{Name: "tab"})
|
||||
session.Handle(interaction.Key{Name: "tab"})
|
||||
tab_to_control(t, session, "speech.rate")
|
||||
session.Handle(interaction.Key{Name: "up"})
|
||||
saved, err := Application_settings(session, base)
|
||||
if err != nil || saved.Presentation.Speech.Rate != base.Presentation.Speech.Rate+10 || saved.Keyboard.Layout != base.Keyboard.Layout {
|
||||
|
||||
@@ -47,7 +47,7 @@ func TestSettingsFormCoversSchemaAndReturnsIsolatedDraft(t *testing.T) {
|
||||
}
|
||||
session.Handle(interaction.Key{Name: "tab"})
|
||||
session.Handle(interaction.Key{Name: "space"})
|
||||
session.Handle(interaction.Key{Name: "tab"})
|
||||
tab_to_control(t, session, "speech.rate")
|
||||
session.Handle(interaction.Key{Name: "up"})
|
||||
draft, err := Settings(session, base)
|
||||
if err != nil {
|
||||
@@ -79,8 +79,7 @@ func TestSpeechRateArrowSteps(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
session.Handle(interaction.Key{Name: "tab"}) // Speech enabled.
|
||||
session.Handle(interaction.Key{Name: "tab"}) // Rate.
|
||||
tab_to_control(t, session, "speech.rate")
|
||||
result := session.Handle(interaction.Key{Name: trial.key})
|
||||
if want := "Rate " + strconv.Itoa(trial.want); result.Speech != want {
|
||||
t.Fatalf("application=%v, rate=%d, key=%s: speech=%q, want %q", application, trial.start, trial.key, result.Speech, want)
|
||||
@@ -272,9 +271,7 @@ func TestConstrainedChoicesKeepStableIDsAndIgnoreTextEditing(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for range 3 {
|
||||
session.Handle(interaction.Key{Name: "tab"})
|
||||
}
|
||||
tab_to_control(t, session, "speech.driver")
|
||||
session.Handle(interaction.Key{Ctrl: true, Text: "a"})
|
||||
session.Handle(interaction.Key{Text: "invented-driver"})
|
||||
session.Handle(interaction.Key{Name: "tab"})
|
||||
@@ -345,3 +342,15 @@ func TestInternalUIOptionsAndApplicationIsolation(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// tab_to_control moves focus with Tab, as a user would, until id is focused.
|
||||
func tab_to_control(t *testing.T, session *interaction.Session, id string) {
|
||||
t.Helper()
|
||||
for range 64 {
|
||||
if control, ok := session.Focused_control(); ok && control.ID == id {
|
||||
return
|
||||
}
|
||||
session.Handle(interaction.Key{Name: "tab"})
|
||||
}
|
||||
t.Fatalf("control %s not reached with Tab", id)
|
||||
}
|
||||
Reference in new issue
Block a user