Chromium Code Reviews| Index: tools/android/loading/run_sandwich.py |
| diff --git a/tools/android/loading/run_sandwich.py b/tools/android/loading/run_sandwich.py |
| index 0afbc31f00aed56faa0b4d1bb215968ea1334bc0..759a945a43fdbe35afb060b97c309c1e2ab54427 100755 |
| --- a/tools/android/loading/run_sandwich.py |
| +++ b/tools/android/loading/run_sandwich.py |
| @@ -309,6 +309,11 @@ def main(): |
| else: |
| _CleanPreviousTraces(args.output) |
| + run_infos = { |
| + 'cache-op': args.cache_op, |
| + 'job': args.job, |
| + 'urls': [] |
| + } |
| job_urls = _ReadUrlsFromJobDescription(args.job) |
| device = device_utils.DeviceUtils.HealthyDevices()[0] |
| local_cache_archive_path = os.path.join(args.output, 'cache.zip') |
| @@ -323,7 +328,6 @@ def main(): |
| args.wpr_archive, |
| args.wpr_record, |
| not args.wpr_nojsdeterminism) as additional_flags: |
| - pages_loaded = 0 |
| for _ in xrange(args.repeat): |
| for url in job_urls: |
| if args.cache_op == 'push': |
| @@ -332,7 +336,7 @@ def main(): |
| with device_setup.DeviceConnection( |
| device=device, |
| additional_flags=additional_flags) as connection: |
| - if (pages_loaded == 0 and args.cache_op == 'save' or |
| + if (len(run_infos['urls']) == 0 and args.cache_op == 'save' or |
|
mattcary
2016/02/16 12:55:22
More pythonic to use not run_infos['urls'] rather
gabadie
2016/02/16 13:17:10
Done.
|
| args.cache_op == 'clear'): |
| connection.ClearCache() |
| page_track.PageTrack(connection) |
| @@ -341,9 +345,9 @@ def main(): |
| connection.SetUpMonitoring() |
| connection.SendAndIgnoreResponse('Page.navigate', {'url': url}) |
| connection.StartMonitoring() |
| - pages_loaded += 1 |
| _SaveChromeTrace(tracing_track.ToJsonDict(), args.output, |
|
Benoit L
2016/02/16 10:52:39
This changes the initial numbering, is that intend
gabadie
2016/02/16 13:17:10
Yes now it starts from 0 instead of 1. This is int
|
| - str(pages_loaded)) |
| + str(len(run_infos['urls']))) |
| + run_infos['urls'].append(url) |
| if local_cache_directory_path: |
| shutil.rmtree(local_cache_directory_path) |
| @@ -359,6 +363,9 @@ def main(): |
| _ZipDirectoryContent(cache_directory_path, local_cache_archive_path) |
| shutil.rmtree(cache_directory_path) |
| + with open(os.path.join(args.output, 'run_infos.json'), 'w') as file_output: |
| + json.dump(run_infos, file_output, indent=2) |
| + |
| if __name__ == '__main__': |
| sys.exit(main()) |