telemetry.internal.actions.page_action
index
telemetry/internal/actions/page_action.py

# Copyright 2012 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.decorators
re

 
Classes
       
__builtin__.object
PageAction
exceptions.Exception(exceptions.BaseException)
PageActionFailed
PageActionNotSupported

 
class PageAction(__builtin__.object)
    Represents an action that a user might try to perform to a page.
 
  Methods defined here:
CleanUp(self, tab)
RunAction(self, tab)
WillRunAction(self, tab)
Override to do action-specific setup before
Test.WillRunAction is called.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PageActionFailed(exceptions.Exception)
    
Method resolution order:
PageActionFailed
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

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__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class PageActionNotSupported(exceptions.Exception)
    
Method resolution order:
PageActionNotSupported
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.Exception:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

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__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
Functions
       
EvaluateCallbackWithElement(tab, callback_js, selector=None, text=None, element_function=None, wait=False, timeout_in_seconds=60)
Evaluates the JavaScript callback with the given element.
 
The element may be selected via selector, text, or element_function.
Only one of these arguments must be specified.
 
Returns:
  The callback's return value, if any. The return value must be
  convertible to JSON.
 
Args:
  tab: A telemetry.core.Tab object.
  callback_js: The JavaScript callback to call (as string).
      The callback receive 2 parameters: the element, and information
      string about what method was used to retrieve the element.
      Example: '''
        function(element, info) {
          if (!element) {
            throw Error('Can not find element: ' + info);
          }
          element.click()
        }'''
  selector: A CSS selector describing the element.
  text: The element must contains this exact text.
  element_function: A JavaScript function (as string) that is used
      to retrieve the element. For example:
      '(function() { return foo.element; })()'.
  wait: Whether to wait for the return value to be true.
  timeout_in_seconds: The timeout for wait (if waiting).
IsGestureSourceTypeSupported(*args, **kwargs)

 
Data
        GESTURE_SOURCE_DEFAULT = 'DEFAULT'
GESTURE_SOURCE_MOUSE = 'MOUSE'
GESTURE_SOURCE_TOUCH = 'TOUCH'
SUPPORTED_GESTURE_SOURCES = ('DEFAULT', 'MOUSE', 'TOUCH')