1
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3<html><head><title>Python: module telemetry.record_wpr</title>
4<meta charset="utf-8">
5</head><body bgcolor="#f0f0f8">
6
7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
8<tr bgcolor="#7799ee">
9<td valign=bottom>&nbsp;<br>
10<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.record_wpr</strong></big></big></font></td
11><td align=right valign=bottom
12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/record_wpr.py">telemetry/record_wpr.py</a></font></td></tr></table>
13    <p><tt>#&nbsp;Copyright&nbsp;2012&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
14#&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>
15#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
16<p>
17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
18<tr bgcolor="#aa55cc">
19<td colspan=3 valign=bottom>&nbsp;<br>
20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
21
22<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="argparse.html">argparse</a><br>
24<a href="telemetry.benchmark.html">telemetry.benchmark</a><br>
25<a href="telemetry.internal.util.binary_manager.html">telemetry.internal.util.binary_manager</a><br>
26<a href="telemetry.internal.browser.browser_options.html">telemetry.internal.browser.browser_options</a><br>
27</td><td width="25%" valign=top><a href="telemetry.internal.util.command_line.html">telemetry.internal.util.command_line</a><br>
28<a href="telemetry.core.discover.html">telemetry.core.discover</a><br>
29<a href="logging.html">logging</a><br>
30<a href="telemetry.page.page_test.html">telemetry.page.page_test</a><br>
31</td><td width="25%" valign=top><a href="telemetry.internal.results.results_options.html">telemetry.internal.results.results_options</a><br>
32<a href="telemetry.story.html">telemetry.story</a><br>
33<a href="telemetry.internal.story_runner.html">telemetry.internal.story_runner</a><br>
34<a href="sys.html">sys</a><br>
35</td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.core.util</a><br>
36<a href="telemetry.util.wpr_modes.html">telemetry.util.wpr_modes</a><br>
37</td></tr></table></td></tr></table><p>
38<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
39<tr bgcolor="#ee77aa">
40<td colspan=3 valign=bottom>&nbsp;<br>
41<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
42
43<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
44<td width="100%"><dl>
45<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
46</font></dt><dd>
47<dl>
48<dt><font face="helvetica, arial"><a href="telemetry.record_wpr.html#WprRecorder">WprRecorder</a>
49</font></dt></dl>
50</dd>
51<dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
52</font></dt><dd>
53<dl>
54<dt><font face="helvetica, arial"><a href="telemetry.record_wpr.html#RecorderPageTest">RecorderPageTest</a>
55</font></dt></dl>
56</dd>
57</dl>
58 <p>
59<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
60<tr bgcolor="#ffc8d8">
61<td colspan=3 valign=bottom>&nbsp;<br>
62<font color="#000000" face="helvetica, arial"><a name="RecorderPageTest">class <strong>RecorderPageTest</strong></a>(<a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>)</font></td></tr>
63
64<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
65<td width="100%"><dl><dt>Method resolution order:</dt>
66<dd><a href="telemetry.record_wpr.html#RecorderPageTest">RecorderPageTest</a></dd>
67<dd><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a></dd>
68<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
69</dl>
70<hr>
71Methods defined here:<br>
72<dl><dt><a name="RecorderPageTest-CleanUpAfterPage"><strong>CleanUpAfterPage</strong></a>(self, page, tab)</dt></dl>
73
74<dl><dt><a name="RecorderPageTest-CustomizeBrowserOptions"><strong>CustomizeBrowserOptions</strong></a>(self, options)</dt></dl>
75
76<dl><dt><a name="RecorderPageTest-DidNavigateToPage"><strong>DidNavigateToPage</strong></a>(self, page, tab)</dt></dl>
77
78<dl><dt><a name="RecorderPageTest-DidStartBrowser"><strong>DidStartBrowser</strong></a>(self, browser)</dt></dl>
79
80<dl><dt><a name="RecorderPageTest-RunNavigateSteps"><strong>RunNavigateSteps</strong></a>(self, page, tab)</dt></dl>
81
82<dl><dt><a name="RecorderPageTest-ValidateAndMeasurePage"><strong>ValidateAndMeasurePage</strong></a>(self, page, tab, results)</dt></dl>
83
84<dl><dt><a name="RecorderPageTest-WillNavigateToPage"><strong>WillNavigateToPage</strong></a>(self, page, tab)</dt><dd><tt>Override&nbsp;to&nbsp;ensure&nbsp;all&nbsp;resources&nbsp;are&nbsp;fetched&nbsp;from&nbsp;network.</tt></dd></dl>
85
86<dl><dt><a name="RecorderPageTest-WillStartBrowser"><strong>WillStartBrowser</strong></a>(self, browser)</dt></dl>
87
88<dl><dt><a name="RecorderPageTest-__init__"><strong>__init__</strong></a>(self)</dt></dl>
89
90<hr>
91Methods inherited from <a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>:<br>
92<dl><dt><a name="RecorderPageTest-DidRunPage"><strong>DidRunPage</strong></a>(self, platform)</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>
93
94<dl><dt><a name="RecorderPageTest-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>
95&nbsp;<br>
96This&nbsp;returns&nbsp;true&nbsp;if&nbsp;the&nbsp;test&nbsp;needs&nbsp;to&nbsp;unconditionally&nbsp;restart&nbsp;the<br>
97browser&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>
98
99<dl><dt><a name="RecorderPageTest-SetOptions"><strong>SetOptions</strong></a>(self, options)</dt><dd><tt>Sets&nbsp;the&nbsp;BrowserFinderOptions&nbsp;instance&nbsp;to&nbsp;use.</tt></dd></dl>
100
101<dl><dt><a name="RecorderPageTest-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>
102&nbsp;<br>
103This&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>
104be&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>
105restarted&nbsp;to&nbsp;run&nbsp;the&nbsp;next&nbsp;page.<br>
106&nbsp;<br>
107A&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>
108decide&nbsp;whether&nbsp;it&nbsp;needs&nbsp;to&nbsp;stop&nbsp;the&nbsp;browser.</tt></dd></dl>
109
110<dl><dt><a name="RecorderPageTest-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>
111create&nbsp;a&nbsp;new&nbsp;tab&nbsp;for&nbsp;every&nbsp;page,&nbsp;return&nbsp;browser.tabs.New().</tt></dd></dl>
112
113<hr>
114Data descriptors inherited from <a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.PageTest</a>:<br>
115<dl><dt><strong>__dict__</strong></dt>
116<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
117</dl>
118<dl><dt><strong>__weakref__</strong></dt>
119<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
120</dl>
121<dl><dt><strong>clear_cache_before_each_run</strong></dt>
122<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>
123before&nbsp;each&nbsp;run.</tt></dd>
124</dl>
125<dl><dt><strong>close_tabs_before_run</strong></dt>
126<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>
127first&nbsp;time.</tt></dd>
128</dl>
129<dl><dt><strong>is_multi_tab_test</strong></dt>
130<dd><tt>Returns&nbsp;True&nbsp;if&nbsp;the&nbsp;test&nbsp;opens&nbsp;multiple&nbsp;tabs.<br>
131&nbsp;<br>
132If&nbsp;the&nbsp;test&nbsp;overrides&nbsp;TabForPage,&nbsp;it&nbsp;is&nbsp;deemed&nbsp;a&nbsp;multi-tab&nbsp;test.<br>
133Multi-tab&nbsp;tests&nbsp;do&nbsp;not&nbsp;retry&nbsp;after&nbsp;tab&nbsp;or&nbsp;browser&nbsp;crashes,&nbsp;whereas,<br>
134single-tab&nbsp;tests&nbsp;too.&nbsp;That&nbsp;is&nbsp;because&nbsp;the&nbsp;state&nbsp;of&nbsp;multi-tab&nbsp;tests<br>
135(e.g.,&nbsp;how&nbsp;many&nbsp;tabs&nbsp;are&nbsp;open,&nbsp;etc.)&nbsp;is&nbsp;unknown&nbsp;after&nbsp;crashes.</tt></dd>
136</dl>
137</td></tr></table> <p>
138<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
139<tr bgcolor="#ffc8d8">
140<td colspan=3 valign=bottom>&nbsp;<br>
141<font color="#000000" face="helvetica, arial"><a name="WprRecorder">class <strong>WprRecorder</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
142
143<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
144<td width="100%">Methods defined here:<br>
145<dl><dt><a name="WprRecorder-CreateResults"><strong>CreateResults</strong></a>(self)</dt></dl>
146
147<dl><dt><a name="WprRecorder-HandleResults"><strong>HandleResults</strong></a>(self, results, upload_to_cloud_storage)</dt></dl>
148
149<dl><dt><a name="WprRecorder-Record"><strong>Record</strong></a>(self, results)</dt></dl>
150
151<dl><dt><a name="WprRecorder-__init__"><strong>__init__</strong></a>(self, base_dir, target, args<font color="#909090">=None</font>)</dt></dl>
152
153<hr>
154Data descriptors defined here:<br>
155<dl><dt><strong>__dict__</strong></dt>
156<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
157</dl>
158<dl><dt><strong>__weakref__</strong></dt>
159<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
160</dl>
161<dl><dt><strong>options</strong></dt>
162</dl>
163</td></tr></table></td></tr></table><p>
164<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
165<tr bgcolor="#eeaa77">
166<td colspan=3 valign=bottom>&nbsp;<br>
167<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
168
169<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
170<td width="100%"><dl><dt><a name="-Main"><strong>Main</strong></a>(base_dir)</dt><dd><tt>#&nbsp;TODO(nednguyen):&nbsp;use&nbsp;benchmark.Environment&nbsp;instead&nbsp;of&nbsp;base_dir&nbsp;for&nbsp;discovering<br>
171#&nbsp;benchmark&nbsp;&amp;&nbsp;story&nbsp;classes.</tt></dd></dl>
172</td></tr></table>
173</body></html>