| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 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 import logging | 7 import logging |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 elif len(devices) >= 2: | 92 elif len(devices) >= 2: |
| 93 raise RuntimeError('Multiple devices connected, serial number required') | 93 raise RuntimeError('Multiple devices connected, serial number required') |
| 94 options.device_serial_number = devices[0] | 94 options.device_serial_number = devices[0] |
| 95 device = device_utils.DeviceUtils.HealthyDevices(device_arg= | 95 device = device_utils.DeviceUtils.HealthyDevices(device_arg= |
| 96 options.device_serial_number)[0] | 96 options.device_serial_number)[0] |
| 97 package_info = util.get_supported_browsers()[options.browser] | 97 package_info = util.get_supported_browsers()[options.browser] |
| 98 | 98 |
| 99 options.device = device | 99 options.device = device |
| 100 options.package_info = package_info | 100 options.package_info = package_info |
| 101 | 101 |
| 102 # Include Chrome categories by default in profile_chrome. | |
| 103 if not options.chrome_categories: | |
| 104 options.chrome_categories = chrome_tracing_agent.DEFAULT_CHROME_CATEGORIES | |
| 105 | |
| 106 if options.chrome_categories in ['list', 'help']: | 102 if options.chrome_categories in ['list', 'help']: |
| 107 ui.PrintMessage('Collecting record categories list...', eol='') | 103 ui.PrintMessage('Collecting record categories list...', eol='') |
| 108 record_categories = [] | 104 record_categories = [] |
| 109 disabled_by_default_categories = [] | 105 disabled_by_default_categories = [] |
| 110 record_categories, disabled_by_default_categories = \ | 106 record_categories, disabled_by_default_categories = \ |
| 111 chrome_tracing_agent.ChromeTracingAgent.GetCategories( | 107 chrome_tracing_agent.ChromeTracingAgent.GetCategories( |
| 112 device, package_info) | 108 device, package_info) |
| 113 | 109 |
| 114 ui.PrintMessage('done') | 110 ui.PrintMessage('done') |
| 115 ui.PrintMessage('Record Categories:') | 111 ui.PrintMessage('Record Categories:') |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 options.trace_time if not options.continuous else 0, | 145 options.trace_time if not options.continuous else 0, |
| 150 _PROFILE_CHROME_AGENT_MODULES, | 146 _PROFILE_CHROME_AGENT_MODULES, |
| 151 output=options.output_file, | 147 output=options.output_file, |
| 152 compress=options.compress, | 148 compress=options.compress, |
| 153 write_json=options.write_json) | 149 write_json=options.write_json) |
| 154 if options.view: | 150 if options.view: |
| 155 if sys.platform == 'darwin': | 151 if sys.platform == 'darwin': |
| 156 os.system('/usr/bin/open %s' % os.path.abspath(result)) | 152 os.system('/usr/bin/open %s' % os.path.abspath(result)) |
| 157 else: | 153 else: |
| 158 webbrowser.open(result) | 154 webbrowser.open(result) |
| OLD | NEW |