Index: test/harness/runone.sh
===================================================================
--- test/harness/runone.sh	(revision 2201)
+++ test/harness/runone.sh	(working copy)
@@ -9,9 +9,9 @@
 
 debugFile=`basename $1 .keys`
 
-# Number of seconds to wait for test application to start
-FAST_WAIT_TIME=10
-SLOW_WAIT_TIME=20
+# Number of seconds to wait 
+REGRESSION_WAIT_TIME=20
+COVERAGE_WAIT_TIME=10
 
 # Set up our local user settings file for the output format we want.
 #
@@ -47,45 +47,45 @@
     coverageMode=$2
 fi
 
-if [ "$coverageMode" -eq "1" ]
+if [ $coverageMode -eq 1 ]
 then
-    APP_WAIT_TIME=$FAST_WAIT_TIME
+    WAIT_TIME=$COVERAGE_WAIT_TIME
 else
-    APP_WAIT_TIME=$SLOW_WAIT_TIME
+    WAIT_TIME=$REGRESSION_WAIT_TIME
 fi
 
-if [ "$coverageMode" -eq "0" ] 	 
+if [ $coverageMode -eq 0 ] 	 
 then
     # Run orca and let it settle in.
     echo starting Orca...
     orca &
-    sleep 5
+    sleep $WAIT_TIME
 fi
 
-# start the test application and let it settle in
+# Start the test application and let it settle in
 $APP_NAME &
 APP_PID=$!
 echo starting $APP_NAME pid $APP_PID 
-sleep $APP_WAIT_TIME
+sleep $WAIT_TIME
 
 # Play the keystrokes.
 #
 python `dirname $0`/../../src/tools/play_keystrokes.py < $1
 
-# Terminate the running application
-echo killing app $APP_NAME $APP_PID
-kill -9 $APP_PID > /dev/null 2>&1
-
-# Terminate the running application and Orca
-#
-if [ "$coverageMode" -eq "0" ] 	 
+if [ $coverageMode -eq 0 ] 	 
 then
     # Terminate Orca
     echo terminating Orca
     orca --quit > /dev/null 2>&1
+    sleep $WAIT_TIME
 fi
 
-if [ "$coverageMode" -eq "0" ] 	 
+# Terminate the running application
+echo killing app $APP_NAME $APP_PID
+kill -9 $APP_PID > /dev/null 2>&1
+
+
+if [ $coverageMode -eq 0 ] 	 
 then
     rm user-settings.py*
 fi
Index: test/harness/runall.sh
===================================================================
--- test/harness/runall.sh	(revision 2201)
+++ test/harness/runall.sh	(working copy)
@@ -13,13 +13,14 @@
 keystrokesDir=$harnessDir/../keystrokes
 resultsDir=$harnessDir/../results
 
-# number of seconds to wait for application to finish shutting down
-SHUT_DOWN_WAIT_TIME=5
+# Number of seconds to wait 
+REGRESSION_WAIT_TIME=20
+COVERAGE_WAIT_TIME=10
 
-# OpenOffice 2.1 executables are installed in 
-# /opt/openoffice.org2.1/program/
+# OpenOffice 2.2 executables are installed in 
+# /usr/lib/openoffice/program
 #
-export PATH=$PATH:/opt/openoffice.org2.1/program
+export PATH=$PATH:/usr/lib/openoffice/program
 
 coverageMode=0
 
@@ -70,14 +71,21 @@
 # Process the users command line options.
 #
 process_cl "${@}"
+if [ "$coverageMode" -eq "1" ]
+then
+    WAIT_TIME=$COVERAGE_WAIT_TIME
+else
+    WAIT_TIME=$REGRESSION_WAIT_TIME
+fi
 
+
 if [ "$coverageMode" -eq 1 ]
 then 	 
     echo generating coverage map...
     coverageDir=../coverage/`date +%Y-%m-%d_%H:%M:%S`
     trace2html.py -o $coverageDir -w orca -r runorca.py &
     trace_pid=$!
-    sleep 5 	 
+    sleep $WAIT_TIME 	 
     echo ...finished generating coverage map.
 fi
 
@@ -152,14 +160,19 @@
           fi
         fi
 
-	# wait for application to finish shutting down
-        sleep $SHUT_DOWN_WAIT_TIME
+        # Wait for application to finish shutting down.
+        sleep $WAIT_TIME
 
+        # Copy the results (.orca) file to the output directory.
+        # This is the file that will be used for regression
+        # testing. 
         newResultsFile=`basename $testFile .keys`.orca
         mkdir -p $currentdir/$outputdir
         cp $newResultsFile $currentdir/$outputdir
+
+        # Compare the results file with the golden results file.
+        echo Comparing results for $testFile
         expectedResultsFile=$resultsDir/$application/$newResultsFile
-        echo Comparing results for $testFile
         diff -s $expectedResultsFile $newResultsFile
         echo Finished running $testFile.
         if [ "x$stepMode" == "x1" ]
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2201)
+++ ChangeLog	(working copy)
@@ -1,3 +1,26 @@
+2007-03-26  Lynn Monsanto <lynn.monsanto@sun.com>
+
+        * test/harness/runone.sh, test/harness/runall.sh,
+	src/tools/play_keystrokes.py: bug #405061 - Adjusted
+	keystroke playback timing for navigation keys. There
+	are still minor diffs between non-OpenOffice runs
+	of runall.sh. This is probably okay for regression
+	testing, but it does require someone to manually
+	check the diffs every morning to verify there are
+	no significant changes between runs.
+
+	Note that there are still significant diffs between
+	OpenOffice Writer and Calc runs. These are due
+	to real bugs that need to be fixed.
+
+	To Do: I need to modify runone.sh so that the user
+	doen't need to specify whether code-coverage testing
+	is done (1) or not done (0). Right not, you need to
+	add a 0 or 1 at the end of the runone.sh command
+	arguments. The runall.sh script always specifies a 
+	0 or 1.
+	
+
 2007-03-26  Joanmarie Diggs <j-diggs@comcast.net>
 
 	* src/orca/Gecko.py: fix for bug 423009 – Orca should not 
Index: src/tools/play_keystrokes.py
===================================================================
--- src/tools/play_keystrokes.py	(revision 2201)
+++ src/tools/play_keystrokes.py	(working copy)
@@ -25,6 +25,7 @@
 import sys
 import time
 
+import orca.debug
 import orca.atspi
 
 # Maximum time, in seconds, to sleep.  This allows us to compress the
@@ -32,10 +33,20 @@
 #
 MAX_SLEEP = 5.0
 
-# Minimum time to sleep between arrow key navigation
+# Minimum time to sleep between navigation key presses.
 #
-MIN_SLEEP = 1.0
+MIN_SLEEP = 3.0
 
+navKeys = [ "(Tab)", "(ISO_Left_Tab)", \
+            "(F1)", "(F4)", "(F6)", "(F7)", "(F10)", \
+            "(Return)", "(Escape)", \
+            "(Down)", "(Up)", "(KP_Down)", "(KP_Up)", \
+            "(Right)", "(Left)", "(KP_Right)", "(KP_Left)", \
+            "(Page_Up)", "(Page_Down)", "(KP_Page_Up)", "(KP_Page_Down)", \
+            "(Begin)", "(KP_Begin)", "(Home)", "(KP_Home)", \
+            "(+)", "(-)" ]
+
+
 # Factor to speed up the playback.  This will compress time by the
 # given amount.  For example, 2.0 will play the events back twice
 # as fast.
@@ -71,12 +82,11 @@
             line = raw_input() # modifiers
             line = raw_input() # event_string
 
-            arrowKeyPressed = False
+            navKeyPressed = False
             keyString = line[line.index("=") + 1 :]
-            if type == 0 and \
-                   (keyString == "(Down)" or keyString == "(Up)" or \
-                    keyString == "(Right)" or keyString == "(Left)"):
-                arrowKeyPressed = True
+            if (type == 0) and (navKeys.count(keyString) > 0):
+                # A navigation key was pressed.
+                navKeyPressed = True
 
             line = raw_input() # is_text
             
@@ -87,15 +97,19 @@
                 lastTime = event_time
 
             delta = min(MAX_SLEEP, (event_time - lastTime) / SPEED_UP)
-            if arrowKeyPressed:
+
+            if navKeyPressed:
                 # Make sure there is sufficient delay between
-                # arrow key pressed.
+                # navitation key presses.
                 delta = max(MIN_SLEEP, delta)
 
             if delta > 0:
                 time.sleep(delta)
             lastTime = event_time
 
+            # if type == 0:
+            #    orca.debug.println(orca.debug.LEVEL_ALL, "%s" % event_string)
+                               
             d.generateKeyboardEvent(hw_code, "", type)
 
 def main():
