OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Loops Custom Tabs tests and outputs the results into a CSV file.""" | 7 """Loops Custom Tabs tests and outputs the results into a CSV file.""" |
8 | 8 |
9 import logging | 9 import logging |
10 import optparse | 10 import optparse |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 Args: | 45 Args: |
46 device: (DeviceUtils) device to run the tests on. | 46 device: (DeviceUtils) device to run the tests on. |
47 warmup: (bool) Whether to call warmup. | 47 warmup: (bool) Whether to call warmup. |
48 no_prerendering: (bool) Whether to disable prerendering. | 48 no_prerendering: (bool) Whether to disable prerendering. |
49 delay_to_may_launch_url: (int) Delay to mayLaunchUrl() in ms. | 49 delay_to_may_launch_url: (int) Delay to mayLaunchUrl() in ms. |
50 delay_to_launch_url: (int) Delay to launchUrl() in ms. | 50 delay_to_launch_url: (int) Delay to launchUrl() in ms. |
51 cold: (bool) Whether the page cache should be dropped. | 51 cold: (bool) Whether the page cache should be dropped. |
52 | 52 |
53 Returns: | 53 Returns: |
54 The output line (str), like this (one line only): | 54 The output line (str), like this (one line only): |
55 <warmup>,<no_prerendering>,<delay_to_may_launch_url>,<intent_sent_ms>, | 55 <warmup>,<no_prerendering>,<delay_to_may_launch_url>,<delay_to_launch>, |
56 <page_load_started_ms>,<page_load_finished_ms> | 56 <intent_sent_ms>,<page_load_started_ms>,<page_load_finished_ms> |
57 or None on error. | 57 or None on error. |
58 """ | 58 """ |
59 launch_intent = intent.Intent( | 59 launch_intent = intent.Intent( |
60 action='android.intent.action.MAIN', | 60 action='android.intent.action.MAIN', |
61 package='org.chromium.customtabsclient.test', | 61 package='org.chromium.customtabsclient.test', |
62 activity='org.chromium.customtabs.test.MainActivity', | 62 activity='org.chromium.customtabs.test.MainActivity', |
63 extras={'url': url, 'warmup': warmup, 'no_prerendering': no_prerendering, | 63 extras={'url': url, 'warmup': warmup, 'no_prerendering': no_prerendering, |
64 'delay_to_may_launch_url': delay_to_may_launch_url, | 64 'delay_to_may_launch_url': delay_to_may_launch_url, |
65 'delay_to_launch_url': delay_to_launch_url}) | 65 'delay_to_launch_url': delay_to_launch_url}) |
66 result_line_re = re.compile(r'CUSTOMTABSBENCH.*: (.*)') | 66 result_line_re = re.compile(r'CUSTOMTABSBENCH.*: (.*)') |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 logging.error('Device not found.') | 180 logging.error('Device not found.') |
181 sys.exit(0) | 181 sys.exit(0) |
182 device = matching_devices[0] | 182 device = matching_devices[0] |
183 LoopOnDevice(device, options.url, options.warmup, options.no_prerendering, | 183 LoopOnDevice(device, options.url, options.warmup, options.no_prerendering, |
184 options.delay_to_may_launch_url, options.delay_to_launch_url, | 184 options.delay_to_may_launch_url, options.delay_to_launch_url, |
185 options.cold, options.output_file, options.once) | 185 options.cold, options.output_file, options.once) |
186 | 186 |
187 | 187 |
188 if __name__ == '__main__': | 188 if __name__ == '__main__': |
189 main() | 189 main() |
OLD | NEW |