Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Unified Diff: tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py

Issue 2531573002: customtabs: Output all the available metrics after a timeout. (Closed)
Patch Set: Address comment. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
diff --git a/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py b/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
index eea46e2e6ad9f6d2bd8c4c31e2d73ed9d0532fa6..2cda5c09640b8c4009885eeeb60a5f85fff74628 100755
--- a/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
+++ b/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
@@ -90,6 +90,10 @@ def RunOnce(device, url, warmup, speculation_mode, delay_to_may_launch_url,
if not device.HasRoot():
device.EnableRoot()
+ timeout_s = 20
+ logcat_timeout = int(timeout_s + delay_to_may_launch_url / 1000.
+ + delay_to_launch_url / 1000.) + 3;
+
with device_setup.FlagReplacer(device, _COMMAND_LINE_PATH, chrome_args):
launch_intent = intent.Intent(
action='android.intent.action.MAIN',
@@ -98,7 +102,8 @@ def RunOnce(device, url, warmup, speculation_mode, delay_to_may_launch_url,
extras={'url': str(url), 'warmup': warmup,
'speculation_mode': str(speculation_mode),
'delay_to_may_launch_url': delay_to_may_launch_url,
- 'delay_to_launch_url': delay_to_launch_url})
+ 'delay_to_launch_url': delay_to_launch_url,
+ 'timeout': timeout_s})
result_line_re = re.compile(r'CUSTOMTABSBENCH.*: (.*)')
logcat_monitor = device.GetLogcatMonitor(clear=True)
logcat_monitor.Start()
@@ -114,7 +119,7 @@ def RunOnce(device, url, warmup, speculation_mode, delay_to_may_launch_url,
match = None
try:
- match = logcat_monitor.WaitFor(result_line_re, timeout=20)
+ match = logcat_monitor.WaitFor(result_line_re, timeout=logcat_timeout)
except device_errors.CommandTimeoutError as _:
logging.warning('Timeout waiting for the result line')
logcat_monitor.Stop()
@@ -210,10 +215,10 @@ def _CreateOptionParser():
'no_state_prefetch'])
parser.add_option('--delay_to_may_launch_url',
help='Delay before calling mayLaunchUrl() in ms.',
- type='int')
+ type='int', default=1000)
parser.add_option('--delay_to_launch_url',
help='Delay before calling launchUrl() in ms.',
- type='int')
+ type='int', default=-1)
parser.add_option('--cold', help='Purge the page cache before each run.',
default=False, action='store_true')
parser.add_option('--output_file', help='Output file (append). "-" for '
« no previous file with comments | « tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698