Home | History | Annotate | Download | only in docs
      1 
      2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      3 <html><head><title>Python: module telemetry.page.actions.page_action</title>
      4 </head><body bgcolor="#f0f0f8">
      5 
      6 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
      7 <tr bgcolor="#7799ee">
      8 <td valign=bottom>&nbsp;<br>
      9 <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.page.html"><font color="#ffffff">page</font></a>.<a href="telemetry.page.actions.html"><font color="#ffffff">actions</font></a>.page_action</strong></big></big></font></td
     10 ><td align=right valign=bottom
     11 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/page/actions/page_action.py">telemetry/page/actions/page_action.py</a></font></td></tr></table>
     12     <p><tt>#&nbsp;Copyright&nbsp;(c)&nbsp;2012&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
     13 #&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
     14 #&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
     15 <p>
     16 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     17 <tr bgcolor="#ee77aa">
     18 <td colspan=3 valign=bottom>&nbsp;<br>
     19 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
     20     
     21 <tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
     22 <td width="100%"><dl>
     23 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
     24 </font></dt><dd>
     25 <dl>
     26 <dt><font face="helvetica, arial"><a href="telemetry.page.actions.page_action.html#PageAction">PageAction</a>
     27 </font></dt></dl>
     28 </dd>
     29 <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
     30 </font></dt><dd>
     31 <dl>
     32 <dt><font face="helvetica, arial"><a href="telemetry.page.actions.page_action.html#PageActionFailed">PageActionFailed</a>
     33 </font></dt><dt><font face="helvetica, arial"><a href="telemetry.page.actions.page_action.html#PageActionNotSupported">PageActionNotSupported</a>
     34 </font></dt></dl>
     35 </dd>
     36 </dl>
     37  <p>
     38 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     39 <tr bgcolor="#ffc8d8">
     40 <td colspan=3 valign=bottom>&nbsp;<br>
     41 <font color="#000000" face="helvetica, arial"><a name="PageAction">class <strong>PageAction</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
     42     
     43 <tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
     44 <td colspan=2><tt>Represents&nbsp;an&nbsp;action&nbsp;that&nbsp;a&nbsp;user&nbsp;might&nbsp;try&nbsp;to&nbsp;perform&nbsp;to&nbsp;a&nbsp;page.<br>&nbsp;</tt></td></tr>
     45 <tr><td>&nbsp;</td>
     46 <td width="100%">Methods defined here:<br>
     47 <dl><dt><a name="PageAction-BindMeasurementJavaScript"><strong>BindMeasurementJavaScript</strong></a>(self, tab, start_js, stop_js)</dt><dd><tt>Let&nbsp;this&nbsp;action&nbsp;determine&nbsp;when&nbsp;measurements&nbsp;should&nbsp;start&nbsp;and&nbsp;stop.<br>
     48 &nbsp;<br>
     49 A&nbsp;measurement&nbsp;can&nbsp;call&nbsp;this&nbsp;method&nbsp;to&nbsp;provide&nbsp;the&nbsp;action<br>
     50 with&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;starts&nbsp;and&nbsp;stops&nbsp;measurements.&nbsp;The&nbsp;action<br>
     51 determines&nbsp;when&nbsp;to&nbsp;execute&nbsp;the&nbsp;provided&nbsp;JavaScript&nbsp;code,&nbsp;for&nbsp;more&nbsp;accurate<br>
     52 timings.<br>
     53 &nbsp;<br>
     54 Args:<br>
     55 &nbsp;&nbsp;tab:&nbsp;The&nbsp;tab&nbsp;to&nbsp;do&nbsp;everything&nbsp;on.<br>
     56 &nbsp;&nbsp;start_js:&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;starts&nbsp;measurements.<br>
     57 &nbsp;&nbsp;stop_js:&nbsp;JavaScript&nbsp;code&nbsp;that&nbsp;stops&nbsp;measurements.</tt></dd></dl>
     58 
     59 <dl><dt><a name="PageAction-CanBeBound"><strong>CanBeBound</strong></a>(self)</dt><dd><tt>If&nbsp;this&nbsp;class&nbsp;implements&nbsp;BindMeasurementJavaScript,&nbsp;override&nbsp;CanBeBound<br>
     60 to&nbsp;return&nbsp;True&nbsp;so&nbsp;that&nbsp;a&nbsp;test&nbsp;knows&nbsp;it&nbsp;can&nbsp;bind&nbsp;measurements.</tt></dd></dl>
     61 
     62 <dl><dt><a name="PageAction-CleanUp"><strong>CleanUp</strong></a>(self, page, tab)</dt></dl>
     63 
     64 <dl><dt><a name="PageAction-CustomizeBrowserOptions"><strong>CustomizeBrowserOptions</strong></a>(self, options)</dt><dd><tt>Override&nbsp;to&nbsp;add&nbsp;action-specific&nbsp;options&nbsp;to&nbsp;the&nbsp;BrowserOptions<br>
     65 <a href="__builtin__.html#object">object</a>.</tt></dd></dl>
     66 
     67 <dl><dt><a name="PageAction-RunAction"><strong>RunAction</strong></a>(self, page, tab, previous_action)</dt></dl>
     68 
     69 <dl><dt><a name="PageAction-RunsPreviousAction"><strong>RunsPreviousAction</strong></a>(self)</dt><dd><tt>Some&nbsp;actions&nbsp;require&nbsp;some&nbsp;initialization&nbsp;to&nbsp;be&nbsp;performed&nbsp;before&nbsp;the<br>
     70 previous&nbsp;action.&nbsp;For&nbsp;example,&nbsp;wait&nbsp;for&nbsp;href&nbsp;change&nbsp;needs&nbsp;to&nbsp;record&nbsp;the&nbsp;old<br>
     71 href&nbsp;before&nbsp;the&nbsp;previous&nbsp;action&nbsp;changes&nbsp;it.&nbsp;Therefore,&nbsp;we&nbsp;allow&nbsp;actions&nbsp;to<br>
     72 run&nbsp;the&nbsp;previous&nbsp;action.&nbsp;An&nbsp;action&nbsp;that&nbsp;does&nbsp;this&nbsp;should&nbsp;override&nbsp;this&nbsp;to<br>
     73 return&nbsp;True&nbsp;in&nbsp;order&nbsp;to&nbsp;prevent&nbsp;the&nbsp;previous&nbsp;action&nbsp;from&nbsp;being&nbsp;run&nbsp;twice.</tt></dd></dl>
     74 
     75 <dl><dt><a name="PageAction-WillRunAction"><strong>WillRunAction</strong></a>(self, page, tab)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;action-specific&nbsp;setup&nbsp;before<br>
     76 Test.WillRunAction&nbsp;is&nbsp;called.</tt></dd></dl>
     77 
     78 <dl><dt><a name="PageAction-__init__"><strong>__init__</strong></a>(self, attributes<font color="#909090">=None</font>)</dt></dl>
     79 
     80 <hr>
     81 Data descriptors defined here:<br>
     82 <dl><dt><strong>__dict__</strong></dt>
     83 <dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
     84 </dl>
     85 <dl><dt><strong>__weakref__</strong></dt>
     86 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
     87 </dl>
     88 </td></tr></table> <p>
     89 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
     90 <tr bgcolor="#ffc8d8">
     91 <td colspan=3 valign=bottom>&nbsp;<br>
     92 <font color="#000000" face="helvetica, arial"><a name="PageActionFailed">class <strong>PageActionFailed</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
     93     
     94 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
     95 <td width="100%"><dl><dt>Method resolution order:</dt>
     96 <dd><a href="telemetry.page.actions.page_action.html#PageActionFailed">PageActionFailed</a></dd>
     97 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
     98 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
     99 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
    100 </dl>
    101 <hr>
    102 Data descriptors defined here:<br>
    103 <dl><dt><strong>__weakref__</strong></dt>
    104 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
    105 </dl>
    106 <hr>
    107 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
    108 <dl><dt><a name="PageActionFailed-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
    109 
    110 <hr>
    111 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
    112 <dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#PageActionFailed-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
    113 
    114 <hr>
    115 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
    116 <dl><dt><a name="PageActionFailed-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
    117 
    118 <dl><dt><a name="PageActionFailed-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
    119 
    120 <dl><dt><a name="PageActionFailed-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
    121 
    122 <dl><dt><a name="PageActionFailed-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
    123 &nbsp;<br>
    124 Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
    125 
    126 <dl><dt><a name="PageActionFailed-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
    127 
    128 <dl><dt><a name="PageActionFailed-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
    129 
    130 <dl><dt><a name="PageActionFailed-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
    131 
    132 <dl><dt><a name="PageActionFailed-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
    133 
    134 <dl><dt><a name="PageActionFailed-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionFailed-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
    135 
    136 <dl><dt><a name="PageActionFailed-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
    137 
    138 <hr>
    139 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
    140 <dl><dt><strong>__dict__</strong></dt>
    141 </dl>
    142 <dl><dt><strong>args</strong></dt>
    143 </dl>
    144 <dl><dt><strong>message</strong></dt>
    145 </dl>
    146 </td></tr></table> <p>
    147 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
    148 <tr bgcolor="#ffc8d8">
    149 <td colspan=3 valign=bottom>&nbsp;<br>
    150 <font color="#000000" face="helvetica, arial"><a name="PageActionNotSupported">class <strong>PageActionNotSupported</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
    151     
    152 <tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
    153 <td width="100%"><dl><dt>Method resolution order:</dt>
    154 <dd><a href="telemetry.page.actions.page_action.html#PageActionNotSupported">PageActionNotSupported</a></dd>
    155 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
    156 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
    157 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
    158 </dl>
    159 <hr>
    160 Data descriptors defined here:<br>
    161 <dl><dt><strong>__weakref__</strong></dt>
    162 <dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
    163 </dl>
    164 <hr>
    165 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
    166 <dl><dt><a name="PageActionNotSupported-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
    167 
    168 <hr>
    169 Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
    170 <dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#PageActionNotSupported-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
    171 
    172 <hr>
    173 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
    174 <dl><dt><a name="PageActionNotSupported-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
    175 
    176 <dl><dt><a name="PageActionNotSupported-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
    177 
    178 <dl><dt><a name="PageActionNotSupported-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
    179 
    180 <dl><dt><a name="PageActionNotSupported-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
    181 &nbsp;<br>
    182 Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
    183 
    184 <dl><dt><a name="PageActionNotSupported-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
    185 
    186 <dl><dt><a name="PageActionNotSupported-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
    187 
    188 <dl><dt><a name="PageActionNotSupported-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
    189 
    190 <dl><dt><a name="PageActionNotSupported-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
    191 
    192 <dl><dt><a name="PageActionNotSupported-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#PageActionNotSupported-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
    193 
    194 <dl><dt><a name="PageActionNotSupported-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
    195 
    196 <hr>
    197 Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
    198 <dl><dt><strong>__dict__</strong></dt>
    199 </dl>
    200 <dl><dt><strong>args</strong></dt>
    201 </dl>
    202 <dl><dt><strong>message</strong></dt>
    203 </dl>
    204 </td></tr></table></td></tr></table>
    205 </body></html>