| OLD | NEW |
| (Empty) | |
| 1 |
| 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 <html><head><title>Python: package telemetry</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> <br> |
| 9 <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>teleme
try</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=
"file:/Users/nduca/Local/chrome/src/tools/telemetry/telemetry/__init__.py">/User
s/nduca/Local/chrome/src/tools/telemetry/telemetry/__init__.py</a></font></td></
tr></table> |
| 12 <p><tt>A library for cross-platform browser tests.<
/tt></p> |
| 13 <p> |
| 14 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 15 <tr bgcolor="#aa55cc"> |
| 16 <td colspan=3 valign=bottom> <br> |
| 17 <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</str
ong></big></font></td></tr> |
| 18 |
| 19 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td>
</td> |
| 20 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=t
op><a href="telemetry.core.html"><strong>core</strong> (package)</a><br> |
| 21 </td><td width="25%" valign=top><a href="telemetry.page.html"><strong>page</stro
ng> (package)</a><br> |
| 22 </td><td width="25%" valign=top><a href="telemetry.unittest.html"><strong>unitte
st</strong> (package)</a><br> |
| 23 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p> |
| 24 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 25 <tr bgcolor="#ee77aa"> |
| 26 <td colspan=3 valign=bottom> <br> |
| 27 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> |
| 28 |
| 29 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> |
| 30 <td width="100%"><dl> |
| 31 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.
object</a> |
| 32 </font></dt><dd> |
| 33 <dl> |
| 34 <dt><font face="helvetica, arial"><a href="telemetry.core.browser.html#Browser">
telemetry.core.browser.Browser</a> |
| 35 </font></dt></dl> |
| 36 </dd> |
| 37 <dt><font face="helvetica, arial"><a href="optparse.html#Values">optparse.Values
</a> |
| 38 </font></dt><dd> |
| 39 <dl> |
| 40 <dt><font face="helvetica, arial"><a href="telemetry.core.browser_options.html#B
rowserOptions">telemetry.core.browser_options.BrowserOptions</a> |
| 41 </font></dt></dl> |
| 42 </dd> |
| 43 <dt><font face="helvetica, arial"><a href="telemetry.core.web_contents.html#WebC
ontents">telemetry.core.web_contents.WebContents</a>(<a href="__builtin__.html#o
bject">__builtin__.object</a>) |
| 44 </font></dt><dd> |
| 45 <dl> |
| 46 <dt><font face="helvetica, arial"><a href="telemetry.core.tab.html#Tab">telemetr
y.core.tab.Tab</a> |
| 47 </font></dt></dl> |
| 48 </dd> |
| 49 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#PageTes
t">telemetry.page.page_test.PageTest</a>(<a href="__builtin__.html#object">__bui
ltin__.object</a>) |
| 50 </font></dt><dd> |
| 51 <dl> |
| 52 <dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#
PageMeasurement">telemetry.page.page_measurement.PageMeasurement</a> |
| 53 </font></dt></dl> |
| 54 </dd> |
| 55 </dl> |
| 56 <p> |
| 57 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 58 <tr bgcolor="#ffc8d8"> |
| 59 <td colspan=3 valign=bottom> <br> |
| 60 <font color="#000000" face="helvetica, arial"><a name="Browser">class <strong>Br
owser</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</fo
nt></td></tr> |
| 61 |
| 62 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 63 <td colspan=2><tt>A running browser instance that can&n
bsp;be controlled in a limited way.<br> |
| 64 <br> |
| 65 To create a browser instance, use browser_finder.F
indBrowser.<br> |
| 66 <br> |
| 67 Be sure to clean up after yourself by ca
lling <a href="#Browser-Close">Close</a>() when you are 
;done with<br> |
| 68 the browser. Or better yet:<br> |
| 69 browser_to_create = FindBrowser(options)<br> |
| 70 with browser_to_create.Create() as browser:<br> |
| 71 ... do all your operations on&n
bsp;browser here<br> </tt></td></tr> |
| 72 <tr><td> </td> |
| 73 <td width="100%">Methods defined here:<br> |
| 74 <dl><dt><a name="Browser-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Clo
ses this browser.</tt></dd></dl> |
| 75 |
| 76 <dl><dt><a name="Browser-GetStandardOutput"><strong>GetStandardOutput</strong></
a>(self)</dt></dl> |
| 77 |
| 78 <dl><dt><a name="Browser-GetTraceResultAndReset"><strong>GetTraceResultAndReset<
/strong></a>(self)</dt><dd><tt>Returns the result of the&nbs
p;trace, as TraceResult <a href="__builtin__.html#object">object<
/a>.</tt></dd></dl> |
| 79 |
| 80 <dl><dt><a name="Browser-SetHTTPServerDirectories"><strong>SetHTTPServerDirector
ies</strong></a>(self, paths)</dt><dd><tt>Returns True if the&nbs
p;HTTP server was started, False otherwise.</tt></dd></
dl> |
| 81 |
| 82 <dl><dt><a name="Browser-SetReplayArchivePath"><strong>SetReplayArchivePath</str
ong></a>(self, archive_path, append_to_existing_wpr<font color="#909090">=False<
/font>)</dt></dl> |
| 83 |
| 84 <dl><dt><a name="Browser-StartProfiling"><strong>StartProfiling</strong></a>(sel
f, options, base_output_file)</dt><dd><tt>Starts profiling using
|options|.profiler_tool. Results are saved to<br> |
| 85 |base_output_file|.<process_name>.</tt></dd></dl> |
| 86 |
| 87 <dl><dt><a name="Browser-StartTracing"><strong>StartTracing</strong></a>(self, c
ustom_categories<font color="#909090">=None</font>)</dt></dl> |
| 88 |
| 89 <dl><dt><a name="Browser-StopProfiling"><strong>StopProfiling</strong></a>(self)
</dt><dd><tt>Stops all active profilers and saves
their results.</tt></dd></dl> |
| 90 |
| 91 <dl><dt><a name="Browser-StopTracing"><strong>StopTracing</strong></a>(self)</dt
></dl> |
| 92 |
| 93 <dl><dt><a name="Browser-__enter__"><strong>__enter__</strong></a>(self)</dt></d
l> |
| 94 |
| 95 <dl><dt><a name="Browser-__exit__"><strong>__exit__</strong></a>(self, *args)</d
t></dl> |
| 96 |
| 97 <dl><dt><a name="Browser-__init__"><strong>__init__</strong></a>(self, backend,
platform_backend)</dt></dl> |
| 98 |
| 99 <dl><dt><a name="Browser-is_profiler_active"><strong>is_profiler_active</strong>
</a>(self, profiler_name)</dt></dl> |
| 100 |
| 101 <hr> |
| 102 Data descriptors defined here:<br> |
| 103 <dl><dt><strong>__dict__</strong></dt> |
| 104 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> |
| 105 </dl> |
| 106 <dl><dt><strong>__weakref__</strong></dt> |
| 107 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> |
| 108 </dl> |
| 109 <dl><dt><strong>browser_type</strong></dt> |
| 110 </dl> |
| 111 <dl><dt><strong>extensions</strong></dt> |
| 112 <dd><tt>Returns the extension dictionary if it exi
sts.</tt></dd> |
| 113 </dl> |
| 114 <dl><dt><strong>http_server</strong></dt> |
| 115 </dl> |
| 116 <dl><dt><strong>io_stats</strong></dt> |
| 117 <dd><tt>Returns a dict of IO statistics for t
he browser:<br> |
| 118 { 'Browser': {<br> |
| 119 'ReadOperationCount': W,<br> |
| 120 'WriteOperationCount': X,<br> |
| 121 'ReadTransferCount': Y,<br> |
| 122 'WriteTransferCount': Z<br> |
| 123 },<br> |
| 124 'Gpu': {<br> |
| 125 'ReadOperationCount': W,<br> |
| 126 'WriteOperationCount': X,<br> |
| 127 'ReadTransferCount': Y,<br> |
| 128 'WriteTransferCount': Z<br> |
| 129 },<br> |
| 130 'Renderer': {<br> |
| 131 'ReadOperationCount': W,<br> |
| 132 'WriteOperationCount': X,<br> |
| 133 'ReadTransferCount': Y,<br> |
| 134 'WriteTransferCount': Z<br> |
| 135 }<br> |
| 136 }</tt></dd> |
| 137 </dl> |
| 138 <dl><dt><strong>is_content_shell</strong></dt> |
| 139 <dd><tt>Returns whether this browser is a content&
nbsp;shell, only.</tt></dd> |
| 140 </dl> |
| 141 <dl><dt><strong>memory_stats</strong></dt> |
| 142 <dd><tt>Returns a dict of memory statistics for&nb
sp;the browser:<br> |
| 143 { 'Browser': {<br> |
| 144 'VM': S,<br> |
| 145 'VMPeak': T,<br> |
| 146 'WorkingSetSize': U,<br> |
| 147 'WorkingSetSizePeak': V,<br> |
| 148 'ProportionalSetSize': W,<br> |
| 149 'PrivateDirty': X<br> |
| 150 },<br> |
| 151 'Gpu': {<br> |
| 152 'VM': S,<br> |
| 153 'VMPeak': T,<br> |
| 154 'WorkingSetSize': U,<br> |
| 155 'WorkingSetSizePeak': V,<br> |
| 156 'ProportionalSetSize': W,<br> |
| 157 'PrivateDirty': X<br> |
| 158 },<br> |
| 159 'Renderer': {<br> |
| 160 'VM': S,<br> |
| 161 'VMPeak': T,<br> |
| 162 'WorkingSetSize': U,<br> |
| 163 'WorkingSetSizePeak': V,<br> |
| 164 'ProportionalSetSize': W,<br> |
| 165 'PrivateDirty': X<br> |
| 166 },<br> |
| 167 'SystemCommitCharge': Y,<br> |
| 168 'ProcessCount': Z,<br> |
| 169 }<br> |
| 170 Any of the above keys may be missing on&
nbsp;a per-platform basis.</tt></dd> |
| 171 </dl> |
| 172 <dl><dt><strong>platform</strong></dt> |
| 173 </dl> |
| 174 <dl><dt><strong>supports_extensions</strong></dt> |
| 175 </dl> |
| 176 <dl><dt><strong>supports_tab_control</strong></dt> |
| 177 </dl> |
| 178 <dl><dt><strong>supports_tracing</strong></dt> |
| 179 </dl> |
| 180 <dl><dt><strong>tabs</strong></dt> |
| 181 </dl> |
| 182 </td></tr></table> <p> |
| 183 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 184 <tr bgcolor="#ffc8d8"> |
| 185 <td colspan=3 valign=bottom> <br> |
| 186 <font color="#000000" face="helvetica, arial"><a name="BrowserOptions">class <st
rong>BrowserOptions</strong></a>(<a href="optparse.html#Values">optparse.Values<
/a>)</font></td></tr> |
| 187 |
| 188 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 189 <td colspan=2><tt>Options to be used for discovering&nb
sp;and launching a browser.<br> </tt></td></tr> |
| 190 <tr><td> </td> |
| 191 <td width="100%">Methods defined here:<br> |
| 192 <dl><dt><a name="BrowserOptions-AppendExtraBrowserArg"><strong>AppendExtraBrowse
rArg</strong></a>(self, arg)</dt></dl> |
| 193 |
| 194 <dl><dt><a name="BrowserOptions-Copy"><strong>Copy</strong></a>(self)</dt></dl> |
| 195 |
| 196 <dl><dt><a name="BrowserOptions-CreateParser"><strong>CreateParser</strong></a>(
self, *args, **kwargs)</dt></dl> |
| 197 |
| 198 <dl><dt><a name="BrowserOptions-__init__"><strong>__init__</strong></a>(self, br
owser_type<font color="#909090">=None</font>)</dt></dl> |
| 199 |
| 200 <hr> |
| 201 Methods inherited from <a href="optparse.html#Values">optparse.Values</a>:<br> |
| 202 <dl><dt><a name="BrowserOptions-__cmp__"><strong>__cmp__</strong></a>(self, othe
r)</dt></dl> |
| 203 |
| 204 <dl><dt><a name="BrowserOptions-__repr__"><strong>__repr__</strong></a> = _repr(
self)</dt></dl> |
| 205 |
| 206 <dl><dt><a name="BrowserOptions-__str__"><strong>__str__</strong></a>(self)</dt>
</dl> |
| 207 |
| 208 <dl><dt><a name="BrowserOptions-ensure_value"><strong>ensure_value</strong></a>(
self, attr, value)</dt></dl> |
| 209 |
| 210 <dl><dt><a name="BrowserOptions-read_file"><strong>read_file</strong></a>(self,
filename, mode<font color="#909090">='careful'</font>)</dt></dl> |
| 211 |
| 212 <dl><dt><a name="BrowserOptions-read_module"><strong>read_module</strong></a>(se
lf, modname, mode<font color="#909090">='careful'</font>)</dt></dl> |
| 213 |
| 214 </td></tr></table> <p> |
| 215 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 216 <tr bgcolor="#ffc8d8"> |
| 217 <td colspan=3 valign=bottom> <br> |
| 218 <font color="#000000" face="helvetica, arial"><a name="PageMeasurement">class <s
trong>PageMeasurement</strong></a>(<a href="telemetry.page.page_test.html#PageTe
st">telemetry.page.page_test.PageTest</a>)</font></td></tr> |
| 219 |
| 220 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 221 <td colspan=2><tt>Glue code for running a measurement&n
bsp;across a set of pages.<br> |
| 222 <br> |
| 223 To use this, subclass from the measurement an
d override MeasurePage. For<br> |
| 224 example:<br> |
| 225 <br> |
| 226 class BodyChildElementMeasurement(<a href="#PageMeasureme
nt">PageMeasurement</a>):<br> |
| 227 def <a href="#PageMeasurement-MeasurePa
ge">MeasurePage</a>(self, page, tab, results):<br> |
| 228 body_child_count =&nb
sp;tab.EvaluateJavaScript(<br> |
| 229 'd
ocument.body.children.length')<br> |
| 230 results.Add('body_children
', 'count', body_child_count)<br> |
| 231 <br> |
| 232 if __name__ == '__main__':<br> |
| 233 page_measurement.Main(BodyChildElement
Measurement())<br> |
| 234 <br> |
| 235 To add test-specific options:<br> |
| 236 <br> |
| 237 class BodyChildElementMeasurement(<a href="#PageMeasureme
nt">PageMeasurement</a>):<br> |
| 238 def <a href="#PageMeasurement-AddComman
dLineOptions">AddCommandLineOptions</a>(parser):<br> |
| 239 parser.add_option('--eleme
nt', action='store', default='body')<br> |
| 240 <br> |
| 241 def <a href="#PageMeasurement-MeasurePa
ge">MeasurePage</a>(self, page, tab, results):<br> |
| 242 body_child_count =&nb
sp;tab.EvaluateJavaScript(<br> |
| 243 'documen
t.querySelector('%s').children.length')<br> |
| 244 results.Add('children',&nb
sp;'count', child_count)<br> </tt></td></tr> |
| 245 <tr><td> </td> |
| 246 <td width="100%"><dl><dt>Method resolution order:</dt> |
| 247 <dd><a href="telemetry.page.page_measurement.html#PageMeasurement">PageMeasureme
nt</a></dd> |
| 248 <dd><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.Pa
geTest</a></dd> |
| 249 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 250 </dl> |
| 251 <hr> |
| 252 Methods defined here:<br> |
| 253 <dl><dt><a name="PageMeasurement-AddOutputOptions"><strong>AddOutputOptions</str
ong></a>(self, parser)</dt></dl> |
| 254 |
| 255 <dl><dt><a name="PageMeasurement-MeasurePage"><strong>MeasurePage</strong></a>(s
elf, page, tab, results)</dt><dd><tt>Override to actually measure
the page's performance.<br> |
| 256 <br> |
| 257 page is a page_set.Page<br> |
| 258 tab is an instance of telemetry.core.<a href="#Tab">Tab
</a><br> |
| 259 <br> |
| 260 Should call results.Add(name, units, value) for ea
ch result, or raise an<br> |
| 261 exception on failure. The name and units of&n
bsp;each Add() call must be<br> |
| 262 the same across all iterations. The name 'url
' must not be used.<br> |
| 263 <br> |
| 264 Prefer field names that are in accordance wit
h python variable style. E.g.<br> |
| 265 field_name.<br> |
| 266 <br> |
| 267 Put together:<br> |
| 268 <br> |
| 269 def <a href="#PageMeasurement-MeasurePage">MeasurePage</a
>(self, page, tab, results):<br> |
| 270 res = tab.EvaluateJavaScript('2+2')<br> |
| 271 if res != 4:<br> |
| 272 raise Exception('Oh, wow.')<
br> |
| 273 results.Add('two_plus_two', 'count', res
)</tt></dd></dl> |
| 274 |
| 275 <dl><dt><a name="PageMeasurement-PrepareResults"><strong>PrepareResults</strong>
</a>(self, options)</dt></dl> |
| 276 |
| 277 <dl><dt><a name="PageMeasurement-__init__"><strong>__init__</strong></a>(self, a
ction_name_to_run<font color="#909090">=''</font>, needs_browser_restart_after_e
ach_run<font color="#909090">=False</font>, discard_first_result<font color="#90
9090">=False</font>)</dt></dl> |
| 278 |
| 279 <hr> |
| 280 Data descriptors defined here:<br> |
| 281 <dl><dt><strong>output_format_choices</strong></dt> |
| 282 </dl> |
| 283 <dl><dt><strong>results_are_the_same_on_every_page</strong></dt> |
| 284 <dd><tt>By default, measurements are assumed to ou
tput the same values for every<br> |
| 285 page. This allows incremental output, for example&
nbsp;in CSV. If, however, the<br> |
| 286 measurement discovers what values it can report&nb
sp;as it goes, and those values<br> |
| 287 may vary from page to page, you need to&
nbsp;override this function and return<br> |
| 288 False. Output will not appear in this mode&nb
sp;until the entire pageset has<br> |
| 289 run.</tt></dd> |
| 290 </dl> |
| 291 <hr> |
| 292 Methods inherited from <a href="telemetry.page.page_test.html#PageTest">telemetr
y.page.page_test.PageTest</a>:<br> |
| 293 <dl><dt><a name="PageMeasurement-AddCommandLineOptions"><strong>AddCommandLineOp
tions</strong></a>(self, parser)</dt><dd><tt>Override to expose c
ommand-line options for this test.<br> |
| 294 <br> |
| 295 The provided parser is an optparse.OptionParser in
stance and accepts all<br> |
| 296 normal results. The parsed options are available&n
bsp;in Run as<br> |
| 297 self.<strong>options</strong>.</tt></dd></dl> |
| 298 |
| 299 <dl><dt><a name="PageMeasurement-CanRunForPage"><strong>CanRunForPage</strong></
a>(self, page)</dt><dd><tt>Override to customize if the 
;test can be ran for the given page.</tt></dd
></dl> |
| 300 |
| 301 <dl><dt><a name="PageMeasurement-CreatePageSet"><strong>CreatePageSet</strong></
a>(self, args, options)</dt><dd><tt>Override to make this te
st generate its own page set instead of<br> |
| 302 allowing arbitrary page sets entered from the 
;command-line.</tt></dd></dl> |
| 303 |
| 304 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptions"><strong>CustomizeBrows
erOptions</strong></a>(self, options)</dt><dd><tt>Override to add 
;test-specific options to the <a href="#BrowserOptions">Brow
serOptions</a> <a href="__builtin__.html#object">object</a></tt></dd></dl> |
| 305 |
| 306 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptionsForPage"><strong>Customi
zeBrowserOptionsForPage</strong></a>(self, page, options)</dt><dd><tt>Add o
ptions specific to the test and the given&nbs
p;page.</tt></dd></dl> |
| 307 |
| 308 <dl><dt><a name="PageMeasurement-DidNavigateToPage"><strong>DidNavigateToPage</s
trong></a>(self, page, tab)</dt><dd><tt>Override to do operations
right after the page is navigated, but
before<br> |
| 309 any waiting for completion has occurred.</tt></dd></dl> |
| 310 |
| 311 <dl><dt><a name="PageMeasurement-DidRunAction"><strong>DidRunAction</strong></a>
(self, page, tab, action)</dt><dd><tt>Override to do operations&n
bsp;after running the action on the page.</tt></dd
></dl> |
| 312 |
| 313 <dl><dt><a name="PageMeasurement-DidRunPageSet"><strong>DidRunPageSet</strong></
a>(self, tab, results)</dt><dd><tt>Override to do operations 
;after page set is completed, but before brow
ser<br> |
| 314 is torn down.</tt></dd></dl> |
| 315 |
| 316 <dl><dt><a name="PageMeasurement-DidStartHTTPServer"><strong>DidStartHTTPServer<
/strong></a>(self, tab)</dt><dd><tt>Override to do operations&nbs
p;after the HTTP server is started.</tt></dd></dl> |
| 317 |
| 318 <dl><dt><a name="PageMeasurement-NeedsBrowserRestartAfterEachRun"><strong>NeedsB
rowserRestartAfterEachRun</strong></a>(self, tab)</dt><dd><tt>Override to&n
bsp;specify browser restart after each run.</tt></dd></
dl> |
| 319 |
| 320 <dl><dt><a name="PageMeasurement-Run"><strong>Run</strong></a>(self, options, pa
ge, tab, results)</dt></dl> |
| 321 |
| 322 <dl><dt><a name="PageMeasurement-SetUpBrowser"><strong>SetUpBrowser</strong></a>
(self, browser)</dt><dd><tt>Override to customize the browse
r right after it has launched.</tt></dd></dl> |
| 323 |
| 324 <dl><dt><a name="PageMeasurement-WillNavigateToPage"><strong>WillNavigateToPage<
/strong></a>(self, page, tab)</dt><dd><tt>Override to do operatio
ns before the page is navigated.</tt></dd></dl> |
| 325 |
| 326 <dl><dt><a name="PageMeasurement-WillRunAction"><strong>WillRunAction</strong></
a>(self, page, tab, action)</dt><dd><tt>Override to do operations
before running the action on the page.</tt><
/dd></dl> |
| 327 |
| 328 <dl><dt><a name="PageMeasurement-WillRunPageSet"><strong>WillRunPageSet</strong>
</a>(self, tab)</dt><dd><tt>Override to do operations before
the page set is navigated.</tt></dd></dl> |
| 329 |
| 330 <hr> |
| 331 Data descriptors inherited from <a href="telemetry.page.page_test.html#PageTest"
>telemetry.page.page_test.PageTest</a>:<br> |
| 332 <dl><dt><strong>__dict__</strong></dt> |
| 333 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> |
| 334 </dl> |
| 335 <dl><dt><strong>__weakref__</strong></dt> |
| 336 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> |
| 337 </dl> |
| 338 <dl><dt><strong>action_name_to_run</strong></dt> |
| 339 </dl> |
| 340 <dl><dt><strong>discard_first_result</strong></dt> |
| 341 <dd><tt>When set to True, the first run of&nb
sp;the test is discarded. This is<br> |
| 342 useful for cases where it's desirable to have
some test resource cached so<br> |
| 343 the first run of the test can warm thing
s up.</tt></dd> |
| 344 </dl> |
| 345 </td></tr></table> <p> |
| 346 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 347 <tr bgcolor="#ffc8d8"> |
| 348 <td colspan=3 valign=bottom> <br> |
| 349 <font color="#000000" face="helvetica, arial"><a name="Tab">class <strong>Tab</s
trong></a>(<a href="telemetry.core.web_contents.html#WebContents">telemetry.core
.web_contents.WebContents</a>)</font></td></tr> |
| 350 |
| 351 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 352 <td colspan=2><tt>Represents a tab in the browser<br> |
| 353 <br> |
| 354 The important parts of the <a href="#Tab">Tab</a>
<a href="__builtin__.html#object">object</a> are in the runt
ime and page objects.<br> |
| 355 E.g.:<br> |
| 356 # Navigates the tab to a g
iven url.<br> |
| 357 tab.<a href="#Tab-Navigate">Navigate</a>('<a href="http:
//www.google.com/">http://www.google.com/</a>')<br> |
| 358 <br> |
| 359 # Evaluates 1+1 in the tab's&nb
sp;JavaScript context.<br> |
| 360 tab.Evaluate('1+1')<br> </tt></td></tr> |
| 361 <tr><td> </td> |
| 362 <td width="100%"><dl><dt>Method resolution order:</dt> |
| 363 <dd><a href="telemetry.core.tab.html#Tab">Tab</a></dd> |
| 364 <dd><a href="telemetry.core.web_contents.html#WebContents">telemetry.core.web_co
ntents.WebContents</a></dd> |
| 365 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 366 </dl> |
| 367 <hr> |
| 368 Methods defined here:<br> |
| 369 <dl><dt><a name="Tab-Activate"><strong>Activate</strong></a>(self)</dt><dd><tt>B
rings this tab to the foreground asynchronously.<b
r> |
| 370 <br> |
| 371 Not all browsers or browser versions support
this method.<br> |
| 372 Be sure to check browser.supports_tab_control.<br> |
| 373 <br> |
| 374 Please note: this is asynchronous. There is a
delay between this call<br> |
| 375 and the page's documentVisibilityState becoming 'visibl
e', and yet more<br> |
| 376 delay until the actual tab is visible to 
;the user. None of these delays<br> |
| 377 are included in this call.</tt></dd></dl> |
| 378 |
| 379 <dl><dt><a name="Tab-CollectGarbage"><strong>CollectGarbage</strong></a>(self)</
dt></dl> |
| 380 |
| 381 <dl><dt><a name="Tab-GetCookieByName"><strong>GetCookieByName</strong></a>(self,
name, timeout<font color="#909090">=60</font>)</dt><dd><tt>Returns the&nbs
p;value of the cookie by the given |name|.</t
t></dd></dl> |
| 382 |
| 383 <dl><dt><a name="Tab-Navigate"><strong>Navigate</strong></a>(self, url, script_t
o_evaluate_on_commit<font color="#909090">=None</font>, timeout<font color="#909
090">=60</font>)</dt><dd><tt>Navigates to url.<br> |
| 384 <br> |
| 385 If |script_to_evaluate_on_commit| is given, the script&
nbsp;source string will be<br> |
| 386 evaluated when the navigation is committed. This&n
bsp;is after the context of<br> |
| 387 the page exists, but before any script on&nbs
p;the page itself has executed.</tt></dd></dl> |
| 388 |
| 389 <dl><dt><a name="Tab-PerformActionAndWaitForNavigate"><strong>PerformActionAndWa
itForNavigate</strong></a>(self, action_function, timeout<font color="#909090">=
60</font>)</dt><dd><tt>Executes action_function, and waits f
or the navigation to complete.<br> |
| 390 <br> |
| 391 action_function must be a Python function that&nbs
p;results in a navigation.<br> |
| 392 This function returns when the navigation is
complete or when<br> |
| 393 the timeout has been exceeded.</tt></dd></dl> |
| 394 |
| 395 <dl><dt><a name="Tab-Screenshot"><strong>Screenshot</strong></a>(self, timeout<f
ont color="#909090">=60</font>)</dt><dd><tt>Capture a screenshot
of the window for rendering validation</tt></dd></dl> |
| 396 |
| 397 <dl><dt><a name="Tab-__del__"><strong>__del__</strong></a>(self)</dt></dl> |
| 398 |
| 399 <dl><dt><a name="Tab-__init__"><strong>__init__</strong></a>(self, inspector_bac
kend)</dt></dl> |
| 400 |
| 401 <hr> |
| 402 Data descriptors defined here:<br> |
| 403 <dl><dt><strong>browser</strong></dt> |
| 404 <dd><tt>The browser in which this tab resides.</tt
></dd> |
| 405 </dl> |
| 406 <dl><dt><strong>dom_stats</strong></dt> |
| 407 <dd><tt>A dictionary populated with measured DOM s
tatistics.<br> |
| 408 <br> |
| 409 Currently this dictionary contains:<br> |
| 410 {<br> |
| 411 'document_count': integer,<br> |
| 412 'node_count': integer,<br> |
| 413 'event_listener_count': integer<br> |
| 414 }</tt></dd> |
| 415 </dl> |
| 416 <dl><dt><strong>screenshot_supported</strong></dt> |
| 417 <dd><tt>True if the browser instance is capable&nb
sp;of capturing screenshots</tt></dd> |
| 418 </dl> |
| 419 <dl><dt><strong>url</strong></dt> |
| 420 </dl> |
| 421 <hr> |
| 422 Methods inherited from <a href="telemetry.core.web_contents.html#WebContents">te
lemetry.core.web_contents.WebContents</a>:<br> |
| 423 <dl><dt><a name="Tab-Close"><strong>Close</strong></a>(self)</dt><dd><tt>Closes&
nbsp;this page.<br> |
| 424 <br> |
| 425 Not all browsers or browser versions support
this method.<br> |
| 426 Be sure to check browser.supports_tab_control.</tt></dd></dl
> |
| 427 |
| 428 <dl><dt><a name="Tab-Disconnect"><strong>Disconnect</strong></a>(self)</dt></dl> |
| 429 |
| 430 <dl><dt><a name="Tab-EvaluateJavaScript"><strong>EvaluateJavaScript</strong></a>
(self, expr, timeout<font color="#909090">=60</font>)</dt><dd><tt>Evalutes
expr in JavaScript and returns the JSONized r
esult.<br> |
| 431 <br> |
| 432 Consider using ExecuteJavaScript for cases where t
he result of the<br> |
| 433 expression is not needed.<br> |
| 434 <br> |
| 435 If evaluation throws in JavaScript, a Python
EvaluateException will<br> |
| 436 be raised.<br> |
| 437 <br> |
| 438 If the result of the evaluation cannot be&nbs
p;JSONized, then an<br> |
| 439 EvaluationException will be raised.</tt></dd></dl> |
| 440 |
| 441 <dl><dt><a name="Tab-ExecuteJavaScript"><strong>ExecuteJavaScript</strong></a>(s
elf, expr, timeout<font color="#909090">=60</font>)</dt><dd><tt>Executes ex
pr in JavaScript. Does not return the result.
<br> |
| 442 <br> |
| 443 If the expression failed to evaluate, EvaluateExce
ption will be raised.</tt></dd></dl> |
| 444 |
| 445 <dl><dt><a name="Tab-StartTimelineRecording"><strong>StartTimelineRecording</str
ong></a>(self)</dt></dl> |
| 446 |
| 447 <dl><dt><a name="Tab-StopTimelineRecording"><strong>StopTimelineRecording</stron
g></a>(self)</dt></dl> |
| 448 |
| 449 <dl><dt><a name="Tab-WaitForDocumentReadyStateToBeComplete"><strong>WaitForDocum
entReadyStateToBeComplete</strong></a>(self, timeout<font color="#909090">=60</f
ont>)</dt></dl> |
| 450 |
| 451 <dl><dt><a name="Tab-WaitForDocumentReadyStateToBeInteractiveOrBetter"><strong>W
aitForDocumentReadyStateToBeInteractiveOrBetter</strong></a>(self, timeout<font
color="#909090">=60</font>)</dt></dl> |
| 452 |
| 453 <hr> |
| 454 Data descriptors inherited from <a href="telemetry.core.web_contents.html#WebCon
tents">telemetry.core.web_contents.WebContents</a>:<br> |
| 455 <dl><dt><strong>__dict__</strong></dt> |
| 456 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> |
| 457 </dl> |
| 458 <dl><dt><strong>__weakref__</strong></dt> |
| 459 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> |
| 460 </dl> |
| 461 <dl><dt><strong>message_output_stream</strong></dt> |
| 462 </dl> |
| 463 <dl><dt><strong>timeline_model</strong></dt> |
| 464 </dl> |
| 465 </td></tr></table></td></tr></table><p> |
| 466 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 467 <tr bgcolor="#eeaa77"> |
| 468 <td colspan=3 valign=bottom> <br> |
| 469 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></b
ig></font></td></tr> |
| 470 |
| 471 <tr><td bgcolor="#eeaa77"><tt> </tt></td><td>
</td> |
| 472 <td width="100%"><dl><dt><a name="-RunPage"><strong>RunPage</strong></a> = Run(t
est, page_set, options)</dt><dd><tt>Runs a given test agains
t a given page_set with the given options.</t
t></dd></dl> |
| 473 </td></tr></table><p> |
| 474 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 475 <tr bgcolor="#55aa55"> |
| 476 <td colspan=3 valign=bottom> <br> |
| 477 <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></
font></td></tr> |
| 478 |
| 479 <tr><td bgcolor="#55aa55"><tt> </tt></td><td>
</td> |
| 480 <td width="100%"><strong>__all__</strong> = ['Browser', 'BrowserOptions', 'PageM
easurement', 'RunPage', 'Tab']</td></tr></table> |
| 481 </body></html> |
| OLD | NEW |