summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/telemetry/telemetry/core/backends/browser_backend.py8
-rw-r--r--tools/telemetry/telemetry/core/platform/android_platform_backend.py18
2 files changed, 5 insertions, 21 deletions
diff --git a/tools/telemetry/telemetry/core/backends/browser_backend.py b/tools/telemetry/telemetry/core/backends/browser_backend.py
index 49cf3fb..26b5df4 100644
--- a/tools/telemetry/telemetry/core/backends/browser_backend.py
+++ b/tools/telemetry/telemetry/core/backends/browser_backend.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
from telemetry import decorators
+from telemetry.core import platform
from telemetry.core import web_contents
from telemetry.core.forwarders import do_nothing_forwarder
@@ -28,9 +29,10 @@ class BrowserBackend(object):
def SetBrowser(self, browser):
self._browser = browser
- if (self.browser_options.netsim and
- not browser.platform.CanLaunchApplication('ipfw')):
- browser.platform.InstallApplication('ipfw')
+ if self.browser_options.netsim:
+ host_platform = platform.GetHostPlatform()
+ if not host_platform.CanLaunchApplication('ipfw'):
+ host_platform.InstallApplication('ipfw')
@property
def browser(self):
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend.py b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
index 4c5ff87..b9d6c23 100644
--- a/tools/telemetry/telemetry/core/platform/android_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
@@ -31,13 +31,6 @@ except Exception:
surface_stats_collector = None
-_HOST_APPLICATIONS = [
- 'avconv',
- 'ipfw',
- 'perfhost',
- ]
-
-
class AndroidPlatformBackend(
linux_based_platform_backend.LinuxBasedPlatformBackend):
def __init__(self, device, no_performance_mode):
@@ -189,10 +182,6 @@ class AndroidPlatformBackend(
def LaunchApplication(
self, application, parameters=None, elevate_privilege=False):
- if application in _HOST_APPLICATIONS:
- platform.GetHostPlatform().LaunchApplication(
- application, parameters, elevate_privilege=elevate_privilege)
- return
if elevate_privilege:
raise NotImplementedError("elevate_privilege isn't supported on android.")
if not parameters:
@@ -200,19 +189,12 @@ class AndroidPlatformBackend(
self._device.RunShellCommand('am start ' + parameters + ' ' + application)
def IsApplicationRunning(self, application):
- if application in _HOST_APPLICATIONS:
- return platform.GetHostPlatform().IsApplicationRunning(application)
return len(self._device.GetPids(application)) > 0
def CanLaunchApplication(self, application):
- if application in _HOST_APPLICATIONS:
- return platform.GetHostPlatform().CanLaunchApplication(application)
return True
def InstallApplication(self, application):
- if application in _HOST_APPLICATIONS:
- platform.GetHostPlatform().InstallApplication(application)
- return
raise NotImplementedError(
'Please teach Telemetry how to install ' + application)