orca r4521 - in trunk: . src/orca/scripts/toolkits/Gecko test/keystrokes/firefox
- From: joanied svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r4521 - in trunk: . src/orca/scripts/toolkits/Gecko test/keystrokes/firefox
- Date: Tue, 10 Feb 2009 21:25:28 +0000 (UTC)
Author: joanied
Date: Tue Feb 10 21:25:27 2009
New Revision: 4521
URL: http://svn.gnome.org/viewvc/orca?rev=4521&view=rev
Log:
* src/orca/scripts/toolkits/Gecko/script.py:
test/keystrokes/firefox/bug_568768.py: (new)
test/keystrokes/firefox/bug_552887a.py:
Fix for bug #568768 - Orca starts at the top of a newly-loaded
page rather than the specified fragment.
Added:
trunk/test/keystrokes/firefox/bug_568768.py
Modified:
trunk/ChangeLog
trunk/src/orca/scripts/toolkits/Gecko/script.py
trunk/test/keystrokes/firefox/bug_552887a.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 Feb 10 21:25:27 2009
@@ -4974,6 +4974,36 @@
return attrs
+ def searchForCaretLocation(self, acc):
+ """Attempts to locate the caret on the page independent of our
+ caret context. This functionality is needed when a page loads
+ and the URL is for a fragment (anchor, id, named object) within
+ that page.
+
+ Arguments:
+ - acc: The top-level accessible in which we suspect to find the
+ caret (most likely the document frame).
+
+ Returns the [obj, caretOffset] containing the caret if it can
+ be determined. Otherwise [None, -1] is returned.
+ """
+
+ context = [None, -1]
+ while acc:
+ try:
+ offset = acc.queryText().caretOffset
+ except:
+ acc = None
+ else:
+ context = [acc, offset]
+ childIndex = self.getChildIndex(acc, offset)
+ if childIndex >= 0:
+ acc = acc[childIndex]
+ else:
+ break
+
+ return context
+
def getCaretContext(self, includeNonText=True):
"""Returns the current [obj, caretOffset] if defined. If not,
it returns the first [obj, caretOffset] found by an in order
@@ -4991,9 +5021,14 @@
try:
return self._documentFrameCaretContext[hash(documentFrame)]
except:
+ # If we don't have a context, we should attempt to see if we
+ # can find the caret first. Failing that, we'll start at the
+ # top.
+ #
+ [obj, caretOffset] = self.searchForCaretLocation(documentFrame)
self._documentFrameCaretContext[hash(documentFrame)] = \
- self.findNextCaretInOrder(None,
- -1,
+ self.findNextCaretInOrder(obj,
+ max(-1, caretOffset - 1),
includeNonText)
[obj, caretOffset] = \
Modified: trunk/test/keystrokes/firefox/bug_552887a.py
==============================================================================
--- trunk/test/keystrokes/firefox/bug_552887a.py (original)
+++ trunk/test/keystrokes/firefox/bug_552887a.py Tue Feb 10 21:25:27 2009
@@ -31,9 +31,12 @@
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.AssertPresentationAction(
"Top of file",
- ["BRAILLE LINE: ''",
+ ["BUG? - In this test, the text is extremely small and probably appears to be on the same line, so we're speaking more than we should be",
+ "BRAILLE LINE: ''",
" VISIBLE: '', cursor=1",
- "SPEECH OUTPUT: 'blank'"]))
+ "SPEECH OUTPUT: '",
+ " Line 1",
+ "'"]))
########################################################################
# Down Arrow to the bottom.
Added: trunk/test/keystrokes/firefox/bug_568768.py
==============================================================================
--- (empty file)
+++ trunk/test/keystrokes/firefox/bug_568768.py Tue Feb 10 21:25:27 2009
@@ -0,0 +1,58 @@
+# -*- coding: utf-8 -*-
+#!/usr/bin/python
+
+"""Test of the fix for bug 568768"""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+########################################################################
+# We wait for the focus to be on a blank Firefox window.
+#
+sequence.append(WaitForWindowActivate(utils.firefoxFrameNames, None))
+
+########################################################################
+# Load the local "simple form" test case.
+#
+sequence.append(KeyComboAction("<Control>l"))
+sequence.append(WaitForFocus(acc_role=pyatspi.ROLE_ENTRY))
+
+sequence.append(TypeAction(utils.htmlURLPrefix + "orca-wiki.html#head-a269540f0f3a25d25e08216f0438ee743a3ebe88"))
+sequence.append(KeyComboAction("Return"))
+
+sequence.append(WaitForDocLoad())
+
+########################################################################
+# Down Arrow to the next line, which should be the line after the
+# About heading.
+#
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("Down"))
+sequence.append(utils.AssertPresentationAction(
+ "Line Down",
+ ["BRAILLE LINE: 'Orca is a free, open source, flexible, extensible, and powerful assistive'",
+ " VISIBLE: 'Orca is a free, open source, fle', cursor=1",
+ "SPEECH OUTPUT: 'Orca is a free, open source, flexible, extensible, and powerful assistive'"]))
+
+########################################################################
+# 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(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.append(utils.AssertionSummaryAction())
+
+sequence.start()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]