Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: tools/telemetry/telemetry/browser_options.py

Issue 11882033: Telemetry support for extensions. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/browser_options.py
===================================================================
--- tools/telemetry/telemetry/browser_options.py (revision 176402)
+++ tools/telemetry/telemetry/browser_options.py (working copy)
@@ -10,6 +10,11 @@
from telemetry import browser_finder
from telemetry import wpr_modes
+class ExtensionToLoad(object):
+ def __init__(self, path, is_component):
nduca 2013/01/15 05:31:06 should we assert that the extension exists?
+ self.path = path
+ self.is_component = is_component
nduca 2013/01/15 05:31:06 we need to find some common area that validates th
+
class BrowserOptions(optparse.Values):
"""Options to be used for discovering and launching a browser."""
@@ -25,6 +30,7 @@
self.dont_override_profile = False
self.extra_browser_args = []
self.show_stdout = False
+ self.extensions_to_load = []
self.cros_remote = None
self.wpr_mode = wpr_modes.WPR_OFF
@@ -86,6 +92,12 @@
group.add_option('--show-stdout',
action='store_true',
help='When possible, will display the stdout of the process')
+ group.add_option('--load-component-extension',
+ dest='component_extensions_to_load_as_string',
+ help='Loads additional component extensions.')
+ group.add_option('--load-extension',
+ dest='extensions_to_load_as_string',
+ help='Loads additional extension.')
parser.add_option_group(group)
# Page set options
@@ -149,6 +161,18 @@
self.extra_browser_args_as_string) # pylint: disable=E1101
self.extra_browser_args.extend(tmp)
delattr(self, 'extra_browser_args_as_string')
+ if self.component_extensions_to_load_as_string: # pylint: disable=E1101
nduca 2013/01/15 05:31:06 i dont think we need to add support for loading ex
+ paths = self.component_extensions_to_load_as_string.split(',')
+ self.extensions_to_load.extend(
+ [ExtensionToLoad(ext_path, True)
+ for ext_path in paths])
+ delattr(self, 'component_extensions_to_load_as_string')
+ if self.extensions_to_load_as_string: # pylint: disable=E1101
+ paths = self.extensions_to_load_as_string.split(',')
+ self.extensions_to_load.extend(
+ [ExtensionToLoad(ext_path, False)
+ for ext_path in paths])
+ delattr(self, 'component_extensions_to_load_as_string')
return ret
parser.parse_args = ParseArgs
return parser

Powered by Google App Engine
This is Rietveld 408576698