From 40d1a17aaa12bd66d884e34398a7b9dc4ed8fe71 Mon Sep 17 00:00:00 2001 From: "oysteine@chromium.org" Date: Tue, 8 Oct 2013 20:03:32 +0000 Subject: [PATCH] Telemetry: Only update device .apk if --browser isn't specified R=tonyg@chromium.org, bulach@chromium.org NOTRY=true BUG=305302 Review URL: https://codereview.chromium.org/26513003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227572 0039d316-1c4b-4281-b951-d872f2087c98 --- .../telemetry/telemetry/core/backends/chrome/android_browser_finder.py | 3 +-- tools/telemetry/telemetry/core/backends/chrome/cros_browser_finder.py | 3 +++ .../telemetry/telemetry/core/backends/chrome/desktop_browser_finder.py | 3 +++ .../core/backends/webdriver/webdriver_desktop_browser_finder.py | 3 +++ tools/telemetry/telemetry/core/browser_finder.py | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py b/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py index 8e501efeb1f0..20cb09a47a37 100644 --- a/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py +++ b/tools/telemetry/telemetry/core/backends/chrome/android_browser_finder.py @@ -102,7 +102,7 @@ class PossibleAndroidBrowser(possible_browser.PossibleBrowser): def HaveLocalAPK(self): return self._local_apk and os.path.exists(self._local_apk) - def UpdateDeviceAPK(self): + def UpdateExecutableIfNeeded(self): if self.HaveLocalAPK(): real_logging.warn( 'Refreshing %s on device if needed.' % self._local_apk) @@ -119,7 +119,6 @@ def SelectDefaultBrowser(possible_browsers): if local_builds_by_date: newest_browser = local_builds_by_date[-1] - newest_browser.UpdateDeviceAPK() return newest_browser return None diff --git a/tools/telemetry/telemetry/core/backends/chrome/cros_browser_finder.py b/tools/telemetry/telemetry/core/backends/chrome/cros_browser_finder.py index 8d7a9e069e4c..5f73333e9d59 100644 --- a/tools/telemetry/telemetry/core/backends/chrome/cros_browser_finder.py +++ b/tools/telemetry/telemetry/core/backends/chrome/cros_browser_finder.py @@ -48,6 +48,9 @@ class PossibleCrOSBrowser(possible_browser.PossibleBrowser): return False return True + def UpdateExecutableIfNeeded(self): + pass + def SelectDefaultBrowser(possible_browsers): if cros_interface.IsRunningOnCrosDevice(): for b in possible_browsers: diff --git a/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_finder.py b/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_finder.py index e62d78107435..7baed5271575 100644 --- a/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_finder.py +++ b/tools/telemetry/telemetry/core/backends/chrome/desktop_browser_finder.py @@ -58,6 +58,9 @@ class PossibleDesktopBrowser(possible_browser.PossibleBrowser): return False return True + def UpdateExecutableIfNeeded(self): + pass + @property def last_modification_time(self): if os.path.exists(self._local_executable): 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 d3a59f0e61e2..f3e24ff4fc7d 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 @@ -53,6 +53,9 @@ class PossibleWebDriverBrowser(possible_browser.PossibleBrowser): return False return True + def UpdateExecutableIfNeeded(self): + pass + @property def last_modification_time(self): return -1 diff --git a/tools/telemetry/telemetry/core/browser_finder.py b/tools/telemetry/telemetry/core/browser_finder.py index 3afd574d264a..baa855929b02 100644 --- a/tools/telemetry/telemetry/core/browser_finder.py +++ b/tools/telemetry/telemetry/core/browser_finder.py @@ -62,6 +62,8 @@ def FindBrowser(options): logging.warning('--browser omitted. Using most recent local build: %s' % default_browser.browser_type) options.browser_type = default_browser.browser_type + # TODO: We should do this even when --browser is specified. + default_browser.UpdateExecutableIfNeeded() return default_browser raise BrowserTypeRequiredException( '--browser must be specified. Available browsers:\n%s' % -- 2.11.4.GIT