blob: 2260808e78aa62965e48dd885e047c31a141964e [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module telemetry.page.page_measurement</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<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>.page_measurement</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/page/page_measurement.py">telemetry/page/page_measurement.py</a></font></td></tr></table>
<p><tt>#&nbsp;Copyright&nbsp;(c)&nbsp;2012&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
#&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>
#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.page.page_test.html">telemetry.page.page_test</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#Failure">telemetry.page.page_test.Failure</a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#MeasurementFailure">MeasurementFailure</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>(<a href="telemetry.core.command_line.html#ArgumentHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#PageMeasurement">PageMeasurement</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="MeasurementFailure">class <strong>MeasurementFailure</strong></a>(<a href="telemetry.page.page_test.html#Failure">telemetry.page.page_test.Failure</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Exception&nbsp;that&nbsp;can&nbsp;be&nbsp;thrown&nbsp;from&nbsp;MeasurePage&nbsp;to&nbsp;indicate&nbsp;an&nbsp;undesired&nbsp;but<br>
designed-for&nbsp;problem.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="telemetry.page.page_measurement.html#MeasurementFailure">MeasurementFailure</a></dd>
<dd><a href="telemetry.page.page_test.html#Failure">telemetry.page.page_test.Failure</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Data descriptors inherited from <a href="telemetry.page.page_test.html#Failure">telemetry.page.page_test.Failure</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="MeasurementFailure-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#MeasurementFailure-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;object&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>
<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="MeasurementFailure-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>
<dl><dt><a name="MeasurementFailure-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>
<dl><dt><a name="MeasurementFailure-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>
<dl><dt><a name="MeasurementFailure-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>
<dl><dt><a name="MeasurementFailure-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
<dl><dt><a name="MeasurementFailure-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>
<dl><dt><a name="MeasurementFailure-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>
<dl><dt><a name="MeasurementFailure-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
<dl><dt><a name="MeasurementFailure-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#MeasurementFailure-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>
<dl><dt><a name="MeasurementFailure-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="PageMeasurement">class <strong>PageMeasurement</strong></a>(<a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Glue&nbsp;code&nbsp;for&nbsp;running&nbsp;a&nbsp;measurement&nbsp;across&nbsp;a&nbsp;set&nbsp;of&nbsp;pages.<br>
&nbsp;<br>
To&nbsp;use&nbsp;this,&nbsp;subclass&nbsp;from&nbsp;the&nbsp;measurement&nbsp;and&nbsp;override&nbsp;MeasurePage.&nbsp;For<br>
example:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;class&nbsp;BodyChildElementMeasurement(<a href="#PageMeasurement">PageMeasurement</a>):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def&nbsp;<a href="#PageMeasurement-MeasurePage">MeasurePage</a>(self,&nbsp;page,&nbsp;tab,&nbsp;results):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body_child_count&nbsp;=&nbsp;tab.EvaluateJavaScript(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'document.body.children.length')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;results.Add('body_children',&nbsp;'count',&nbsp;body_child_count)<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;if&nbsp;__name__&nbsp;==&nbsp;'__main__':<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page_measurement.Main(BodyChildElementMeasurement())<br>
&nbsp;<br>
To&nbsp;add&nbsp;test-specific&nbsp;options:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;class&nbsp;BodyChildElementMeasurement(<a href="#PageMeasurement">PageMeasurement</a>):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def&nbsp;<a href="#PageMeasurement-AddCommandLineArgs">AddCommandLineArgs</a>(parser):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parser.add_option('--element',&nbsp;action='store',&nbsp;default='body')<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;def&nbsp;<a href="#PageMeasurement-MeasurePage">MeasurePage</a>(self,&nbsp;page,&nbsp;tab,&nbsp;results):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;body_child_count&nbsp;=&nbsp;tab.EvaluateJavaScript(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'document.querySelector('%s').children.length')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;results.Add('children',&nbsp;'count',&nbsp;child_count)<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="telemetry.page.page_measurement.html#PageMeasurement">PageMeasurement</a></dd>
<dd><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a></dd>
<dd><a href="telemetry.core.command_line.html#ArgumentHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="PageMeasurement-MeasurePage"><strong>MeasurePage</strong></a>(self, page, tab, results)</dt><dd><tt>Override&nbsp;to&nbsp;actually&nbsp;measure&nbsp;the&nbsp;page's&nbsp;performance.<br>
&nbsp;<br>
page&nbsp;is&nbsp;a&nbsp;page_set.Page<br>
tab&nbsp;is&nbsp;an&nbsp;instance&nbsp;of&nbsp;telemetry.core.Tab<br>
&nbsp;<br>
Should&nbsp;call&nbsp;results.Add(name,&nbsp;units,&nbsp;value)&nbsp;for&nbsp;each&nbsp;result,&nbsp;or&nbsp;raise&nbsp;an<br>
exception&nbsp;on&nbsp;failure.&nbsp;The&nbsp;name&nbsp;and&nbsp;units&nbsp;of&nbsp;each&nbsp;Add()&nbsp;call&nbsp;must&nbsp;be<br>
the&nbsp;same&nbsp;across&nbsp;all&nbsp;iterations.&nbsp;The&nbsp;name&nbsp;'url'&nbsp;must&nbsp;not&nbsp;be&nbsp;used.<br>
&nbsp;<br>
Prefer&nbsp;field&nbsp;names&nbsp;that&nbsp;are&nbsp;in&nbsp;accordance&nbsp;with&nbsp;python&nbsp;variable&nbsp;style.&nbsp;E.g.<br>
field_name.<br>
&nbsp;<br>
Put&nbsp;together:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;def&nbsp;<a href="#PageMeasurement-MeasurePage">MeasurePage</a>(self,&nbsp;page,&nbsp;tab,&nbsp;results):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;res&nbsp;=&nbsp;tab.EvaluateJavaScript('2+2')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;res&nbsp;!=&nbsp;4:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise&nbsp;Exception('Oh,&nbsp;wow.')<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;results.Add('two_plus_two',&nbsp;'count',&nbsp;res)</tt></dd></dl>
<dl><dt><a name="PageMeasurement-__init__"><strong>__init__</strong></a>(self, action_name_to_run<font color="#909090">=''</font>, needs_browser_restart_after_each_page<font color="#909090">=False</font>, discard_first_result<font color="#909090">=False</font>, clear_cache_before_each_run<font color="#909090">=False</font>)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>results_are_the_same_on_every_page</strong></dt>
<dd><tt>By&nbsp;default,&nbsp;measurements&nbsp;are&nbsp;assumed&nbsp;to&nbsp;output&nbsp;the&nbsp;same&nbsp;values&nbsp;for&nbsp;every<br>
page.&nbsp;This&nbsp;allows&nbsp;incremental&nbsp;output,&nbsp;for&nbsp;example&nbsp;in&nbsp;CSV.&nbsp;If,&nbsp;however,&nbsp;the<br>
measurement&nbsp;discovers&nbsp;what&nbsp;values&nbsp;it&nbsp;can&nbsp;report&nbsp;as&nbsp;it&nbsp;goes,&nbsp;and&nbsp;those&nbsp;values<br>
may&nbsp;vary&nbsp;from&nbsp;page&nbsp;to&nbsp;page,&nbsp;you&nbsp;need&nbsp;to&nbsp;override&nbsp;this&nbsp;function&nbsp;and&nbsp;return<br>
False.&nbsp;Output&nbsp;will&nbsp;not&nbsp;appear&nbsp;in&nbsp;this&nbsp;mode&nbsp;until&nbsp;the&nbsp;entire&nbsp;pageset&nbsp;has<br>
run.</tt></dd>
</dl>
<hr>
Methods inherited from <a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>:<br>
<dl><dt><a name="PageMeasurement-CanRunForPage"><strong>CanRunForPage</strong></a>(self, page)</dt><dd><tt>Override&nbsp;to&nbsp;customize&nbsp;if&nbsp;the&nbsp;test&nbsp;can&nbsp;be&nbsp;ran&nbsp;for&nbsp;the&nbsp;given&nbsp;page.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-CleanUpAfterPage"><strong>CleanUpAfterPage</strong></a>(self, page, tab)</dt><dd><tt>Called&nbsp;after&nbsp;the&nbsp;test&nbsp;run&nbsp;method&nbsp;was&nbsp;run,&nbsp;even&nbsp;if&nbsp;it&nbsp;failed.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-CreateExpectations"><strong>CreateExpectations</strong></a>(self, page_set)</dt><dd><tt>Override&nbsp;to&nbsp;make&nbsp;this&nbsp;test&nbsp;generate&nbsp;its&nbsp;own&nbsp;expectations&nbsp;instead&nbsp;of<br>
any&nbsp;that&nbsp;may&nbsp;have&nbsp;been&nbsp;defined&nbsp;in&nbsp;the&nbsp;page&nbsp;set.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-CreatePageSet"><strong>CreatePageSet</strong></a>(self, args, options)</dt><dd><tt>Override&nbsp;to&nbsp;make&nbsp;this&nbsp;test&nbsp;generate&nbsp;its&nbsp;own&nbsp;page&nbsp;set&nbsp;instead&nbsp;of<br>
allowing&nbsp;arbitrary&nbsp;page&nbsp;sets&nbsp;entered&nbsp;from&nbsp;the&nbsp;command-line.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-CustomizeBrowserOptions"><strong>CustomizeBrowserOptions</strong></a>(self, options)</dt><dd><tt>Override&nbsp;to&nbsp;add&nbsp;test-specific&nbsp;options&nbsp;to&nbsp;the&nbsp;BrowserOptions&nbsp;object</tt></dd></dl>
<dl><dt><a name="PageMeasurement-CustomizeBrowserOptionsForPageSet"><strong>CustomizeBrowserOptionsForPageSet</strong></a>(self, page_set, options)</dt><dd><tt>Set&nbsp;options&nbsp;required&nbsp;for&nbsp;this&nbsp;page&nbsp;set.<br>
&nbsp;<br>
These&nbsp;options&nbsp;will&nbsp;be&nbsp;used&nbsp;every&nbsp;time&nbsp;the&nbsp;browser&nbsp;is&nbsp;started&nbsp;while&nbsp;running<br>
this&nbsp;page&nbsp;set.&nbsp;They&nbsp;may,&nbsp;however,&nbsp;be&nbsp;further&nbsp;modified&nbsp;by<br>
CustomizeBrowserOptionsForSinglePage&nbsp;or&nbsp;by&nbsp;the&nbsp;profiler.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-CustomizeBrowserOptionsForSinglePage"><strong>CustomizeBrowserOptionsForSinglePage</strong></a>(self, page, options)</dt><dd><tt>Set&nbsp;options&nbsp;specific&nbsp;to&nbsp;the&nbsp;test&nbsp;and&nbsp;the&nbsp;given&nbsp;page.<br>
&nbsp;<br>
This&nbsp;will&nbsp;be&nbsp;called&nbsp;with&nbsp;the&nbsp;current&nbsp;page&nbsp;when&nbsp;the&nbsp;browser&nbsp;is&nbsp;(re)started.<br>
Changing&nbsp;options&nbsp;at&nbsp;this&nbsp;point&nbsp;only&nbsp;makes&nbsp;sense&nbsp;if&nbsp;the&nbsp;browser&nbsp;is&nbsp;being<br>
restarted&nbsp;for&nbsp;each&nbsp;page.&nbsp;Note&nbsp;that&nbsp;if&nbsp;page&nbsp;has&nbsp;a&nbsp;startup_url,&nbsp;the&nbsp;browser<br>
will&nbsp;always&nbsp;be&nbsp;restarted&nbsp;for&nbsp;each&nbsp;run.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-DidNavigateToPage"><strong>DidNavigateToPage</strong></a>(self, page, tab)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;right&nbsp;after&nbsp;the&nbsp;page&nbsp;is&nbsp;navigated&nbsp;and&nbsp;after<br>
all&nbsp;waiting&nbsp;for&nbsp;completion&nbsp;has&nbsp;occurred.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-DidRunAction"><strong>DidRunAction</strong></a>(self, page, tab, action)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;after&nbsp;running&nbsp;the&nbsp;action&nbsp;on&nbsp;the&nbsp;page.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-DidRunActions"><strong>DidRunActions</strong></a>(self, page, tab)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;after&nbsp;running&nbsp;the&nbsp;actions&nbsp;on&nbsp;the&nbsp;page.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-DidRunPageRepeats"><strong>DidRunPageRepeats</strong></a>(self, page)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;after&nbsp;each&nbsp;page&nbsp;is&nbsp;iterated&nbsp;over.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-DidRunTest"><strong>DidRunTest</strong></a>(self, browser, results)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;after&nbsp;all&nbsp;page&nbsp;set(s)&nbsp;are&nbsp;completed.<br>
&nbsp;<br>
This&nbsp;will&nbsp;occur&nbsp;before&nbsp;the&nbsp;browser&nbsp;is&nbsp;torn&nbsp;down.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-DidStartBrowser"><strong>DidStartBrowser</strong></a>(self, browser)</dt><dd><tt>Override&nbsp;to&nbsp;customize&nbsp;the&nbsp;browser&nbsp;right&nbsp;after&nbsp;it&nbsp;has&nbsp;launched.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-DidStartHTTPServer"><strong>DidStartHTTPServer</strong></a>(self, tab)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;after&nbsp;the&nbsp;HTTP&nbsp;server&nbsp;is&nbsp;started.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-IsExiting"><strong>IsExiting</strong></a>(self)</dt></dl>
<dl><dt><a name="PageMeasurement-RequestExit"><strong>RequestExit</strong></a>(self)</dt></dl>
<dl><dt><a name="PageMeasurement-RestartBrowserBeforeEachPage"><strong>RestartBrowserBeforeEachPage</strong></a>(self)</dt><dd><tt>Should&nbsp;the&nbsp;browser&nbsp;be&nbsp;restarted&nbsp;for&nbsp;the&nbsp;page?<br>
&nbsp;<br>
This&nbsp;returns&nbsp;true&nbsp;if&nbsp;the&nbsp;test&nbsp;needs&nbsp;to&nbsp;unconditionally&nbsp;restart&nbsp;the<br>
browser&nbsp;for&nbsp;each&nbsp;page.&nbsp;It&nbsp;may&nbsp;be&nbsp;called&nbsp;before&nbsp;the&nbsp;browser&nbsp;is&nbsp;started.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-Run"><strong>Run</strong></a>(self, page, tab, results)</dt></dl>
<dl><dt><a name="PageMeasurement-RunNavigateSteps"><strong>RunNavigateSteps</strong></a>(self, page, tab)</dt><dd><tt>Navigates&nbsp;the&nbsp;tab&nbsp;to&nbsp;the&nbsp;page&nbsp;URL&nbsp;attribute.<br>
&nbsp;<br>
Runs&nbsp;the&nbsp;'navigate_steps'&nbsp;page&nbsp;attribute&nbsp;as&nbsp;a&nbsp;compound&nbsp;action.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-StopBrowserAfterPage"><strong>StopBrowserAfterPage</strong></a>(self, browser, page)</dt><dd><tt>Should&nbsp;the&nbsp;browser&nbsp;be&nbsp;stopped&nbsp;after&nbsp;the&nbsp;page&nbsp;is&nbsp;run?<br>
&nbsp;<br>
This&nbsp;is&nbsp;called&nbsp;after&nbsp;a&nbsp;page&nbsp;is&nbsp;run&nbsp;to&nbsp;decide&nbsp;whether&nbsp;the&nbsp;browser&nbsp;needs&nbsp;to<br>
be&nbsp;stopped&nbsp;to&nbsp;clean&nbsp;up&nbsp;its&nbsp;state.&nbsp;If&nbsp;it&nbsp;is&nbsp;stopped,&nbsp;then&nbsp;it&nbsp;will&nbsp;be<br>
restarted&nbsp;to&nbsp;run&nbsp;the&nbsp;next&nbsp;page.<br>
&nbsp;<br>
A&nbsp;test&nbsp;that&nbsp;overrides&nbsp;this&nbsp;can&nbsp;look&nbsp;at&nbsp;both&nbsp;the&nbsp;page&nbsp;and&nbsp;the&nbsp;browser&nbsp;to<br>
decide&nbsp;whether&nbsp;it&nbsp;needs&nbsp;to&nbsp;stop&nbsp;the&nbsp;browser.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-TabForPage"><strong>TabForPage</strong></a>(self, page, browser)</dt><dd><tt>Override&nbsp;to&nbsp;select&nbsp;a&nbsp;different&nbsp;tab&nbsp;for&nbsp;the&nbsp;page.&nbsp;&nbsp;For&nbsp;instance,&nbsp;to<br>
create&nbsp;a&nbsp;new&nbsp;tab&nbsp;for&nbsp;every&nbsp;page,&nbsp;return&nbsp;browser.tabs.New().</tt></dd></dl>
<dl><dt><a name="PageMeasurement-ValidatePageSet"><strong>ValidatePageSet</strong></a>(self, page_set)</dt><dd><tt>Override&nbsp;to&nbsp;examine&nbsp;the&nbsp;page&nbsp;set&nbsp;before&nbsp;the&nbsp;test&nbsp;run.&nbsp;&nbsp;Useful&nbsp;for<br>
example&nbsp;to&nbsp;validate&nbsp;that&nbsp;the&nbsp;pageset&nbsp;can&nbsp;be&nbsp;used&nbsp;with&nbsp;the&nbsp;test.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-WillNavigateToPage"><strong>WillNavigateToPage</strong></a>(self, page, tab)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;before&nbsp;the&nbsp;page&nbsp;is&nbsp;navigated,&nbsp;notably&nbsp;Telemetry<br>
will&nbsp;already&nbsp;have&nbsp;performed&nbsp;the&nbsp;following&nbsp;operations&nbsp;on&nbsp;the&nbsp;browser&nbsp;before<br>
calling&nbsp;this&nbsp;function:<br>
*&nbsp;Ensure&nbsp;only&nbsp;one&nbsp;tab&nbsp;is&nbsp;open.<br>
*&nbsp;Call&nbsp;WaitForDocumentReadyStateToComplete&nbsp;on&nbsp;the&nbsp;tab.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-WillRunAction"><strong>WillRunAction</strong></a>(self, page, tab, action)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;before&nbsp;running&nbsp;the&nbsp;action&nbsp;on&nbsp;the&nbsp;page.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-WillRunActions"><strong>WillRunActions</strong></a>(self, page, tab)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;before&nbsp;running&nbsp;the&nbsp;actions&nbsp;on&nbsp;the&nbsp;page.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-WillRunPageRepeats"><strong>WillRunPageRepeats</strong></a>(self, page)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;before&nbsp;each&nbsp;page&nbsp;is&nbsp;iterated&nbsp;over.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-WillRunTest"><strong>WillRunTest</strong></a>(self, options)</dt><dd><tt>Override&nbsp;to&nbsp;do&nbsp;operations&nbsp;before&nbsp;the&nbsp;page&nbsp;set(s)&nbsp;are&nbsp;navigated.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-WillStartBrowser"><strong>WillStartBrowser</strong></a>(self, browser)</dt><dd><tt>Override&nbsp;to&nbsp;manipulate&nbsp;the&nbsp;browser&nbsp;environment&nbsp;before&nbsp;it&nbsp;launches.</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>:<br>
<dl><dt><strong>action_name_to_run</strong></dt>
</dl>
<dl><dt><strong>attempts</strong></dt>
<dd><tt>Maximum&nbsp;number&nbsp;of&nbsp;times&nbsp;test&nbsp;will&nbsp;be&nbsp;attempted.</tt></dd>
</dl>
<dl><dt><strong>clear_cache_before_each_run</strong></dt>
<dd><tt>When&nbsp;set&nbsp;to&nbsp;True,&nbsp;the&nbsp;browser's&nbsp;disk&nbsp;and&nbsp;memory&nbsp;cache&nbsp;will&nbsp;be&nbsp;cleared<br>
before&nbsp;each&nbsp;run.</tt></dd>
</dl>
<dl><dt><strong>close_tabs_before_run</strong></dt>
<dd><tt>When&nbsp;set&nbsp;to&nbsp;True,&nbsp;all&nbsp;tabs&nbsp;are&nbsp;closed&nbsp;before&nbsp;running&nbsp;the&nbsp;test&nbsp;for&nbsp;the<br>
first&nbsp;time.</tt></dd>
</dl>
<dl><dt><strong>discard_first_result</strong></dt>
<dd><tt>When&nbsp;set&nbsp;to&nbsp;True,&nbsp;the&nbsp;first&nbsp;run&nbsp;of&nbsp;the&nbsp;test&nbsp;is&nbsp;discarded.&nbsp;&nbsp;This&nbsp;is<br>
useful&nbsp;for&nbsp;cases&nbsp;where&nbsp;it's&nbsp;desirable&nbsp;to&nbsp;have&nbsp;some&nbsp;test&nbsp;resource&nbsp;cached&nbsp;so<br>
the&nbsp;first&nbsp;run&nbsp;of&nbsp;the&nbsp;test&nbsp;can&nbsp;warm&nbsp;things&nbsp;up.</tt></dd>
</dl>
<dl><dt><strong>max_errors</strong></dt>
<dd><tt>Maximum&nbsp;number&nbsp;of&nbsp;errors&nbsp;allowed&nbsp;for&nbsp;the&nbsp;page&nbsp;set.</tt></dd>
</dl>
<dl><dt><strong>max_failures</strong></dt>
<dd><tt>Maximum&nbsp;number&nbsp;of&nbsp;failures&nbsp;allowed&nbsp;for&nbsp;the&nbsp;page&nbsp;set.</tt></dd>
</dl>
<hr>
Class methods inherited from <a href="telemetry.core.command_line.html#ArgumentHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>:<br>
<dl><dt><a name="PageMeasurement-AddCommandLineArgs"><strong>AddCommandLineArgs</strong></a>(cls, parser)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Override&nbsp;to&nbsp;accept&nbsp;custom&nbsp;command-line&nbsp;arguments.</tt></dd></dl>
<dl><dt><a name="PageMeasurement-ProcessCommandLineArgs"><strong>ProcessCommandLineArgs</strong></a>(cls, parser, args)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Override&nbsp;to&nbsp;process&nbsp;command-line&nbsp;arguments.<br>
&nbsp;<br>
We&nbsp;pass&nbsp;in&nbsp;parser&nbsp;so&nbsp;we&nbsp;can&nbsp;call&nbsp;parser.error().</tt></dd></dl>
<hr>
Data descriptors inherited from <a href="telemetry.core.command_line.html#ArgumentHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table></td></tr></table>
</body></html>