From 3e8950c0c73f9c1574ce3388c754009edf6bc930 Mon Sep 17 00:00:00 2001 From: Guang Zhu Date: Wed, 3 Jun 2009 12:23:09 -0700 Subject: [PATCH] Added new parameter to enable a manual pause between pages --- .../assets/run_reliability_tests.py | 22 +++++++++++++------ .../dumprendertree/LayoutTestsAutoRunner.java | 18 ++++++++++----- .../dumprendertree/ReliabilityTest.java | 5 +++-- .../ReliabilityTestActivity.java | 16 +++++++++++--- 4 files changed, 43 insertions(+), 18 deletions(-) diff --git a/tests/DumpRenderTree/assets/run_reliability_tests.py b/tests/DumpRenderTree/assets/run_reliability_tests.py index 84b9501620daf..6aab00929a1c0 100755 --- a/tests/DumpRenderTree/assets/run_reliability_tests.py +++ b/tests/DumpRenderTree/assets/run_reliability_tests.py @@ -75,6 +75,11 @@ def main(options, args): else: timedout_file = options.timeout_file + if not options.delay: + manual_delay = 0 + else: + manual_delay = options.delay + adb_cmd = "adb " if options.adb_options: adb_cmd += options.adb_options + " " @@ -110,8 +115,8 @@ def main(options, args): # Call ReliabilityTestsAutoTest#startReliabilityTests test_cmd = (test_cmd_prefix + " -e class " "com.android.dumprendertree.ReliabilityTest#" - "runReliabilityTest -e timeout %s %s" % - (str(timeout_ms), test_cmd_postfix)) + "runReliabilityTest -e timeout %s -e delay %s %s" % + (str(timeout_ms), str(manual_delay), test_cmd_postfix)) adb_output = subprocess.Popen(test_cmd, shell=True, stdout=subprocess.PIPE, @@ -153,20 +158,23 @@ def main(options, args): if "__main__" == __name__: option_parser = optparse.OptionParser() - option_parser.add_option("", "--time-out-ms", + option_parser.add_option("-t", "--time-out-ms", default=60000, help="set the timeout for each test") - option_parser.add_option("", "--verbose", action="store_true", + option_parser.add_option("-v", "--verbose", action="store_true", default=False, help="include debug-level logging") - option_parser.add_option("", "--adb-options", + option_parser.add_option("-a", "--adb-options", default=None, help="pass options to adb, such as -d -e, etc") - option_parser.add_option("", "--crash-file", + option_parser.add_option("-c", "--crash-file", default="reliability_crashed_sites.txt", help="the list of sites that cause browser to crash") - option_parser.add_option("", "--timeout-file", + option_parser.add_option("-f", "--timeout-file", default="reliability_timedout_sites.txt", help="the list of sites that timedout during test.") + option_parser.add_option("-d", "--delay", + default=0, + help="add a manual delay between pages (in ms)") opts, arguments = option_parser.parse_args() main(opts, arguments) diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java index ebdc9c72305c5..57e06a1cbcde1 100755 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LayoutTestsAutoRunner.java @@ -16,14 +16,11 @@ package com.android.dumprendertree; -import junit.framework.TestSuite; -import com.android.dumprendertree.LayoutTestsAutoTest; - +import android.os.Bundle; import android.test.InstrumentationTestRunner; import android.test.InstrumentationTestSuite; -import android.util.Log; -import android.content.Intent; -import android.os.Bundle; + +import junit.framework.TestSuite; /** @@ -61,6 +58,14 @@ public class LayoutTestsAutoRunner extends InstrumentationTestRunner { } } + String delay_str = (String) icicle.get("delay"); + if(delay_str != null) { + try { + this.mDelay = Integer.parseInt(delay_str); + } catch (Exception e) { + } + } + String r = (String)icicle.get("rebaseline"); this.mRebaseline = (r != null && r.toLowerCase().equals("true")); super.onCreate(icicle); @@ -68,6 +73,7 @@ public class LayoutTestsAutoRunner extends InstrumentationTestRunner { public String mTestPath = null; public int mTimeoutInMillis = 0; + public int mDelay = 0; public boolean mRebaseline = false; } diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java index aa3940ed9b047..e63aa95b558f1 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/ReliabilityTest.java @@ -25,7 +25,7 @@ public class ReliabilityTest extends ActivityInstrumentationTestCase2