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

Unified Diff: tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py

Issue 412553006: [telemetry] Add util.path module and util.path.FindInstalledWindowsApplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test. Created 6 years, 5 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/core/backends/webdriver/webdriver_desktop_browser_finder.py
diff --git a/tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py b/tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py
index e2226bd8e3021bb784f19f03c1c21199052f2d81..ae0a39ed5685c742724a6993d6667b49ba5e6d35 100644
--- a/tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py
+++ b/tools/telemetry/telemetry/core/backends/webdriver/webdriver_desktop_browser_finder.py
@@ -93,16 +93,15 @@ def FindAllAvailableBrowsers(finder_options):
# Look for the IE browser in the standard location.
if sys.platform.startswith('win'):
ie_path = os.path.join('Internet Explorer', 'iexplore.exe')
- win_search_paths = {
- '32' : { 'path' : os.getenv('PROGRAMFILES(X86)'),
- 'type' : 'internet-explorer'},
- '64' : { 'path' : os.getenv('PROGRAMFILES'),
- 'type' : 'internet-explorer-x64'}}
- for architecture, ie_info in win_search_paths.iteritems():
- if not ie_info['path']:
+ search_paths = (
+ (32, os.getenv('PROGRAMFILES(X86)'), 'internet-explorer'),
+ (64, os.getenv('PROGRAMFILES'), 'internet-explorer-x64'),
+ )
+ for architecture, search_path, browser_type in search_paths:
+ if not search_path:
continue
- if os.path.exists(os.path.join(ie_info['path'], ie_path)):
+ if os.path.exists(os.path.join(search_path, ie_path)):
browsers.append(
- PossibleDesktopIE(ie_info['type'], finder_options, architecture))
+ PossibleDesktopIE(browser_type, finder_options, architecture))
return browsers

Powered by Google App Engine
This is Rietveld 408576698