orca r4476 - in branches/gnome-2-24: . src/orca src/orca/scripts/toolkits/Gecko test/keystrokes/firefox
- From: wwalker svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r4476 - in branches/gnome-2-24: . src/orca src/orca/scripts/toolkits/Gecko test/keystrokes/firefox
- Date: Thu, 29 Jan 2009 22:11:14 +0000 (UTC)
Author: wwalker
Date: Thu Jan 29 22:11:14 2009
New Revision: 4476
URL: http://svn.gnome.org/viewvc/orca?rev=4476&view=rev
Log:
Fix for bug #552965 - aria-valuetext ignored
Modified:
branches/gnome-2-24/ChangeLog
branches/gnome-2-24/src/orca/default.py
branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py
branches/gnome-2-24/test/keystrokes/firefox/dojo_slider.py
branches/gnome-2-24/test/keystrokes/firefox/moz_slider.py
Modified: branches/gnome-2-24/src/orca/default.py
==============================================================================
--- branches/gnome-2-24/src/orca/default.py (original)
+++ branches/gnome-2-24/src/orca/default.py Thu Jan 29 22:11:14 2009
@@ -5965,6 +5965,14 @@
Returns a string representing the value.
"""
+ # Use ARIA "valuetext" attribute if present. See
+ # http://bugzilla.gnome.org/show_bug.cgi?id=552965
+ #
+ attributes = obj.getAttributes()
+ for attribute in attributes:
+ if attribute.startswith("valuetext"):
+ return attribute[10:]
+
try:
value = obj.queryValue()
except NotImplementedError:
Modified: branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py
==============================================================================
--- branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py (original)
+++ branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py Thu Jan 29 22:11:14 2009
@@ -29,7 +29,6 @@
__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
__license__ = "LGPL"
-import math
import pyatspi
import orca.rolenames as rolenames
@@ -764,40 +763,7 @@
return speechgenerator.SpeechGenerator.\
_getSpeechForSlider(self, obj, already_focused)
- value = obj.queryValue()
-
- # OK, this craziness is all about trying to figure out the most
- # meaningful formatting string for the floating point values.
- # The number of places to the right of the decimal point should
- # be set by the minimumIncrement, but the minimumIncrement isn't
- # always set. So...we'll default the minimumIncrement to 1/100
- # of the range. But, if max == min, then we'll just go for showing
- # them off to two meaningful digits.
- #
- try:
- minimumIncrement = value.minimumIncrement
- except:
- minimumIncrement = 0.0
-
- if minimumIncrement == 0.0:
- minimumIncrement = (value.maximumValue - value.minimumValue) \
- / 100.0
-
- try:
- decimalPlaces = max(0, -math.log10(minimumIncrement))
- except:
- try:
- decimalPlaces = max(0, -math.log10(value.minimumValue))
- except:
- try:
- decimalPlaces = max(0, -math.log10(value.maximumValue))
- except:
- decimalPlaces = 0
-
- formatter = "%%.%df" % decimalPlaces
- valueString = formatter % value.currentValue
- #minString = formatter % value.minimumValue
- #maxString = formatter % value.maximumValue
+ valueString = self._script.getTextForValue(obj)
if already_focused:
utterances = [valueString]
Modified: branches/gnome-2-24/test/keystrokes/firefox/dojo_slider.py
==============================================================================
--- branches/gnome-2-24/test/keystrokes/firefox/dojo_slider.py (original)
+++ branches/gnome-2-24/test/keystrokes/firefox/dojo_slider.py Thu Jan 29 22:11:14 2009
@@ -69,9 +69,10 @@
5000))
sequence.append(utils.AssertPresentationAction(
"1 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 10 Slider'",
- " VISIBLE: 'Horizontal Slider Example 10 Sli', cursor=1",
- "SPEECH OUTPUT: '10'"]))
+ ["KNOWN ISSUE - crazy valuetext http://bugs.dojotoolkit.org/ticket/8539",
+ "BRAILLE LINE: 'Horizontal Slider Example 10.242130750605327 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.242', cursor=1",
+ "SPEECH OUTPUT: '10.242130750605327'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
@@ -82,9 +83,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"2 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 10 Slider'",
- " VISIBLE: 'Horizontal Slider Example 10 Sli', cursor=1",
- "SPEECH OUTPUT: '10'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 10.484261501210653 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.484', cursor=1",
+ "SPEECH OUTPUT: '10.484261501210653'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
@@ -95,9 +96,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"3 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 11 Slider'",
- " VISIBLE: 'Horizontal Slider Example 11 Sli', cursor=1",
- "SPEECH OUTPUT: '11'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 10.72639225181598 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.726', cursor=1",
+ "SPEECH OUTPUT: '10.72639225181598'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
@@ -108,9 +109,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"4 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 11 Slider'",
- " VISIBLE: 'Horizontal Slider Example 11 Sli', cursor=1",
- "SPEECH OUTPUT: '11'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 10.968523002421307 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.968', cursor=1",
+ "SPEECH OUTPUT: '10.968523002421307'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
@@ -121,9 +122,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"5 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 11 Slider'",
- " VISIBLE: 'Horizontal Slider Example 11 Sli', cursor=1",
- "SPEECH OUTPUT: '11'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 11.210653753026634 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 11.210', cursor=1",
+ "SPEECH OUTPUT: '11.210653753026634'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -134,9 +135,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"6 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 11 Slider'",
- " VISIBLE: 'Horizontal Slider Example 11 Sli', cursor=1",
- "SPEECH OUTPUT: '11'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 10.968523002421307 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.968', cursor=1",
+ "SPEECH OUTPUT: '10.968523002421307'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -147,9 +148,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"7 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 11 Slider'",
- " VISIBLE: 'Horizontal Slider Example 11 Sli', cursor=1",
- "SPEECH OUTPUT: '11'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 10.72639225181598 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.726', cursor=1",
+ "SPEECH OUTPUT: '10.72639225181598'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -160,9 +161,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"8 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 10 Slider'",
- " VISIBLE: 'Horizontal Slider Example 10 Sli', cursor=1",
- "SPEECH OUTPUT: '10'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 10.484261501210653 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.484', cursor=1",
+ "SPEECH OUTPUT: '10.484261501210653'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -173,9 +174,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"9 move first slider",
- ["BRAILLE LINE: 'Horizontal Slider Example 10 Slider'",
- " VISIBLE: 'Horizontal Slider Example 10 Sli', cursor=1",
- "SPEECH OUTPUT: '10'"]))
+ ["BRAILLE LINE: 'Horizontal Slider Example 10.242130750605327 Slider'",
+ " VISIBLE: 'Horizontal Slider Example 10.242', cursor=1",
+ "SPEECH OUTPUT: '10.242130750605327'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
Modified: branches/gnome-2-24/test/keystrokes/firefox/moz_slider.py
==============================================================================
--- branches/gnome-2-24/test/keystrokes/firefox/moz_slider.py (original)
+++ branches/gnome-2-24/test/keystrokes/firefox/moz_slider.py Thu Jan 29 22:11:14 2009
@@ -31,10 +31,10 @@
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.AssertPresentationAction(
"tab to slider",
- ["BRAILLE LINE: 'Move slider left Button 10 Slider Move slider right Button'",
- " VISIBLE: '10 Slider Move slider right Butt', cursor=1",
+ ["BRAILLE LINE: 'Move slider left Button 10% Slider Move slider right Button'",
+ " VISIBLE: '10% Slider Move slider right But', cursor=1",
"SPEECH OUTPUT: ''",
- "SPEECH OUTPUT: 'My slider slider 10'"]))
+ "SPEECH OUTPUT: 'My slider slider 10%'"]))
########################################################################
# Do a basic "Where Am I" via KP_Enter.
@@ -44,8 +44,8 @@
sequence.append(PauseAction(3000))
sequence.append(utils.AssertPresentationAction(
"basic whereAmI",
- ["BRAILLE LINE: 'Move slider left Button 10 Slider Move slider right Button'",
- " VISIBLE: '10 Slider Move slider right Butt', cursor=1",
+ ["BRAILLE LINE: 'Move slider left Button 10% Slider Move slider right Button'",
+ " VISIBLE: '10% Slider Move slider right But', cursor=1",
"SPEECH OUTPUT: ''",
"SPEECH OUTPUT: 'slider'",
"SPEECH OUTPUT: '10.0'",
@@ -64,9 +64,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"0 move slider",
- ["BRAILLE LINE: 'Move slider left Button 15 Slider Move slider right Button'",
- " VISIBLE: '15 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '15'"]))
+ ["BRAILLE LINE: 'Move slider left Button $15.00 Slider Move slider right Button'",
+ " VISIBLE: '$15.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$15.00'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
@@ -77,9 +77,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"1 move slider",
- ["BRAILLE LINE: 'Move slider left Button 20 Slider Move slider right Button'",
- " VISIBLE: '20 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '20'"]))
+ ["BRAILLE LINE: 'Move slider left Button $20.00 Slider Move slider right Button'",
+ " VISIBLE: '$20.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$20.00'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
@@ -90,9 +90,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"2 move slider",
- ["BRAILLE LINE: 'Move slider left Button 25 Slider Move slider right Button'",
- " VISIBLE: '25 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '25'"]))
+ ["BRAILLE LINE: 'Move slider left Button $25.00 Slider Move slider right Button'",
+ " VISIBLE: '$25.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$25.00'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Right"))
@@ -103,9 +103,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"3 move slider",
- ["BRAILLE LINE: 'Move slider left Button 30 Slider Move slider right Button'",
- " VISIBLE: '30 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '30'"]))
+ ["BRAILLE LINE: 'Move slider left Button $30.00 Slider Move slider right Button'",
+ " VISIBLE: '$30.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$30.00'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -116,9 +116,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"4 move slider",
- ["BRAILLE LINE: 'Move slider left Button 25 Slider Move slider right Button'",
- " VISIBLE: '25 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '25'"]))
+ ["BRAILLE LINE: 'Move slider left Button $25.00 Slider Move slider right Button'",
+ " VISIBLE: '$25.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$25.00'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -129,9 +129,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"5 move slider",
- ["BRAILLE LINE: 'Move slider left Button 20 Slider Move slider right Button'",
- " VISIBLE: '20 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '20'"]))
+ ["BRAILLE LINE: 'Move slider left Button $20.00 Slider Move slider right Button'",
+ " VISIBLE: '$20.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$20.00'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -142,9 +142,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"6 move slider",
- ["BRAILLE LINE: 'Move slider left Button 15 Slider Move slider right Button'",
- " VISIBLE: '15 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '15'"]))
+ ["BRAILLE LINE: 'Move slider left Button $15.00 Slider Move slider right Button'",
+ " VISIBLE: '$15.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$15.00'"]))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Left"))
@@ -155,9 +155,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"7 move slider",
- ["BRAILLE LINE: 'Move slider left Button 10 Slider Move slider right Button'",
- " VISIBLE: '10 Slider Move slider right Butt', cursor=1",
- "SPEECH OUTPUT: '10'"]))
+ ["BRAILLE LINE: 'Move slider left Button $10.00 Slider Move slider right Button'",
+ " VISIBLE: '$10.00 Slider Move slider right ', cursor=1",
+ "SPEECH OUTPUT: '$10.00'"]))
# Move the slider with the 'end' key.
#
@@ -170,9 +170,9 @@
5000))
sequence.append(utils.AssertPresentationAction(
"move slider end",
- ["BRAILLE LINE: 'Move slider left Button 100 Slider Move slider right Button'",
- " VISIBLE: '100 Slider Move slider right But', cursor=1",
- "SPEECH OUTPUT: '100'"]))
+ ["BRAILLE LINE: 'Move slider left Button $100.00 Slider Move slider right Button'",
+ " VISIBLE: '$100.00 Slider Move slider right', cursor=1",
+ "SPEECH OUTPUT: '$100.00'"]))
# Move the slider with the 'home' key.
#
@@ -185,9 +185,10 @@
5000))
sequence.append(utils.AssertPresentationAction(
"move slider home",
- ["BRAILLE LINE: 'Move slider left Button 0 Slider Move slider right Button'",
- " VISIBLE: '0 Slider Move slider right Butto', cursor=1",
- "SPEECH OUTPUT: '0'"]))
+ ["BRAILLE LINE: 'Move slider left Button $0.00 Slider Move slider right Button'",
+ " VISIBLE: '$0.00 Slider Move slider right B', cursor=1",
+ "SPEECH OUTPUT: '$0.00'"]))
+
########################################################################
# Close the demo
#
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]