[orca] Make context menus flat-reviewable
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Make context menus flat-reviewable
- Date: Sat, 3 Sep 2016 01:57:36 +0000 (UTC)
commit 106858d0d29b72e67874d22e0812118843122400
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Sep 2 21:56:17 2016 -0400
Make context menus flat-reviewable
src/orca/flat_review.py | 5 +-
src/orca/script_utilities.py | 5 +
.../firefox/ui_context_menu_flat_review.py | 115 +++++++++++++++++
.../gtk-demo/context_menu_flat_review.py | 78 ++++++++++++
test/keystrokes/gtk-demo/role_menu_flat_review.py | 10 +-
.../gtk3-demo/context_menu_flat_review.py | 78 ++++++++++++
.../oowriter/flat_review_context_menu.py | 129 ++++++++++++++++++++
.../oowriter/flat_review_platform_menubar.py | 3 +-
8 files changed, 416 insertions(+), 7 deletions(-)
---
diff --git a/src/orca/flat_review.py b/src/orca/flat_review.py
index d2d1d29..26e86ff 100644
--- a/src/orca/flat_review.py
+++ b/src/orca/flat_review.py
@@ -478,6 +478,9 @@ class Context:
containerRoles = [pyatspi.ROLE_MENU]
isContainer = lambda x: x and x.getRole() in containerRoles
container = pyatspi.findAncestor(self.focusObj, isContainer)
+ if not container and isContainer(self.focusObj):
+ container = self.focusObj
+
self.container = container or self.topLevel
self.zones, self.focusZone = self.getShowingZones(self.container)
@@ -817,7 +820,7 @@ class Context:
continue
allZones.extend(zones)
- if zones and (o == self.focusObj or o in self.focusObj):
+ if not focusZone and zones and (o == self.focusObj or o in self.focusObj):
zones = list(filter(lambda z: z.hasCaret(), zones)) or zones
focusZone = zones[0]
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index eb6c8eb..799809b 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1577,6 +1577,11 @@ class Utilities:
msg = "INFO: %s has no size and no children" % obj
debug.println(debug.LEVEL_INFO, msg, True)
return False
+ if obj.getRole() == pyatspi.ROLE_MENU:
+ msg = "INFO: %s has no size" % obj
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return False
+
return True
if boundingbox is None or not self._boundsIncludeChildren(obj.parent):
diff --git a/test/keystrokes/firefox/ui_context_menu_flat_review.py
b/test/keystrokes/firefox/ui_context_menu_flat_review.py
new file mode 100644
index 0000000..b2bc73f
--- /dev/null
+++ b/test/keystrokes/firefox/ui_context_menu_flat_review.py
@@ -0,0 +1,115 @@
+#!/usr/bin/python
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+sequence.append(PauseAction(3000))
+sequence.append(KeyComboAction("Tab"))
+sequence.append(KeyComboAction("Tab"))
+
+sequence.append(KeyComboAction("<Shift>F10"))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_8"))
+sequence.append(utils.AssertPresentationAction(
+ "1. Review current line",
+ ["BRAILLE LINE: 'Back Forward Reload Bookmark This Page $l'",
+ " VISIBLE: 'Back Forward Reload Bookmark Thi', cursor=1",
+ "SPEECH OUTPUT: 'Back Forward Reload Bookmark This Page'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_7"))
+sequence.append(utils.AssertPresentationAction(
+ "2. Review previous line",
+ [""]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "3. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "4. Review next line",
+ ["BRAILLE LINE: 'Save Page As... $l'",
+ " VISIBLE: 'Save Page As... $l', cursor=1",
+ "SPEECH OUTPUT: 'Save Page As…'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "5. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "6. Review next line",
+ ["BRAILLE LINE: 'View Background Image $l'",
+ " VISIBLE: 'View Background Image $l', cursor=1",
+ "SPEECH OUTPUT: 'View Background Image'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "7. Review next line",
+ ["BRAILLE LINE: 'Select All $l'",
+ " VISIBLE: 'Select All $l', cursor=1",
+ "SPEECH OUTPUT: 'Select All'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "8. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "9. Review next line",
+ ["BRAILLE LINE: 'View Page Source $l'",
+ " VISIBLE: 'View Page Source $l', cursor=1",
+ "SPEECH OUTPUT: 'View Page Source'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "10. Review next line",
+ ["BRAILLE LINE: 'View Page Info $l'",
+ " VISIBLE: 'View Page Info $l', cursor=1",
+ "SPEECH OUTPUT: 'View Page Info'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "11. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "12. Review next line",
+ ["BRAILLE LINE: 'Inspect Element $l'",
+ " VISIBLE: 'Inspect Element $l', cursor=1",
+ "SPEECH OUTPUT: 'Inspect Element'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "13. Review next line",
+ [""]))
+
+sequence.append(utils.AssertionSummaryAction())
+sequence.start()
diff --git a/test/keystrokes/gtk-demo/context_menu_flat_review.py
b/test/keystrokes/gtk-demo/context_menu_flat_review.py
new file mode 100644
index 0000000..8756aad
--- /dev/null
+++ b/test/keystrokes/gtk-demo/context_menu_flat_review.py
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+sequence.append(PauseAction(3000))
+sequence.append(KeyComboAction("<Control>f"))
+sequence.append(TypeAction("Application main window"))
+sequence.append(KeyComboAction("Return"))
+sequence.append(PauseAction(3000))
+sequence.append(KeyComboAction("Tab"))
+
+sequence.append(KeyComboAction("<Shift>F10"))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_8"))
+sequence.append(utils.AssertPresentationAction(
+ "1. Review current line",
+ ["BRAILLE LINE: 'Cut $l'",
+ " VISIBLE: 'Cut $l', cursor=1",
+ "SPEECH OUTPUT: 'Cut'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_7"))
+sequence.append(utils.AssertPresentationAction(
+ "2. Review previous line",
+ [""]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "3. Review next line",
+ ["BRAILLE LINE: 'Copy $l'",
+ " VISIBLE: 'Copy $l', cursor=1",
+ "SPEECH OUTPUT: 'Copy'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "4. Review next line",
+ ["BRAILLE LINE: 'Paste $l'",
+ " VISIBLE: 'Paste $l', cursor=1",
+ "SPEECH OUTPUT: 'Paste'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "5. Review next line",
+ ["BRAILLE LINE: 'Delete $l'",
+ " VISIBLE: 'Delete $l', cursor=1",
+ "SPEECH OUTPUT: 'Delete'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "6. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "7. Review next line",
+ ["BRAILLE LINE: 'Select All $l'",
+ " VISIBLE: 'Select All $l', cursor=1",
+ "SPEECH OUTPUT: 'Select All'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "8. Review next line",
+ [""]))
+
+sequence.append(utils.AssertionSummaryAction())
+sequence.start()
diff --git a/test/keystrokes/gtk-demo/role_menu_flat_review.py
b/test/keystrokes/gtk-demo/role_menu_flat_review.py
index 478cd05..4c0594c 100644
--- a/test/keystrokes/gtk-demo/role_menu_flat_review.py
+++ b/test/keystrokes/gtk-demo/role_menu_flat_review.py
@@ -29,14 +29,14 @@ sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("KP_8"))
sequence.append(utils.AssertPresentationAction(
"2. Review current line",
- ["BRAILLE LINE: '<x> Bold < > Blue $l'",
- " VISIBLE: '<x> Bold < > Blue $l', cursor=10",
- "SPEECH OUTPUT: 'checked Bold not checked Blue'"]))
+ ["BRAILLE LINE: 'Color <x> Red $l'",
+ " VISIBLE: 'Color <x> Red $l', cursor=1",
+ "SPEECH OUTPUT: 'Color checked Red'"]))
sequence.append(utils.StartRecordingAction())
-sequence.append(KeyComboAction("KP_7"))
+sequence.append(KeyComboAction("KP_9"))
sequence.append(utils.AssertPresentationAction(
- "3. Review previous line",
+ "3. Review next line",
["BRAILLE LINE: 'Shape < > Green $l'",
" VISIBLE: 'Shape < > Green $l', cursor=1",
"SPEECH OUTPUT: 'Shape not checked Green'"]))
diff --git a/test/keystrokes/gtk3-demo/context_menu_flat_review.py
b/test/keystrokes/gtk3-demo/context_menu_flat_review.py
new file mode 100644
index 0000000..6d0b8b7
--- /dev/null
+++ b/test/keystrokes/gtk3-demo/context_menu_flat_review.py
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+sequence.append(KeyComboAction("<Control>f"))
+sequence.append(TypeAction("Application class"))
+sequence.append(KeyComboAction("Return"))
+sequence.append(KeyComboAction("Return"))
+sequence.append(PauseAction(3000))
+sequence.append(KeyComboAction("Tab"))
+
+sequence.append(KeyComboAction("<Shift>F10"))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_8"))
+sequence.append(utils.AssertPresentationAction(
+ "1. Review current line",
+ ["BRAILLE LINE: 'Cut $l'",
+ " VISIBLE: 'Cut $l', cursor=1",
+ "SPEECH OUTPUT: 'Cut'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_7"))
+sequence.append(utils.AssertPresentationAction(
+ "2. Review previous line",
+ [""]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "3. Review next line",
+ ["BRAILLE LINE: 'Copy $l'",
+ " VISIBLE: 'Copy $l', cursor=1",
+ "SPEECH OUTPUT: 'Copy'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "4. Review next line",
+ ["BRAILLE LINE: 'Paste $l'",
+ " VISIBLE: 'Paste $l', cursor=1",
+ "SPEECH OUTPUT: 'Paste'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "5. Review next line",
+ ["BRAILLE LINE: 'Delete $l'",
+ " VISIBLE: 'Delete $l', cursor=1",
+ "SPEECH OUTPUT: 'Delete'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "6. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "7. Review next line",
+ ["BRAILLE LINE: 'Select All $l'",
+ " VISIBLE: 'Select All $l', cursor=1",
+ "SPEECH OUTPUT: 'Select All'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "8. Review next line",
+ [""]))
+
+sequence.append(utils.AssertionSummaryAction())
+sequence.start()
diff --git a/test/keystrokes/oowriter/flat_review_context_menu.py
b/test/keystrokes/oowriter/flat_review_context_menu.py
new file mode 100644
index 0000000..849797a
--- /dev/null
+++ b/test/keystrokes/oowriter/flat_review_context_menu.py
@@ -0,0 +1,129 @@
+#!/usr/bin/python
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+sequence.append(PauseAction(3000))
+sequence.append(KeyComboAction("<Shift>F10"))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_8"))
+sequence.append(utils.AssertPresentationAction(
+ "1. Review current line",
+ ["BRAILLE LINE: 'Paste $l'",
+ " VISIBLE: 'Paste $l', cursor=1",
+ "SPEECH OUTPUT: 'Paste'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_7"))
+sequence.append(utils.AssertPresentationAction(
+ "2. Review previous line",
+ [""]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "3. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "4. Review next line",
+ ["BRAILLE LINE: 'Paste Special $l'",
+ " VISIBLE: 'Paste Special $l', cursor=1",
+ "SPEECH OUTPUT: 'Paste Special'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "5. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "6. Review next line",
+ ["BRAILLE LINE: 'Clear Direct Formatting $l'",
+ " VISIBLE: 'Clear Direct Formatting $l', cursor=1",
+ "SPEECH OUTPUT: 'Clear Direct Formatting'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "7. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "8. Review next line",
+ ["BRAILLE LINE: 'Character... $l'",
+ " VISIBLE: 'Character... $l', cursor=1",
+ "SPEECH OUTPUT: 'Character...'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "9. Review next line",
+ ["BRAILLE LINE: 'Paragraph... $l'",
+ " VISIBLE: 'Paragraph... $l', cursor=1",
+ "SPEECH OUTPUT: 'Paragraph...'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "10. Review next line",
+ ["BRAILLE LINE: 'Bullets and Numbering... $l'",
+ " VISIBLE: 'Bullets and Numbering... $l', cursor=1",
+ "SPEECH OUTPUT: 'Bullets and Numbering...'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "11. Review next line",
+ ["BRAILLE LINE: 'Page... $l'",
+ " VISIBLE: 'Page... $l', cursor=1",
+ "SPEECH OUTPUT: 'Page...'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "12. Review next line",
+ ["BRAILLE LINE: 'Change Case $l'",
+ " VISIBLE: 'Change Case $l', cursor=1",
+ "SPEECH OUTPUT: 'Change Case'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "13. Review next line",
+ ["BRAILLE LINE: 'separator $l'",
+ " VISIBLE: 'separator $l', cursor=1",
+ "SPEECH OUTPUT: 'separator'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "14. Review next line",
+ ["BRAILLE LINE: 'Edit Paragraph Style... $l'",
+ " VISIBLE: 'Edit Paragraph Style... $l', cursor=1",
+ "SPEECH OUTPUT: 'Edit Paragraph Style...'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_9"))
+sequence.append(utils.AssertPresentationAction(
+ "15. Review next line",
+ [""]))
+
+sequence.append(utils.AssertionSummaryAction())
+sequence.start()
+
diff --git a/test/keystrokes/oowriter/flat_review_platform_menubar.py
b/test/keystrokes/oowriter/flat_review_platform_menubar.py
index 12ed04a..6919db1 100644
--- a/test/keystrokes/oowriter/flat_review_platform_menubar.py
+++ b/test/keystrokes/oowriter/flat_review_platform_menubar.py
@@ -10,11 +10,12 @@ sequence.append(PauseAction(3000))
sequence.append(KeyComboAction("F6"))
sequence.append(PauseAction(3000))
sequence.append(KeyComboAction("KP_8"))
+sequence.append(PauseAction(3000))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("KP_7"))
sequence.append(utils.AssertPresentationAction(
- "1. Review current line.",
+ "1. Review previous line.",
["BRAILLE LINE: 'File Edit View Insert Format Styles Table Tools Window Help $l'",
" VISIBLE: 'File Edit View Insert Format Sty', cursor=1",
"SPEECH OUTPUT: 'File Edit View Insert Format Styles Table Tools Window Help'"]))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]