OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Finds desktop browsers that can be controlled by telemetry.""" | 4 """Finds desktop browsers that can be controlled by telemetry.""" |
5 | 5 |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import subprocess | 8 import subprocess |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 def FindAllAvailableBrowsers(finder_options, device): | 117 def FindAllAvailableBrowsers(finder_options, device): |
118 """Finds all the desktop browsers available on this machine.""" | 118 """Finds all the desktop browsers available on this machine.""" |
119 if not isinstance(device, desktop_device.DesktopDevice): | 119 if not isinstance(device, desktop_device.DesktopDevice): |
120 return [] | 120 return [] |
121 | 121 |
122 browsers = [] | 122 browsers = [] |
123 | 123 |
124 if not CanFindAvailableBrowsers(): | 124 if not CanFindAvailableBrowsers(): |
125 return [] | 125 return [] |
126 | 126 |
127 has_display = True | 127 has_x11_display = True |
128 if (sys.platform.startswith('linux') and | 128 if (sys.platform.startswith('linux') and |
129 os.getenv('DISPLAY') == None): | 129 os.getenv('DISPLAY') == None): |
130 has_display = False | 130 has_x11_display = False |
131 | 131 |
132 # Look for a browser in the standard chrome build locations. | 132 # Look for a browser in the standard chrome build locations. |
133 if finder_options.chrome_root: | 133 if finder_options.chrome_root: |
134 chrome_root = finder_options.chrome_root | 134 chrome_root = finder_options.chrome_root |
135 else: | 135 else: |
136 chrome_root = path.GetChromiumSrcDir() | 136 chrome_root = path.GetChromiumSrcDir() |
137 | 137 |
138 flash_bin_dir = os.path.join( | 138 flash_bin_dir = os.path.join( |
139 chrome_root, 'third_party', 'adobe', 'flash', 'binaries', 'ppapi') | 139 chrome_root, 'third_party', 'adobe', 'flash', 'binaries', 'ppapi') |
140 | 140 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 for browser_name, app_path in app_paths: | 253 for browser_name, app_path in app_paths: |
254 for chromium_app_name in chromium_app_names: | 254 for chromium_app_name in chromium_app_names: |
255 app_path = os.path.join(app_path, chromium_app_name) | 255 app_path = os.path.join(app_path, chromium_app_name) |
256 app_path = path.FindInstalledWindowsApplication(app_path) | 256 app_path = path.FindInstalledWindowsApplication(app_path) |
257 if app_path: | 257 if app_path: |
258 browsers.append(PossibleDesktopBrowser( | 258 browsers.append(PossibleDesktopBrowser( |
259 browser_name, finder_options, app_path, | 259 browser_name, finder_options, app_path, |
260 None, False, os.path.dirname(app_path))) | 260 None, False, os.path.dirname(app_path))) |
261 | 261 |
262 if len(browsers) and not has_display: | 262 has_ozone_platform = False |
| 263 for arg in finder_options.browser_options.extra_browser_args: |
| 264 if "--ozone-platform" in arg: |
| 265 has_ozone_platform = True |
| 266 |
| 267 if len(browsers) and not has_x11_display and not has_ozone_platform: |
263 logging.warning( | 268 logging.warning( |
264 'Found (%s), but you do not have a DISPLAY environment set.' % | 269 'Found (%s), but you do not have a DISPLAY environment set.' % |
265 ','.join([b.browser_type for b in browsers])) | 270 ','.join([b.browser_type for b in browsers])) |
266 return [] | 271 return [] |
267 | 272 |
268 return browsers | 273 return browsers |
OLD | NEW |