| Index: tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py
|
| ===================================================================
|
| --- tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py (revision 194244)
|
| +++ tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py (working copy)
|
| @@ -22,22 +22,27 @@
|
| 'canary',
|
| 'content-shell-debug',
|
| 'content-shell-release',
|
| + 'debug-cros',
|
| + 'release-cros',
|
| 'system'])
|
|
|
| class PossibleDesktopBrowser(possible_browser.PossibleBrowser):
|
| """A desktop browser that can be controlled."""
|
|
|
| - def __init__(self, browser_type, options, executable, is_content_shell):
|
| + def __init__(self, browser_type, options, executable, is_content_shell,
|
| + use_login=False):
|
| super(PossibleDesktopBrowser, self).__init__(browser_type, options)
|
| self._local_executable = executable
|
| self._is_content_shell = is_content_shell
|
| + self._use_login = use_login
|
|
|
| def __repr__(self):
|
| return 'PossibleDesktopBrowser(browser_type=%s)' % self.browser_type
|
|
|
| def Create(self):
|
| backend = desktop_browser_backend.DesktopBrowserBackend(
|
| - self._options, self._local_executable, self._is_content_shell)
|
| + self._options, self._local_executable,
|
| + self._is_content_shell, self._use_login)
|
| if sys.platform.startswith('linux'):
|
| p = linux_platform_backend.LinuxPlatformBackend()
|
| elif sys.platform == 'darwin':
|
| @@ -113,6 +118,24 @@
|
| AddIfFound('release', 'Release', chromium_app_name, False)
|
| AddIfFound('content-shell-release', 'Release', content_shell_app_name, True)
|
|
|
| + # Add local chrome for CrOS builds.
|
| + def AddCrOSIfFound(browser_type, type_dir):
|
| + """Adds local chrome for ChromeOS builds on linux"""
|
| + app = os.path.join(chrome_root, 'out', type_dir, chromium_app_name)
|
| + ldd_path = '/usr/bin/ldd'
|
| + if not os.path.exists(app) or not os.path.exists(ldd_path):
|
| + return
|
| + # Look for libchromeos.so in ldd output.
|
| + ldd_out = subprocess.check_output([ldd_path, app])
|
| + if ldd_out.count('libchromeos.so'):
|
| + browsers.append(PossibleDesktopBrowser(browser_type, options, app,
|
| + is_content_shell=False,
|
| + use_login=True))
|
| +
|
| + if sys.platform.startswith('linux'):
|
| + AddCrOSIfFound('debug-cros', 'Debug')
|
| + AddCrOSIfFound('release-cros', 'Release')
|
| +
|
| # Mac-specific options.
|
| if sys.platform == 'darwin':
|
| mac_canary = ('/Applications/Google Chrome Canary.app/'
|
|
|