[orca] Part two of bug/RFE #574720



commit 3f93e2372a4aac62bbb9b75be8e42849570827f9
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sun Jun 14 15:12:07 2009 -0400

    Part two of bug/RFE #574720
    
    This adds settings for the table structural navigation. Note that
    the setting to speak headings has been added, but it is not yet
    implemented. OOo Writer doesn't expose headings as headings to us
    currently. As a result, the only headings we will be able to speak
    are those dynamically set by the user. Implementing that is part
    three of this bug/RFE. :-)

 src/orca/scripts/apps/soffice/script.py            |  106 ++++++++-
 src/orca/scripts/apps/soffice/script_settings.py   |    2 +-
 src/orca/scripts/apps/soffice/speech_generator.py  |    4 +-
 src/orca/scripts/toolkits/Gecko/script.py          |    8 +-
 test/keystrokes/oowriter/table-sample2.odt         |  Bin 0 -> 9440 bytes
 .../table_cells_structural_navigation1.params      |    1 +
 .../oowriter/table_cells_structural_navigation1.py |  242 ++++++++++++++++++++
 7 files changed, 349 insertions(+), 14 deletions(-)
---
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index 878815e..4bf7d2b 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -73,8 +73,12 @@ class Script(default.Script):
         #
         self.savedEnabledBrailledTextAttributes = None
         self.savedEnabledSpokenTextAttributes = None
-        self.speakCellCoordinatesCheckButton = None
+        self.speakSpreadsheetCoordinatesCheckButton = None
         self.savedreadTableCellRow = None
+        self.skipBlankCellsCheckButton = None
+        self.speakCellCoordinatesCheckButton = None
+        self.speakCellHeadersCheckButton = None
+        self.speakCellSpanCheckButton = None
 
         # Set the debug level for all the methods in this script.
         #
@@ -328,12 +332,81 @@ class Script(default.Script):
         # column position within the spread sheet (i.e. A1, B1, C2 ...)
         #
         label = _("Speak spread sheet cell coordinates")
+        self.speakSpreadsheetCoordinatesCheckButton = gtk.CheckButton(label)
+        gtk.Widget.show(self.speakSpreadsheetCoordinatesCheckButton)
+        gtk.Box.pack_start(vbox, self.speakSpreadsheetCoordinatesCheckButton,
+                           False, False, 0)
+        gtk.ToggleButton.set_active(\
+            self.speakSpreadsheetCoordinatesCheckButton,
+            script_settings.speakSpreadsheetCoordinates)
+
+        # Table Navigation frame.
+        #
+        tableFrame = gtk.Frame()
+        gtk.Widget.show(tableFrame)
+        gtk.Box.pack_start(vbox, tableFrame, False, False, 5)
+
+        tableAlignment = gtk.Alignment(0.5, 0.5, 1, 1)
+        gtk.Widget.show(tableAlignment)
+        gtk.Container.add(tableFrame, tableAlignment)
+        gtk.Alignment.set_padding(tableAlignment, 0, 0, 12, 0)
+
+        tableVBox = gtk.VBox(False, 0)
+        gtk.Widget.show(tableVBox)
+        gtk.Container.add(tableAlignment, tableVBox)
+
+        # Translators: this is an option to tell Orca whether or not it
+        # should speak table cell coordinates in document content.
+        #
+        label = _("Speak _cell coordinates")
         self.speakCellCoordinatesCheckButton = gtk.CheckButton(label)
         gtk.Widget.show(self.speakCellCoordinatesCheckButton)
-        gtk.Box.pack_start(vbox, self.speakCellCoordinatesCheckButton,
+        gtk.Box.pack_start(tableVBox, self.speakCellCoordinatesCheckButton,
                            False, False, 0)
         gtk.ToggleButton.set_active(self.speakCellCoordinatesCheckButton,
-                                    script_settings.speakCellCoordinates)
+                                    settings.speakCellCoordinates)
+
+        # Translators: this is an option to tell Orca whether or not it
+        # should speak the span size of a table cell (e.g., how many
+        # rows and columns a particular table cell spans in a table).
+        #
+        label = _("Speak _multiple cell spans")
+        self.speakCellSpanCheckButton = gtk.CheckButton(label)
+        gtk.Widget.show(self.speakCellSpanCheckButton)
+        gtk.Box.pack_start(tableVBox, self.speakCellSpanCheckButton,
+                           False, False, 0)
+        gtk.ToggleButton.set_active(self.speakCellSpanCheckButton,
+                                    settings.speakCellSpan)
+
+        # Translators: this is an option for whether or not to speak
+        # the header of a table cell in document content.
+        #
+        label = _("Announce cell _header")
+        self.speakCellHeadersCheckButton = gtk.CheckButton(label)
+        gtk.Widget.show(self.speakCellHeadersCheckButton)
+        gtk.Box.pack_start(tableVBox, self.speakCellHeadersCheckButton,
+                           False, False, 0)
+        gtk.ToggleButton.set_active(self.speakCellHeadersCheckButton,
+                                    settings.speakCellHeaders)
+
+        # Translators: this is an option to allow users to skip over
+        # empty/blank cells when navigating tables in document content.
+        #
+        label = _("Skip _blank cells")
+        self.skipBlankCellsCheckButton = gtk.CheckButton(label)
+        gtk.Widget.show(self.skipBlankCellsCheckButton)
+        gtk.Box.pack_start(tableVBox, self.skipBlankCellsCheckButton,
+                           False, False, 0)
+        gtk.ToggleButton.set_active(self.skipBlankCellsCheckButton,
+                                    settings.skipBlankCells)
+
+        # Translators: this is the title of a panel containing options
+        # for specifying how to navigate tables in document content.
+        #
+        tableLabel = gtk.Label("<b>%s</b>" % _("Table Navigation"))
+        gtk.Widget.show(tableLabel)
+        gtk.Frame.set_label_widget(tableFrame, tableLabel)
+        gtk.Label.set_use_markup(tableLabel, True)
 
         return vbox
 
@@ -346,11 +419,30 @@ class Script(default.Script):
         """
 
         prefs.writelines("\n")
-        script_settings.speakCellCoordinates = \
-                 self.speakCellCoordinatesCheckButton.get_active()
         prefix = "orca.scripts.apps.soffice.script_settings"
-        prefs.writelines("%s.speakCellCoordinates = %s\n" % \
-                         (prefix, script_settings.speakCellCoordinates))
+
+        script_settings.speakSpreadsheetCoordinates = \
+                 self.speakSpreadsheetCoordinatesCheckButton.get_active()
+        prefs.writelines("%s.speakSpreadsheetCoordinates = %s\n" % \
+                         (prefix, script_settings.speakSpreadsheetCoordinates))
+
+        settings.speakCellCoordinates = \
+                 self.speakCellCoordinatesCheckButton.get_active()
+        prefs.writelines("orca.settings.speakCellCoordinates = %s\n" % \
+                         settings.speakCellCoordinates)
+
+        settings.speakCellSpan = self.speakCellSpanCheckButton.get_active()
+        prefs.writelines("orca.settings.speakCellSpan = %s\n" % \
+                         settings.speakCellSpan)
+
+        settings.speakCellHeaders = \
+                self.speakCellHeadersCheckButton.get_active()
+        prefs.writelines("orca.settings.speakCellHeaders = %s\n" % \
+                         settings.speakCellHeaders)
+
+        settings.skipBlankCells = self.skipBlankCellsCheckButton.get_active()
+        prefs.writelines("orca.settings.skipBlankCells = %s\n" % \
+                         settings.skipBlankCells)
 
     def getAppState(self):
         """Returns an object that can be passed to setAppState.  This
diff --git a/src/orca/scripts/apps/soffice/script_settings.py b/src/orca/scripts/apps/soffice/script_settings.py
index cb6cab1..bc01e35 100644
--- a/src/orca/scripts/apps/soffice/script_settings.py
+++ b/src/orca/scripts/apps/soffice/script_settings.py
@@ -25,7 +25,7 @@ __license__   = "LGPL"
 
 # Whether we speak spread sheet cell coordinates as the user moves around.
 #
-speakCellCoordinates = True
+speakSpreadsheetCoordinates = True
 
 # Whether or not to use the structrual navigation commands (e.g. H
 # for heading, T for table, and so on). At the moment, only table
diff --git a/src/orca/scripts/apps/soffice/speech_generator.py b/src/orca/scripts/apps/soffice/speech_generator.py
index 484ca3d..01032a0 100644
--- a/src/orca/scripts/apps/soffice/speech_generator.py
+++ b/src/orca/scripts/apps/soffice/speech_generator.py
@@ -316,7 +316,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         try:
             if obj.queryText():
                 objectText = self._script.getText(obj, 0, -1)
-                if not script_settings.speakCellCoordinates \
+                if not script_settings.speakSpreadsheetCoordinates \
                    or args.get('formatType', 'unfocused') == 'basicWhereAmI' \
                    and len(objectText) == 0:
                     # Translators: this indicates an empty (blank) spread
@@ -327,7 +327,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         except NotImplementedError:
             pass
 
-        if script_settings.speakCellCoordinates \
+        if script_settings.speakSpreadsheetCoordinates \
            and args.get('formatType', 'unfocused') != 'basicWhereAmI':
             nameList = obj.name.split()
             # We were assuming that the word for "cell" would always
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index abcc96f..c336fb1 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -822,7 +822,7 @@ class Script(default.Script):
         gtk.Container.add(tableAlignment, tableVBox)
 
         # Translators: this is an option to tell Orca whether or not it
-        # should speak table cell coordinates in HTML content.
+        # should speak table cell coordinates in document content.
         #
         label = _("Speak _cell coordinates")
         self.speakCellCoordinatesCheckButton = gtk.CheckButton(label)
@@ -845,7 +845,7 @@ class Script(default.Script):
                                     settings.speakCellSpan)
 
         # Translators: this is an option for whether or not to speak
-        # the header of a table cell in HTML content.
+        # the header of a table cell in document content.
         #
         label = _("Announce cell _header")
         self.speakCellHeadersCheckButton = gtk.CheckButton(label)
@@ -856,7 +856,7 @@ class Script(default.Script):
                                     settings.speakCellHeaders)
 
         # Translators: this is an option to allow users to skip over
-        # empty/blank cells when navigating tables in HTML content.
+        # empty/blank cells when navigating tables in document content.
         #
         label = _("Skip _blank cells")
         self.skipBlankCellsCheckButton = gtk.CheckButton(label)
@@ -867,7 +867,7 @@ class Script(default.Script):
                                     settings.skipBlankCells)
 
         # Translators: this is the title of a panel containing options
-        # for specifying how to navigate tables in HTML content.
+        # for specifying how to navigate tables in document content.
         #
         tableLabel = gtk.Label("<b>%s</b>" % _("Table Navigation"))
         gtk.Widget.show(tableLabel)
diff --git a/test/keystrokes/oowriter/table-sample2.odt b/test/keystrokes/oowriter/table-sample2.odt
new file mode 100644
index 0000000..4f473a7
Binary files /dev/null and b/test/keystrokes/oowriter/table-sample2.odt differ
diff --git a/test/keystrokes/oowriter/table_cells_structural_navigation1.params b/test/keystrokes/oowriter/table_cells_structural_navigation1.params
new file mode 100644
index 0000000..60a3f6c
--- /dev/null
+++ b/test/keystrokes/oowriter/table_cells_structural_navigation1.params
@@ -0,0 +1 @@
+PARAMS=$TEST_DIR/table-sample2.odt
diff --git a/test/keystrokes/oowriter/table_cells_structural_navigation1.py b/test/keystrokes/oowriter/table_cells_structural_navigation1.py
new file mode 100644
index 0000000..da87432
--- /dev/null
+++ b/test/keystrokes/oowriter/table_cells_structural_navigation1.py
@@ -0,0 +1,242 @@
+#!/usr/bin/python
+
+"""Test for navigating amongst table cells in Writer."""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+######################################################################
+# Start oowriter. There is a table_cells.params file that will
+# automatically load table-sample.odt
+#
+sequence.append(WaitForWindowActivate("table-sample(.odt|) - " + utils.getOOoName("Writer"),None))
+
+######################################################################
+# Type Control-Home to move the text caret to the start of the document.
+#
+sequence.append(KeyComboAction("<Control>Home"))
+
+######################################################################
+# Type a down arrow to move to the next line.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "Type a down arrow to move to the next line",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "This is a test. \$l") + "'",
+     "     VISIBLE:  'This is a test. $l', cursor=16",
+     "BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "This is a test. \$l") + "'",
+     "     VISIBLE:  'This is a test. $l', cursor=16",
+     "SPEECH OUTPUT: 'This is a test.'"]))
+
+######################################################################
+# Down Arrow to move a few rows into the table.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "1. Down",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Mon Paragraph") + "'",
+     "     VISIBLE:  'Mon Paragraph', cursor=1",
+     "SPEECH OUTPUT: 'table with 7 rows and 7 columns.",
+     "SPEECH OUTPUT: 'Mon'",
+     "SPEECH OUTPUT: 'Cell B1'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "2. Down",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Paragraph") + "'",
+     "     VISIBLE:  'Paragraph', cursor=1",
+     "SPEECH OUTPUT: 'blank'",
+     "SPEECH OUTPUT: 'Cell B2'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "3. Down",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 4 Paragraph") + "'",
+     "     VISIBLE:  '4 Paragraph', cursor=1",
+     "SPEECH OUTPUT: '4'",
+     "SPEECH OUTPUT: 'Cell B3'"]))
+
+######################################################################
+# Toggle structural navigation
+#
+sequence.append(KeyPressAction(0, None, "KP_Insert"))
+sequence.append(KeyComboAction("z"))
+sequence.append(KeyReleaseAction(0, None, "KP_Insert"))
+sequence.append(PauseAction(3000))
+
+######################################################################
+# Use table navigation to move to amongst the cells
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Left"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "1. Alt Shift Left.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 3 Paragraph") + "'",
+     "     VISIBLE:  '3 Paragraph', cursor=1",
+     "BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 3 Paragraph") + "'",
+     "     VISIBLE:  '3 Paragraph', cursor=1",
+     "SPEECH OUTPUT: '3'",
+     "SPEECH OUTPUT: 'Row 3, column 1."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Left"))
+sequence.append(utils.AssertPresentationAction(
+    "2. Alt Shift Left.",
+    ["SPEECH OUTPUT: 'Beginning of row."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Right"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "3. Alt Shift Right.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 4 Paragraph") + "'",
+     "     VISIBLE:  '4 Paragraph', cursor=1",
+     "BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 4 Paragraph") + "'",
+     "     VISIBLE:  '4 Paragraph', cursor=1","SPEECH OUTPUT: '4'",
+     "SPEECH OUTPUT: 'Row 3, column 2."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Right"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "4. Alt Shift Right.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 5 Paragraph") + "'",
+     "     VISIBLE:  '5 Paragraph', cursor=1",
+     "BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 5 Paragraph") + "'",
+     "     VISIBLE:  '5 Paragraph', cursor=1",
+     "SPEECH OUTPUT: '5'",
+     "SPEECH OUTPUT: 'Row 3, column 3."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Right"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "5. Alt Shift Right.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 6 Paragraph7 Paragraph") + "'",
+     "     VISIBLE:  '7 Paragraph', cursor=1",
+     "BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table 6 Paragraph7 Paragraph") + "'",
+     "     VISIBLE:  '7 Paragraph', cursor=1",
+     "SPEECH OUTPUT: '6 7'",
+     "SPEECH OUTPUT: 'Row 3, column 4.",
+     "SPEECH OUTPUT: 'Cell spans 2 columns'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Up"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "6. Alt Shift Up.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Paragraph") + "'",
+     "     VISIBLE:  'Paragraph', cursor=1",
+     "SPEECH OUTPUT: 'blank'",
+     "SPEECH OUTPUT: 'Row 2, column 4."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Up"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "7. Alt Shift Up.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Wed Paragraph") + "'",
+     "     VISIBLE:  'Wed Paragraph', cursor=1",
+     "BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Wed Paragraph") + "'",
+     "     VISIBLE:  'Wed Paragraph', cursor=1",
+     "SPEECH OUTPUT: 'Wed'",
+     "SPEECH OUTPUT: 'Row 1, column 4."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Up"))
+sequence.append(utils.AssertPresentationAction(
+    "8. Alt Shift Up.",
+    ["SPEECH OUTPUT: 'Top of column."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>End"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "9. Alt Shift End.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Paragraph") + "'",
+     "     VISIBLE:  'Paragraph', cursor=1",
+     "SPEECH OUTPUT: 'blank'",
+     "SPEECH OUTPUT: 'Row 7, column 7."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Down"))
+sequence.append(utils.AssertPresentationAction(
+    "10. Alt Shift Down.",
+    ["SPEECH OUTPUT: 'Bottom of column."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Right"))
+sequence.append(utils.AssertPresentationAction(
+    "11. Alt Shift Right.",
+    ["SPEECH OUTPUT: 'End of row."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Home"))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+sequence.append(utils.AssertPresentationAction(
+    "12. Alt Shift Home.",
+    ["BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Sun Paragraph") + "'",
+     "     VISIBLE:  'Sun Paragraph', cursor=1",
+     "BRAILLE LINE:  '" + utils.getOOoBrailleLine("Writer", "table-sample2(.odt|)", "Calendar-1 Table Sun Paragraph") + "'",
+     "     VISIBLE:  'Sun Paragraph', cursor=1",
+     "SPEECH OUTPUT: 'Sun'",
+     "SPEECH OUTPUT: 'Row 1, column 1."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Alt><Shift>Up"))
+sequence.append(utils.AssertPresentationAction(
+    "13. Alt Shift Up.",
+    ["SPEECH OUTPUT: 'Top of column."]))
+
+######################################################################
+# Enter Alt-f, Alt-c to close this Writer application.
+# A save dialog will appear.
+#
+sequence.append(KeyComboAction("<Alt><Shift>f"))
+sequence.append(WaitForFocus("New", acc_role=pyatspi.ROLE_MENU))
+
+sequence.append(KeyComboAction("<Alt><Shift>c"))
+sequence.append(WaitAction("object:property-change:accessible-name",
+                           None,
+                           None,
+                           pyatspi.ROLE_ROOT_PANE,
+                           30000))
+
+######################################################################
+# Enter Alt-f, right arrow and Return, (File->New->Text Document),
+# to get the application back to the state it was in when the
+# test started.
+#
+sequence.append(KeyComboAction("<Alt><Shift>f"))
+sequence.append(WaitForFocus("New", acc_role=pyatspi.ROLE_MENU))
+
+sequence.append(KeyComboAction("Right"))
+sequence.append(WaitForFocus("Text Document", acc_role=pyatspi.ROLE_MENU_ITEM))
+
+sequence.append(KeyComboAction("Return"))
+sequence.append(WaitAction("object:property-change:accessible-name",
+                           None,
+                           None,
+                           pyatspi.ROLE_ROOT_PANE,
+                           30000))
+sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_PARAGRAPH))
+
+######################################################################
+# Wait for things to get back to normal.
+#
+sequence.append(PauseAction(3000))
+
+sequence.append(utils.AssertionSummaryAction())
+
+sequence.start()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]