telemetry.core.android_platform | index telemetry/core/android_platform.py

`# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.`

Modules
`` |  |
telemetry.core.android_action_runner | telemetry.internal.app.android_app | telemetry.internal.backends.android_app_backend | telemetry.core.platform

Classes
`` |  | telemetry.core.platform.Platform(__builtin__.object) AndroidPlatform
class AndroidPlatform(telemetry.core.platform.Platform)
`` |  | Method resolution order: AndroidPlatform telemetry.core.platform.Platform __builtin__.object Methods defined here: LaunchAndroidApplication(self, start_intent, is_app_ready_predicate=None, app_has_webviews=True) `Launches an Android application given the intent. Args: start_intent: The intent to use to start the app. is_app_ready_predicate: A predicate function to determine whether the app is ready. This is a function that takes an AndroidApp instance and return a boolean. When it is not passed in, the app is ready when the intent to launch it is completed. app_has_webviews: A boolean indicating whether the app is expected to contain any WebViews. If True, the app will be launched with appropriate webview flags, and the GetWebViews method of the returned object may be used to access them. Returns: A reference to the android_app launched.` __init__(self, platform_backend) Data descriptors defined here: android_action_runner Methods inherited from telemetry.core.platform.Platform: CanCaptureVideo(self) `Returns a bool indicating whether the platform supports video capture.` CanFlushIndividualFilesFromSystemCache(self) `Returns true if the disk cache can be flushed for specific files.` CanLaunchApplication(self, application) `Returns whether the platform can launch the given application.` CanMeasurePerApplicationPower(self) `Returns True if the power monitor can measure power for the target application in isolation. False if power measurement is for full system energy consumption.` CanMonitorNetworkData(self) `Returns true if network data can be retrieved, false otherwise.` CanMonitorPower(self) `Returns True iff power can be monitored asynchronously via StartMonitoringPower() and StopMonitoringPower().` CanMonitorThermalThrottling(self) `Platforms may be able to detect thermal throttling. Some fan-less computers go into a reduced performance mode when their heat exceeds a certain threshold. Performance tests in particular should use this API to detect if this has happened and interpret results accordingly.` CanTakeScreenshot(self) CooperativelyShutdown(self, proc, app_name) `Cooperatively shut down the given process from subprocess.Popen. Currently this is only implemented on Windows. See crbug.com/424024 for background on why it was added. Args: proc: a process object returned from subprocess.Popen. app_name: on Windows, is the prefix of the application's window class name that should be searched for. This helps ensure that only the application's windows are closed. Returns True if it is believed the attempt succeeded.` FlushDnsCache(self) `Flushes the OS's DNS cache completely. This function may require root or administrator access.` FlushEntireSystemCache(self) `Flushes the OS's file cache completely. This function may require root or administrator access.` FlushSystemCacheForDirectory(self, directory) `Flushes the OS's file cache for the specified directory. This function does not require root or administrator access.` GetArchName(self) `Returns a string description of the Platform architecture. Examples: x86_64 (posix), AMD64 (win), armeabi-v7a, x86` GetDeviceTypeName(self) `Returns a string description of the Platform device, or None. Examples: Nexus 7, Nexus 6, Desktop` GetNetworkData(self, browser) `Get current network data. Returns: Tuple of (sent_data, received_data) in kb if data can be found, None otherwise.` GetOSName(self) `Returns a string description of the Platform OS. Examples: WIN, MAC, LINUX, CHROMEOS` GetOSVersionName(self) `Returns a logically sortable, string-like description of the Platform OS version. Examples: VISTA, WIN7, LION, MOUNTAINLION` GetOSVersionNumber(self) `Returns an integer description of the Platform OS major version. Examples: On Mac, 13 for Mavericks, 14 for Yosemite.` HasBeenThermallyThrottled(self) `Returns True if the device has been thermally throttled.` InstallApplication(self, application) `Installs the given application.` IsApplicationRunning(self, application) `Returns whether an application is currently running.` IsCooperativeShutdownSupported(self) `Indicates whether CooperativelyShutdown, below, is supported. It is not necessary to implement it on all platforms.` IsMonitoringPower(self) `Returns true if power is currently being monitored, false otherwise.` IsThermallyThrottled(self) `Returns True if the device is currently thermally throttled.` LaunchApplication(self, application, parameters=None, elevate_privilege=False) `"Launches the given |application| with a list of |parameters| on the OS. Set |elevate_privilege| to launch the application with root or admin rights. Returns: A popen style process handle for host platforms.` SetHTTPServerDirectories(self, paths) `Returns True if the HTTP server was started, False otherwise.` StartLocalServer(self, server) `Starts a LocalServer and associates it with this platform. |server.Close()| should be called manually to close the started server.` StartMonitoringPower(self, browser) `Starts monitoring power utilization statistics. Args: browser: The browser to monitor.` StartVideoCapture(self, min_bitrate_mbps) `Starts capturing video. Outer framing may be included (from the OS, browser window, and webcam). Args: min_bitrate_mbps: The minimum capture bitrate in MegaBits Per Second. The platform is free to deliver a higher bitrate if it can do so without increasing overhead. Raises: ValueError if the required |min_bitrate_mbps| can't be achieved.` StopAllLocalServers(self) StopMonitoringPower(self) `Stops monitoring power utilization and returns stats Returns: None if power measurement failed for some reason, otherwise a dict of power utilization statistics containing: { # An identifier for the data provider. Allows to evaluate the precision # of the data. Example values: monsoon, powermetrics, ds2784 'identifier': identifier, # The instantaneous power (voltage * current) reading in milliwatts at # each sample. 'power_samples_mw': [mw0, mw1, ..., mwN], # The full system energy consumption during the sampling period in # milliwatt hours. May be estimated by integrating power samples or may # be exact on supported hardware. 'energy_consumption_mwh': mwh, # The target application's energy consumption during the sampling period # in milliwatt hours. Should be returned iff # CanMeasurePerApplicationPower() return true. 'application_energy_consumption_mwh': mwh, # A platform-specific dictionary of additional details about the # utilization of individual hardware components. component_utilization: { ... } # Platform-specific data not attributed to any particular hardware # component. platform_info: { # Device-specific onboard temperature sensor. 'average_temperature_c': c, ... } }` StopVideoCapture(self) `Stops capturing video. Returns: A telemetry.core.video.Video object.` TakeScreenshot(self, file_path) `Takes a screenshot of the platform and save to |file_path|. Note that this method may not be supported on all platform, so check with CanTakeScreenshot before calling this. Args: file_path: Where to save the screenshot to. If the platform is remote, |file_path| is the path on the host platform. Returns True if it is believed the attempt succeeded.` Data descriptors inherited from telemetry.core.platform.Platform: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)` http_server is_host_platform local_servers `Returns the currently running local servers.` network_controller `Control network settings and servers to simulate the Web.` tracing_controller