Add options for auto_login, username, password to chrome.py.
BUG=chromium:340395
TEST=manual
Change-Id: Ie688d5872c1fcc99b5eccc65e8ecf5eb39238013
Reviewed-on: https://chromium-review.googlesource.com/185028
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/client/common_lib/cros/chrome.py b/client/common_lib/cros/chrome.py
index b23e6cd..4f041f0 100644
--- a/client/common_lib/cros/chrome.py
+++ b/client/common_lib/cros/chrome.py
@@ -17,7 +17,8 @@
def __init__(self, logged_in=True, extension_paths=[], autotest_ext=False,
- is_component=True, num_tries=1, extra_browser_args=None):
+ is_component=True, num_tries=1, extra_browser_args=None,
+ auto_login=True, username=None, password=None):
"""
Constructor of telemetry wrapper.
@@ -31,6 +32,10 @@
debugging).
@param extra_browser_args: Additional argument(s) to pass to the
browser. It can be a string or a list.
+ @param auto_login: Does not login automatically if this is False.
+ Useful if you need to examine oobe.
+ @param username: Log in using this username instead of the default.
+ @param username: Log in using this password instead of the default.
"""
self._autotest_ext_path = None
if autotest_ext:
@@ -61,8 +66,12 @@
b_options = finder_options.browser_options
b_options.disable_component_extensions_with_background_pages = False
b_options.create_browser_with_oobe = True
- self.username = b_options.username
- self.password = b_options.password
+
+ b_options.auto_login = auto_login
+ self.username = b_options.username if username is None else username
+ self.password = b_options.password if password is None else password
+ b_options.username = self.username
+ b_options.password = self.password
for i in range(num_tries):
try: