[orca] Add voice when generating clickable and longdesc announcements



commit 4d30b874ed4a64d8ffa227a5308e42f9816cafca
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Aug 26 17:20:08 2015 -0400

    Add voice when generating clickable and longdesc announcements

 src/orca/scripts/web/speech_generator.py         |    8 ++++++--
 test/html/paragraph-with-onmouseup.html          |    8 ++++++++
 test/keystrokes/firefox/say_all_onmouseup.params |    1 +
 test/keystrokes/firefox/say_all_onmouseup.py     |   20 ++++++++++++++++++++
 4 files changed, 35 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index b20cae2..fde769c 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -97,7 +97,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
 
         args['stringType'] = 'clickable'
         if self._script.utilities.isClickableElement(obj):
-            return [self._script.formatting.getString(**args)]
+            result = [self._script.formatting.getString(**args)]
+            result.extend(self.voice(speech_generator.SYSTEM))
+            return result
 
         return []
 
@@ -129,7 +131,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
 
         args['stringType'] = 'haslongdesc'
         if self._script.utilities.hasLongDesc(obj):
-            return [self._script.formatting.getString(**args)]
+            result = [self._script.formatting.getString(**args)]
+            result.extend(self.voice(speech_generator.SYSTEM))
+            return result
 
         return []
 
diff --git a/test/html/paragraph-with-onmouseup.html b/test/html/paragraph-with-onmouseup.html
new file mode 100644
index 0000000..851e246
--- /dev/null
+++ b/test/html/paragraph-with-onmouseup.html
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+<div>Line 1</div>
+<p onmouseup="return true;">Line 2</p>
+<div>Line 3</div>
+</body>
+</html>
diff --git a/test/keystrokes/firefox/say_all_onmouseup.params 
b/test/keystrokes/firefox/say_all_onmouseup.params
new file mode 100644
index 0000000..7627b78
--- /dev/null
+++ b/test/keystrokes/firefox/say_all_onmouseup.params
@@ -0,0 +1 @@
+PARAMS=$TEST_DIR/../../html/paragraph-with-onmouseup.html
diff --git a/test/keystrokes/firefox/say_all_onmouseup.py b/test/keystrokes/firefox/say_all_onmouseup.py
new file mode 100644
index 0000000..f81c280
--- /dev/null
+++ b/test/keystrokes/firefox/say_all_onmouseup.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+
+"""Test of sayAll."""
+
+from macaroon.playback import *
+import utils
+
+sequence = MacroSequence()
+
+sequence.append(utils.StartRecordingAction())
+sequence.append(KeyComboAction("KP_Add"))
+sequence.append(utils.AssertPresentationAction(
+    "1. KP_Add to do a SayAll",
+    ["SPEECH OUTPUT: 'Line 1'",
+     "SPEECH OUTPUT: 'Line 2'",
+     "SPEECH OUTPUT: 'clickable'",
+     "SPEECH OUTPUT: 'Line 3'"]))
+
+sequence.append(utils.AssertionSummaryAction())
+sequence.start()


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