orca r3486 - in trunk: . src/orca test/html test/keystrokes/firefox



Author: joanied
Date: Mon Jan 21 19:57:07 2008
New Revision: 3486
URL: http://svn.gnome.org/viewvc/orca?rev=3486&view=rev

Log:
* src/orca/Gecko.py:
  test/keystrokes/firefox/line_nav_imagemap.py:
  test/html/letters.gif:
  test/html/backwards.html:
  Work on bug #506360 - find{Next,Previous}Line() should be
  more efficient. (I included a new regression test for the
  issue as well.)


Added:
   trunk/test/html/backwards.html
   trunk/test/html/letters.gif   (contents, props changed)
   trunk/test/keystrokes/firefox/line_nav_imagemap.py
Modified:
   trunk/ChangeLog
   trunk/src/orca/Gecko.py

Modified: trunk/src/orca/Gecko.py
==============================================================================
--- trunk/src/orca/Gecko.py	(original)
+++ trunk/src/orca/Gecko.py	Mon Jan 21 19:57:07 2008
@@ -5980,6 +5980,19 @@
             if end > childOffset + 1:
                 objects.append([obj, childOffset + 1, end])
 
+        if obj.getRole() == pyatspi.ROLE_IMAGE and obj.childCount:
+            # Imagemaps that don't have alternative text won't implement
+            # the text interface, but they will have children (essentially
+            # EOCs) that we need to get.
+            #
+            toAdd = []
+            for child in obj:
+                toAdd.extend(self.getObjectsFromEOCs(child, 0, boundary))
+            if len(toAdd):
+                if self.isSameObject(objects[-1][0], obj):
+                    objects.pop()
+                objects.extend(toAdd)
+
         return objects
 
     def guessLabelFromLine(self, obj):

Added: trunk/test/html/backwards.html
==============================================================================
--- (empty file)
+++ trunk/test/html/backwards.html	Mon Jan 21 19:57:07 2008
@@ -0,0 +1,47 @@
+<html>
+<head>
+<title>Backwards Stuff</title>
+</head>
+<body>
+<p>This looks like A to Z, but it's really Z to A.</p>
+<table border="0" cellpadding="0" cellspacing="0" width="459">
+<tbody>
+<tr>
+<td>Test:</td>
+<td class="atoz-rm">
+<map name="atoz_map">
+<area shape="rect" alt="z" coords="433,0,446,14" href="#z">
+<area shape="rect" alt="y" coords="416,0,429,14" href="#y">
+<area shape="rect" alt="x" coords="398,0,411,14" href="#x">
+<area shape="rect" alt="w" coords="381,0,394,14" href="#w">
+<area shape="rect" alt="v" coords="364,0,377,14" href="#v">
+<area shape="rect" alt="u" coords="346,0,359,14" href="#u">
+<area shape="rect" alt="t" coords="329,0,342,14" href="#t">
+<area shape="rect" alt="s" coords="312,0,325,14" href="#s">
+<area shape="rect" alt="r" coords="294,0,307,14" href="#r">
+<area shape="rect" alt="q" coords="277,0,290,14" href="#q">
+<area shape="rect" alt="p" coords="260,0,273,14" href="#p">
+<area shape="rect" alt="o" coords="242,0,255,14" href="#o">
+<area shape="rect" alt="n" coords="225,0,238,14" href="#n">
+<area shape="rect" alt="m" coords="208,0,221,14" href="#m">
+<area shape="rect" alt="l" coords="190,0,203,14" href="#l">
+<area shape="rect" alt="k" coords="171,0,184,14" href="#k">
+<area shape="rect" alt="j" coords="156,0,169,14" href="#j">
+<area shape="rect" alt="i" coords="138,0,151,14" href="#i">
+<area shape="rect" alt="h" coords="121,0,134,14" href="#h">
+<area shape="rect" alt="g" coords="104,0,117,14" href="#g">
+<area shape="rect" alt="f" coords="86,0,99,14" href="#f">
+<area shape="rect" alt="e" coords="69,0,82,14" href="#e">
+<area shape="rect" alt="d" coords="52,0,65,14" href="#d">
+<area shape="rect" alt="c" coords="34,0,47,14" href="#c">
+<area shape="rect" alt="b" coords="17,0,30,14" href="#b">
+<area shape="rect" alt="a" coords="0,0,13,14" href="#a">
+</map>
+<img src="letters.gif" alt="" usemap="#atoz_map" border="0" height="15" width="447">
+</td>
+</tr>
+</tbody>
+</table>
+<p>Here is some text.</p>
+</body>
+</html>

Added: trunk/test/html/letters.gif
==============================================================================
Binary file. No diff available.

Added: trunk/test/keystrokes/firefox/line_nav_imagemap.py
==============================================================================
--- (empty file)
+++ trunk/test/keystrokes/firefox/line_nav_imagemap.py	Mon Jan 21 19:57:07 2008
@@ -0,0 +1,97 @@
+#!/usr/bin/python
+
+"""Test of line navigation output of Firefox on a page with an
+imagemap.
+"""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+########################################################################
+# We wait for the focus to be on a blank Firefox window.
+#
+sequence.append(WaitForWindowActivate("Minefield",None))
+
+########################################################################
+# Load the local "backwards" test case.
+#
+sequence.append(KeyComboAction("<Control>l"))
+sequence.append(WaitForFocus("Location", acc_role=pyatspi.ROLE_ENTRY))
+
+sequence.append(TypeAction(utils.htmlURLPrefix + "backwards.html"))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(WaitForDocLoad())
+
+sequence.append(WaitForFocus("Backwards Stuff",
+                             acc_role=pyatspi.ROLE_DOCUMENT_FRAME))
+
+########################################################################
+# Press Control+Home to move to the top.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("<Control>Home"))
+sequence.append(utils.AssertPresentationAction(
+    "Top of file",
+    ["BRAILLE LINE:  'This looks like A to Z, but it's really Z to A.'",
+     "     VISIBLE:  'This looks like A to Z, but it's', cursor=1",
+     "SPEECH OUTPUT: 'This looks like A to Z, but it's really Z to A.'"]))
+
+########################################################################
+# Down Arrow to the End.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "1. line Down",
+    ["BRAILLE LINE:  'Test: z Link y Link x Link w Link v Link u Link t Link s Link r Link q Link p Link o Link n Link m Link l Link k Link j Link i Link h Link g Link f Link e Link d Link c Link b Link a Link'",
+     "     VISIBLE:  'Test: z Link y Link x Link w Lin', cursor=1",
+     "SPEECH OUTPUT: 'Test: z link y link x link w link v link u link t link s link r link q link p link o link n link m link l link k link j link i link h link g link f link e link d link c link b link a link'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+    "2. line Down",
+    ["BRAILLE LINE:  'Here is some text.'",
+     "     VISIBLE:  'Here is some text.', cursor=1",
+     "SPEECH OUTPUT: 'Here is some text.'"]))
+
+########################################################################
+# Up Arrow to the Top.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "1. line Up",
+    ["BRAILLE LINE:  'Test: z Link y Link x Link w Link v Link u Link t Link s Link r Link q Link p Link o Link n Link m Link l Link k Link j Link i Link h Link g Link f Link e Link d Link c Link b Link a Link'",
+     "     VISIBLE:  'Test: z Link y Link x Link w Lin', cursor=1",
+     "SPEECH OUTPUT: 'Test: z link y link x link w link v link u link t link s link r link q link p link o link n link m link l link k link j link i link h link g link f link e link d link c link b link a link'"]))
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Up"))
+sequence.append(utils.AssertPresentationAction(
+    "2. line Up",
+    ["BRAILLE LINE:  'This looks like A to Z, but it's really Z to A.'",
+     "     VISIBLE:  'This looks like A to Z, but it's', cursor=1",
+     "SPEECH OUTPUT: 'This looks like A to Z, but it's really Z to A.'"]))
+
+########################################################################
+# Move to the location bar by pressing Control+L.  When it has focus
+# type "about:blank" and press Return to restore the browser to the
+# conditions at the test's start.
+#
+sequence.append(KeyComboAction("<Control>l"))
+sequence.append(WaitForFocus("Location", acc_role=pyatspi.ROLE_ENTRY))
+
+sequence.append(TypeAction("about:blank"))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(WaitForDocLoad())
+
+# Just a little extra wait to let some events get through.
+#
+sequence.append(PauseAction(3000))
+
+sequence.start()



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