Chromium Code Reviews| 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..d42d405b446495a2fd5428dc473319e3a10e5853 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_launch_url / 1000. |
| + + delay_to_launch_url / 1000.) + 3; |
|
droger
2016/11/24 14:08:10
Why is delay_to_launch_url repeated? did you mean
Benoit L
2016/11/24 14:34:17
Oops, thanks!
Done.
|
| + |
| 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 ' |