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

Unified Diff: tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py

Issue 23164007: [Telemetry] Don't mistake an android content_shell directory for a desktop binary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/chrome/desktop_browser_finder.py
diff --git a/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py b/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py
index 8ef4d6d1bcc9d5e88f669d84ed818fde91218904..93f33d8c6771eb8a15e60285d84a21af0a5dd498 100644
--- a/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py
+++ b/tools/telemetry/telemetry/core/chrome/desktop_browser_finder.py
@@ -150,10 +150,13 @@ def FindAllAvailableBrowsers(options):
else:
raise Exception('Platform not recognized')
+ def IsExecutable(path):
+ return os.path.isfile(path) and os.access(path, os.X_OK)
eseidel 2013/08/14 22:08:56 webkitpy got a lot of milage (in our testing) from
+
# Add the explicit browser executable if given.
if options.browser_executable:
normalized_executable = os.path.expanduser(options.browser_executable)
- if os.path.exists(normalized_executable):
+ if IsExecutable(normalized_executable):
browser_directory = os.path.dirname(options.browser_executable)
browsers.append(PossibleDesktopBrowser('exact', options,
normalized_executable, flash_path,
@@ -165,7 +168,7 @@ def FindAllAvailableBrowsers(options):
def AddIfFound(browser_type, build_dir, type_dir, app_name, content_shell):
browser_directory = os.path.join(chrome_root, build_dir, type_dir)
app = os.path.join(browser_directory, app_name)
- if os.path.exists(app):
+ if IsExecutable(app):
browsers.append(PossibleDesktopBrowser(browser_type, options,
app, flash_path, content_shell,
browser_directory,
@@ -186,12 +189,12 @@ def FindAllAvailableBrowsers(options):
mac_canary = mac_canary_root + 'Contents/MacOS/Google Chrome Canary'
mac_system_root = '/Applications/Google Chrome.app'
mac_system = mac_system_root + '/Contents/MacOS/Google Chrome'
- if os.path.exists(mac_canary):
+ if IsExecutable(mac_canary):
browsers.append(PossibleDesktopBrowser('canary', options,
mac_canary, None, False,
mac_canary_root))
- if os.path.exists(mac_system):
+ if IsExecutable(mac_system):
browsers.append(PossibleDesktopBrowser('system', options,
mac_system, None, False,
mac_system_root))
@@ -223,7 +226,7 @@ def FindAllAvailableBrowsers(options):
def AddIfFoundWin(browser_name, app_path):
browser_directory = os.path.join(path, app_path)
app = os.path.join(browser_directory, chromium_app_name)
- if os.path.exists(app):
+ if IsExecutable(app):
browsers.append(PossibleDesktopBrowser(browser_name, options,
app, flash_path, False,
browser_directory))
« no previous file with comments | « no previous file | tools/telemetry/telemetry/unittest/system_stub.py » ('j') | tools/telemetry/telemetry/unittest/system_stub.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698