summaryrefslogtreecommitdiffstats
path: root/tests/DumpRenderTree2
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-09-14 06:27:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-09-14 06:27:08 -0700
commit540aada302af83330d42ee4cf53bbc571de4f3be (patch)
tree618253617bdac2325cc9709e8003754d997e5164 /tests/DumpRenderTree2
parent59e46ef785424ed036fe95b76998de62bf77818c (diff)
parentd210fd26b2f32fec26c2e7bb355de8b5b3e25b79 (diff)
downloadframeworks_base-540aada302af83330d42ee4cf53bbc571de4f3be.zip
frameworks_base-540aada302af83330d42ee4cf53bbc571de4f3be.tar.gz
frameworks_base-540aada302af83330d42ee4cf53bbc571de4f3be.tar.bz2
Merge "Add to DumpRenderTree2 the option to suppress showing results in the host browser"
Diffstat (limited to 'tests/DumpRenderTree2')
-rwxr-xr-xtests/DumpRenderTree2/assets/run_layout_tests.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/DumpRenderTree2/assets/run_layout_tests.py b/tests/DumpRenderTree2/assets/run_layout_tests.py
index bd6e457..c584d59 100755
--- a/tests/DumpRenderTree2/assets/run_layout_tests.py
+++ b/tests/DumpRenderTree2/assets/run_layout_tests.py
@@ -3,29 +3,30 @@
"""Run layout tests on the device.
It runs the specified tests on the device, downloads the summaries to the temporary directory
- and opens html details in the default browser.
+ and optionally shows the detailed results the host's default browser.
Usage:
- run_layout_tests.py PATH
+ run_layout_tests.py --show-results-in-browser test-relative-path
"""
-import sys
+import logging
+import optparse
import os
+import sys
import subprocess
-import logging
-import webbrowser
import tempfile
+import webbrowser
#TODO: These should not be hardcoded
RESULTS_ABSOLUTE_PATH = "/sdcard/layout-test-results/"
DETAILS_HTML = "details.html"
SUMMARY_TXT = "summary.txt"
-def main():
- if len(sys.argv) > 1:
- path = sys.argv[1]
+def main(options, args):
+ if args:
+ path = " ".join(args);
else:
- path = ""
+ path = "";
logging.basicConfig(level=logging.INFO, format='%(message)s')
@@ -61,7 +62,12 @@ def main():
logging.info("")
# Open the browser with summary
- webbrowser.open(details_html_tmp_path)
+ if options.show_results_in_browser != "false":
+ webbrowser.open(details_html_tmp_path)
if __name__ == "__main__":
- main();
+ option_parser = optparse.OptionParser(usage="Usage: %prog [options] test-relative-path")
+ option_parser.add_option("", "--show-results-in-browser", default="true",
+ help="Show the results the host's default web browser, default=true")
+ options, args = option_parser.parse_args();
+ main(options, args);