Add a description column to the reading settings table under speech.
This commit is contained in:
1 parent
ffcea2efea
commit
41283a5d8d
7 files changed
+219
-46
No files matched your search
@@ -845,11 +845,15 @@ def inside():
|
||||
readingTree = next(node for node in nodes if node.name == "Reading settings"
|
||||
and node.getRole() == pyatspi.ROLE_TABLE)
|
||||
readingTable = readingTree.queryTable()
|
||||
assert readingTable.nColumns == 2
|
||||
assert readingTable.nColumns == 3
|
||||
assert [readingTable.getColumnDescription(column) for column in range(3)] == [
|
||||
"Enabled", "Setting", "Description"]
|
||||
for row in range(readingTable.nRows):
|
||||
stateCell = readingTable.getAccessibleAt(row, 0)
|
||||
settingCell = readingTable.getAccessibleAt(row, 1)
|
||||
descriptionCell = readingTable.getAccessibleAt(row, 2)
|
||||
assert settingCell.name and settingCell.name not in ("checked", "unchecked"), settingCell.name
|
||||
assert descriptionCell.name and descriptionCell.name != settingCell.name, settingCell.name
|
||||
checked = stateCell.getState().contains(pyatspi.STATE_CHECKED)
|
||||
assert stateCell.name == ("checked" if checked else "unchecked"), stateCell.name
|
||||
titleRow = next(row for row in range(readingTable.nRows)
|
||||
@@ -868,6 +872,9 @@ def inside():
|
||||
if readingTable.getAccessibleAt(row, 1).name == "Phonetic character hints")
|
||||
hintCell = readingTable.getAccessibleAt(hintRow, 0)
|
||||
assert hintCell.name == "unchecked" and not hintCell.getState().contains(pyatspi.STATE_CHECKED)
|
||||
hintDescription = readingTable.getAccessibleAt(hintRow, 2).name
|
||||
assert "Left or Right" in hintDescription and "300 ms" in hintDescription, hintDescription
|
||||
assert "cancels the hint" in hintDescription, hintDescription
|
||||
for label, expected in (("Phonetic character hints", "checked"),
|
||||
("Announce lists in Say All", "checked"),
|
||||
("Present tooltips", "checked"),
|
||||
@@ -888,12 +895,26 @@ def inside():
|
||||
assert stateCell.getState().contains(pyatspi.STATE_CHECKED) != wasChecked
|
||||
key("Right")
|
||||
wait_for(lambda: readingTable.getAccessibleAt(0, 1).getState().contains(pyatspi.STATE_FOCUSED), "Right did not focus the setting label")
|
||||
key("Right")
|
||||
descriptionCell = readingTable.getAccessibleAt(0, 2)
|
||||
wait_for(lambda: descriptionCell.getState().contains(pyatspi.STATE_FOCUSED), "Right did not focus the description")
|
||||
# Space still toggles the selected row from the new text column.
|
||||
key("space")
|
||||
wait_for(lambda: stateCell.getState().contains(pyatspi.STATE_CHECKED) == wasChecked,
|
||||
"Space in the description did not toggle the checkbox")
|
||||
key("space")
|
||||
wait_for(lambda: stateCell.getState().contains(pyatspi.STATE_CHECKED) != wasChecked,
|
||||
"Space in the description did not restore the checkbox")
|
||||
key("Down")
|
||||
wait_for(lambda: readingTable.isRowSelected(1), "Down did not select the next reading setting")
|
||||
key("Up")
|
||||
wait_for(lambda: readingTable.isRowSelected(0), "Up did not return to the first reading setting")
|
||||
key("Left")
|
||||
wait_for(lambda: readingTable.getAccessibleAt(0, 1).getState().contains(pyatspi.STATE_FOCUSED), "Left did not return to the setting label")
|
||||
key("Left")
|
||||
wait_for(lambda: readingTable.getAccessibleAt(0, 0).getState().contains(pyatspi.STATE_FOCUSED), "Left did not focus the checkbox")
|
||||
key("Right", "Right")
|
||||
wait_for(lambda: descriptionCell.getState().contains(pyatspi.STATE_FOCUSED), "description focus missing before Tab")
|
||||
key("Tab")
|
||||
wait_for(lambda: not any(node.getState().contains(pyatspi.STATE_FOCUSED) for node in walk(readingTree)), "Tab did not leave reading settings")
|
||||
key("shift+Tab")
|
||||
@@ -922,7 +943,7 @@ def inside():
|
||||
focus(named("Cancel")); key("space")
|
||||
assert process.wait(timeout=5) == 0
|
||||
assert responses.read_remaining() == "", "Cancel submitted reading changes"
|
||||
print("PASS: reading table, Say All, tooltip and mouse choices, Space, arrows, Tab/Shift+Tab, Apply/reload, Cancel")
|
||||
print("PASS: three-column reading table and descriptions, Say All, tooltip and mouse choices, Space, arrows, Tab/Shift+Tab, Apply/reload, Cancel")
|
||||
return
|
||||
if os.environ.get("CTHULHU_PREFS_MODIFIERS_ONLY") == "1":
|
||||
modifierTree = named("Cthulhu modifier keys")
|
||||
|
||||
Reference in new issue
Block a user