telemetry.internal.backends.chrome_inspector.devtools_client_backend | index telemetry/internal/backends/chrome_inspector/devtools_client_backend.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.internal.backends.browser_backend telemetry.internal.platform.tracing_agent.chrome_tracing_agent telemetry.internal.platform.tracing_agent.chrome_tracing_devtools_manager telemetry.decorators | telemetry.internal.backends.chrome_inspector.devtools_http telemetry.core.exceptions telemetry.internal.backends.chrome_inspector.inspector_backend telemetry.internal.backends.chrome_inspector.inspector_websocket | logging telemetry.internal.backends.chrome_inspector.memory_backend re socket | sys telemetry.timeline.trace_data telemetry.internal.backends.chrome_inspector.tracing_backend telemetry.internal.backends.chrome_inspector.websocket

Classes
`` |  |

__builtin__.object
  DevToolsClientBackend
telemetry.core.exceptions.Error(exceptions.Exception)
  TabNotFoundError

class DevToolsClientBackend(__builtin__.object)
`` | `An object that communicates with Chrome's devtools. This class owns a map of InspectorBackends. It is responsible for creating them and destroying them.`
| Methods defined here:

ActivateTab(self, tab_id, timeout)
  `Activates the tab with the given id.
  Raises:
  devtools_http.DevToolsClientConnectionError
  TabNotFoundError`

Close(self)

CloseTab(self, tab_id, timeout)
  `Closes the tab with the given id.
  Raises:
  devtools_http.DevToolsClientConnectionError
  TabNotFoundError`

DumpMemory(self, timeout=30)
  `Dumps memory.
  Returns:
  GUID of the generated dump if successful, None otherwise.
  Raises:
  TracingTimeoutException: If more than |timeout| seconds has passed
  since the last time any data is received.
  TracingUnrecoverableException: If there is a websocket error.
  TracingUnexpectedResponseException: If the response contains an error
  or does not contain the expected result.`

GetChromeBranchNumber(*args, **kwargs)

GetUpdatedInspectableContexts(self)
  `Returns an updated instance of _DevToolsContextMapBackend.`

GetUrl(self, tab_id)
  `Returns the URL of the tab with |tab_id|, as reported by devtools.
  Raises:
  devtools_http.DevToolsClientConnectionError`

IsAlive(self)
  `Whether the DevTools server is available and connectable.`

IsChromeTracingSupported(self)

IsInspectable(self, tab_id)
  `Whether the tab with |tab_id| is inspectable, as reported by devtools.
  Raises:
  devtools_http.DevToolsClientConnectionError`

RequestNewTab(self, timeout)
  `Creates a new tab.
  Returns:
  A JSON string as returned by DevTools. Example:
  {
  "description": "",
  "devtoolsFrontendUrl":
  "/devtools/inspector.html?ws=host:port/devtools/page/id-string",
  "id": "id-string",
  "title": "Page Title",
  "type": "page",
  "url": "url",
  "webSocketDebuggerUrl": "ws://host:port/devtools/page/id-string"
  }
  Raises:
  devtools_http.DevToolsClientConnectionError`

SetMemoryPressureNotificationsSuppressed(self, suppressed, timeout=30)
  `Enable/disable suppressing memory pressure notifications.
  Args:
  suppressed: If true, memory pressure notifications will be suppressed.
  timeout: The timeout in seconds.
  Raises:
  MemoryTimeoutException: If more than |timeout| seconds has passed
  since the last time any data is received.
  MemoryUnrecoverableException: If there is a websocket error.
  MemoryUnexpectedResponseException: If the response contains an error
  or does not contain the expected result.`

SimulateMemoryPressureNotification(self, pressure_level, timeout=30)
  `Simulate a memory pressure notification.
  Args:
  pressure level: The memory pressure level of the notification ('moderate'
  or 'critical').
  timeout: The timeout in seconds.
  Raises:
  MemoryTimeoutException: If more than |timeout| seconds has passed
  since the last time any data is received.
  MemoryUnrecoverableException: If there is a websocket error.
  MemoryUnexpectedResponseException: If the response contains an error
  or does not contain the expected result.`

StartChromeTracing(self, trace_options, custom_categories=None, timeout=10)
  `Args:
  trace_options: An tracing_options.TracingOptions instance.
  custom_categories: An optional string containing a list of
  comma separated categories that will be traced
  instead of the default category set. Example: use
  "webkit,cc,disabled-by-default-cc.debug" to trace only
  those three event categories.`

StopChromeTracing(self, trace_data_builder, timeout=30)

__init__(self, devtools_port, remote_devtools_port, app_backend)
  `Creates a new DevToolsClientBackend.
  A DevTools agent must exist on the given devtools_port.
  Args:
  devtools_port: The port to use to connect to DevTools agent.
  remote_devtools_port: In some cases (e.g., app running on
  Android device, devtools_port is the forwarded port on the
  host platform. We also need to know the remote_devtools_port
  so that we can uniquely identify the DevTools agent.
  app_backend: For the app that contains the DevTools agent.`

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

is_tracing_running

remote_port

support_startup_tracing

supports_overriding_memory_pressure_notifications

supports_tracing

class TabNotFoundError(telemetry.core.exceptions.Error)
`` |  |

Method resolution order:
  TabNotFoundError
  telemetry.core.exceptions.Error
  exceptions.Exception
  exceptions.BaseException
  __builtin__.object

Methods inherited from telemetry.core.exceptions.Error:

AddDebuggingMessage(self, msg)
  `Adds a message to the description of the exception.
  Many Telemetry exceptions arise from failures in another application. These
  failures are difficult to pinpoint. This method allows Telemetry classes to
  append useful debugging information to the exception. This method also logs
  information about the location from where it was called.`

__init__(self, msg='')

__str__(self)

Data descriptors inherited from telemetry.core.exceptions.Error:

__weakref__
  `list of weak references to the object (if defined)`

Data and other attributes inherited from exceptions.Exception:

__new__ = <built-in method __new__ of type object>
  `T.__new__(S, ...) -> a new object with type S, a subtype of T`

Methods inherited from exceptions.BaseException:

__delattr__(...)
  `x.__delattr__('name') <==> del x.name`

__getattribute__(...)
  `x.__getattribute__('name') <==> x.name`

__getitem__(...)
  `x.__getitem__(y) <==> x[y]`

__getslice__(...)
  `x.__getslice__(i, j) <==> x[i:j]
  Use of negative indices is not supported.`

__reduce__(...)

__repr__(...)
  `x.__repr__() <==> repr(x)`

__setattr__(...)
  `x.__setattr__('name', value) <==> x.name = value`

__setstate__(...)

__unicode__(...)

Data descriptors inherited from exceptions.BaseException:

__dict__

args

message

Functions
`` |  |

IsDevToolsAgentAvailable(port, app_backend)
  `Returns True if a DevTools agent is available on the given port.`

Data
`` |  | BROWSER_INSPECTOR_WEBSOCKET_URL = 'ws://127.0.0.1:%i/devtools/browser'