orca r4395 - in trunk: . src/orca/scripts/toolkits/Gecko test/harness test/keystrokes/firefox



Author: joanied
Date: Tue Dec 30 19:40:34 2008
New Revision: 4395
URL: http://svn.gnome.org/viewvc/orca?rev=4395&view=rev

Log:
* src/orca/scripts/toolkits/Gecko/script.py:
  test/harness/utils.py:
  test/keystrokes/firefox/xul_role_menu_bar.py:
  test/keystrokes/firefox/xul_role_tree_table.py:
  test/keystrokes/firefox/xul_role_radio_menu_item.py:
  Fix for bug #566073 - Orca provides the "tree level" for items in
  submenus within Firefox 3.x.



Modified:
   trunk/ChangeLog
   trunk/src/orca/scripts/toolkits/Gecko/script.py
   trunk/test/harness/utils.py
   trunk/test/keystrokes/firefox/xul_role_menu_bar.py
   trunk/test/keystrokes/firefox/xul_role_radio_menu_item.py
   trunk/test/keystrokes/firefox/xul_role_tree_table.py

Modified: trunk/src/orca/scripts/toolkits/Gecko/script.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/script.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/script.py	Tue Dec 30 19:40:34 2008
@@ -3510,7 +3510,8 @@
         object attribute 'level'.  To be consistent with default.getNodeLevel()
         this value is 0-based (Gecko return is 1-based) """
 
-        if obj is None or obj.getRole() == pyatspi.ROLE_HEADING:
+        if obj is None or obj.getRole() == pyatspi.ROLE_HEADING \
+           or obj.parent.getRole() == pyatspi.ROLE_MENU:
             return -1
 
         try:

Modified: trunk/test/harness/utils.py
==============================================================================
--- trunk/test/harness/utils.py	(original)
+++ trunk/test/harness/utils.py	Tue Dec 30 19:40:34 2008
@@ -28,6 +28,7 @@
 #
 firefoxAppNames = "(Firefox|Minefield)"
 firefoxFrameNames = "(Mozilla Firefox|Mozilla Firefox 3.1 Beta 2|Minefield)"
+firefoxLocationBarNames = "(Location|Search Bookmarks and History)"
 
 # Various OpenOffice names as a regex.  These are needed because OOo likes
 # to do various things with its window titles from release to release. 

Modified: trunk/test/keystrokes/firefox/xul_role_menu_bar.py
==============================================================================
--- trunk/test/keystrokes/firefox/xul_role_menu_bar.py	(original)
+++ trunk/test/keystrokes/firefox/xul_role_menu_bar.py	Tue Dec 30 19:40:34 2008
@@ -67,41 +67,53 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "Right Arrow on menu bar",
-    ["BUG? - We're speaking the tree level for a non-tree",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar View Menu <x> Navigation Toolbar CheckItem'",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar View Menu <x> Navigation Toolbar CheckItem'",
      "     VISIBLE:  '<x> Navigation Toolbar CheckItem', cursor=1",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Navigation Toolbar check item checked'",
-     "SPEECH OUTPUT: 'tree level 1'"]))
+     "SPEECH OUTPUT: 'Navigation Toolbar check item checked'"]))
 
 ########################################################################
 # Press Left Arrow to move backward menu by menu
 #
+
+# The location bar has different names. Where the cursor is will depend
+# on the length of the name.
+#
+cursorPosition = utils.firefoxLocationBarNames
+for name in cursorPosition[1:-1].split("|"):
+    cursorPosition = cursorPosition.replace(name, "%s" % (len(name) + 2))
+
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Left"))
 sequence.append(utils.AssertPresentationAction(
     "Left Arrow on menu bar",
-    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar AutoComplete Location  \$l'",
-     "     VISIBLE:  'Location  $l', cursor=10",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar AutoComplete " + utils.firefoxLocationBarNames + "  \$l'",
+     "     VISIBLE:  '" + utils.firefoxLocationBarNames + "  \$l', cursor=%s" % cursorPosition,
      "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Toolbars Menu'",
      "     VISIBLE:  'Toolbars Menu', cursor=1",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Location text '",
+     "SPEECH OUTPUT: '" + utils.firefoxLocationBarNames + " text '",
      "SPEECH OUTPUT: 'View menu'",
      "SPEECH OUTPUT: 'Toolbars menu'",]))
 
+# This seems to vary depending on whether or not something is in the
+# clipboard. Therefore, we'll check for either.
+#
+menuItem = "(Paste|Select All)"
+itemShortcut = "(V|A)"
+
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Left"))
 sequence.append(utils.AssertPresentationAction(
     "Left Arrow on menu bar",
     ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Edit Menu'",
      "     VISIBLE:  'Edit Menu', cursor=1",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Paste\(Control V\)'",
-     "     VISIBLE:  'Paste(Control V)', cursor=1",
+     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar " + menuItem + "\(Control " + itemShortcut + "\)'",
+     "     VISIBLE:  '" + menuItem + "\(Control " + itemShortcut + "\)', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Edit menu'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Paste Control V'"]))
+     "SPEECH OUTPUT: '" + menuItem + " Control " + itemShortcut + "'"]))
 
 ########################################################################
 # Dismiss the menu by pressing Escape and wait for the location bar

Modified: trunk/test/keystrokes/firefox/xul_role_radio_menu_item.py
==============================================================================
--- trunk/test/keystrokes/firefox/xul_role_radio_menu_item.py	(original)
+++ trunk/test/keystrokes/firefox/xul_role_radio_menu_item.py	Tue Dec 30 19:40:34 2008
@@ -34,16 +34,14 @@
 sequence.append(KeyComboAction("y"))
 sequence.append(utils.AssertPresentationAction(
     "y for Page Style menu",
-    ["BUG? - We're speaking a tree level for a non tree item",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Page Style Menu'",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar Page Style Menu'",
      "     VISIBLE:  'Page Style Menu', cursor=1",
      "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application " + utils.firefoxFrameNames + " Frame ToolBar Application MenuBar View Menu & y No Style RadioItem'",
      "     VISIBLE:  '& y No Style RadioItem', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Page Style menu'",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'No Style not selected radio menu item'",
-     "SPEECH OUTPUT: 'tree level 1'"]))
+     "SPEECH OUTPUT: 'No Style not selected radio menu item'"]))
 
 ########################################################################
 # Do a basic "Where Am I" via KP_Enter. 

Modified: trunk/test/keystrokes/firefox/xul_role_tree_table.py
==============================================================================
--- trunk/test/keystrokes/firefox/xul_role_tree_table.py	(original)
+++ trunk/test/keystrokes/firefox/xul_role_tree_table.py	Tue Dec 30 19:40:34 2008
@@ -44,14 +44,36 @@
 sequence.append(PauseAction(3000))
 
 ########################################################################
+# Press Down Arrow to get to the first item in the tree and Up Arrow to
+# get back. We'll do this because in Firefox 3.1 we are not getting the
+# correct events until we Alt+Tab out of and then back into the window.
+# This does not seem to be an issue for Firefox 3.0
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "Down Arrow in tree table",
+    ["KNOWN ISSUE - Firefox 3.1 is not giving us anything here, but Firefox 3.0 is. If we have output, the bug is not present."]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "Up Arrow in tree table",
+    ["KNOWN ISSUE - Firefox 3.1 is not giving us anything here, but Firefox 3.0 is. If we have output, the bug is not present."]))
+
+sequence.append(KeyComboAction("<Alt>Tab"))
+sequence.append(WaitForWindowActivate(utils.firefoxFrameNames, None))
+sequence.append(KeyComboAction("<Alt>Tab"))
+sequence.append(WaitForWindowActivate("Library", None))
+
+########################################################################
 # Press Down Arrow to get to the first item in the tree.  
 #
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Down"))
 sequence.append(utils.AssertPresentationAction(
     "Down Arrow in tree table",
-    ["BUG? - We're not speaking the tree level",
-     "BRAILLE LINE:  '" + utils.firefoxAppNames + " Application Library Frame ScrollPane TreeTable Name ColumnHeader Bookmarks Menu   TREE LEVEL 1'",
+    ["BRAILLE LINE:  '" + utils.firefoxAppNames + " Application Library Frame ScrollPane TreeTable Name ColumnHeader Bookmarks Menu   TREE LEVEL 1'",
      "     VISIBLE:  'Bookmarks Menu   TREE LEVEL 1', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Bookmarks Menu  '"]))



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