OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 import optparse | 4 import optparse |
5 import sys | 5 import sys |
6 import shlex | 6 import shlex |
7 import logging | 7 import logging |
8 import copy | 8 import copy |
9 | 9 |
10 from telemetry.core import browser_finder | 10 from telemetry.core import browser_finder |
(...skipping 11 matching lines...) Expand all Loading... |
22 self.chrome_root = None | 22 self.chrome_root = None |
23 self.android_device = None | 23 self.android_device = None |
24 self.cros_ssh_identity = None | 24 self.cros_ssh_identity = None |
25 | 25 |
26 self.dont_override_profile = False | 26 self.dont_override_profile = False |
27 self.profile_dir = None | 27 self.profile_dir = None |
28 self.extra_browser_args = [] | 28 self.extra_browser_args = [] |
29 self.extra_wpr_args = [] | 29 self.extra_wpr_args = [] |
30 self.show_stdout = False | 30 self.show_stdout = False |
31 self.extensions_to_load = [] | 31 self.extensions_to_load = [] |
| 32 self.cros_desktop = False |
32 | 33 |
33 self.cros_remote = None | 34 self.cros_remote = None |
34 self.wpr_mode = wpr_modes.WPR_OFF | 35 self.wpr_mode = wpr_modes.WPR_OFF |
35 self.wpr_make_javascript_deterministic = True | 36 self.wpr_make_javascript_deterministic = True |
36 | 37 |
37 self.browser_user_agent_type = None | 38 self.browser_user_agent_type = None |
38 | 39 |
39 self.trace_dir = None | 40 self.trace_dir = None |
40 self.verbosity = 0 | 41 self.verbosity = 0 |
41 | 42 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 group.add_option('--extra-browser-args', | 96 group.add_option('--extra-browser-args', |
96 dest='extra_browser_args_as_string', | 97 dest='extra_browser_args_as_string', |
97 help='Additional arguments to pass to the browser when it starts') | 98 help='Additional arguments to pass to the browser when it starts') |
98 group.add_option('--extra-wpr-args', | 99 group.add_option('--extra-wpr-args', |
99 dest='extra_wpr_args_as_string', | 100 dest='extra_wpr_args_as_string', |
100 help=('Additional arguments to pass to Web Page Replay. ' | 101 help=('Additional arguments to pass to Web Page Replay. ' |
101 'See third_party/webpagereplay/replay.py for usage.')) | 102 'See third_party/webpagereplay/replay.py for usage.')) |
102 group.add_option('--show-stdout', | 103 group.add_option('--show-stdout', |
103 action='store_true', | 104 action='store_true', |
104 help='When possible, will display the stdout of the process') | 105 help='When possible, will display the stdout of the process') |
| 106 # --cros-desktop is linux only. |
| 107 if sys.platform.startswith('linux'): |
| 108 group.add_option('--cros-desktop', |
| 109 action='store_true', |
| 110 help='Run ChromeOS desktop') |
105 parser.add_option_group(group) | 111 parser.add_option_group(group) |
106 | 112 |
107 # Page set options | 113 # Page set options |
108 group = optparse.OptionGroup(parser, 'Page set options') | 114 group = optparse.OptionGroup(parser, 'Page set options') |
109 group.add_option('--page-repeat', dest='page_repeat', default=1, | 115 group.add_option('--page-repeat', dest='page_repeat', default=1, |
110 help='Number of times to repeat each individual ' + | 116 help='Number of times to repeat each individual ' + |
111 'page in the pageset before proceeding.') | 117 'page in the pageset before proceeding.') |
112 group.add_option('--pageset-repeat', dest='pageset_repeat', default=1, | 118 group.add_option('--pageset-repeat', dest='pageset_repeat', default=1, |
113 help='Number of times to repeat the entire pageset ' + | 119 help='Number of times to repeat the entire pageset ' + |
114 'before finishing.') | 120 'before finishing.') |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 elif self.profile_type != 'clean': | 200 elif self.profile_type != 'clean': |
195 self.profile_dir = profile_types.GetProfileDir(self.profile_type) | 201 self.profile_dir = profile_types.GetProfileDir(self.profile_type) |
196 delattr(self, 'profile_type') | 202 delattr(self, 'profile_type') |
197 return ret | 203 return ret |
198 parser.parse_args = ParseArgs | 204 parser.parse_args = ParseArgs |
199 return parser | 205 return parser |
200 | 206 |
201 def AppendExtraBrowserArg(self, arg): | 207 def AppendExtraBrowserArg(self, arg): |
202 if arg not in self.extra_browser_args: | 208 if arg not in self.extra_browser_args: |
203 self.extra_browser_args.append(arg) | 209 self.extra_browser_args.append(arg) |
OLD | NEW |