OLD | NEW |
1 | 1 |
2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | 2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
3 <html><head><title>Python: module telemetry.page.page_measurement</title> | 3 <html><head><title>Python: module telemetry.page.page_measurement</title> |
4 </head><body bgcolor="#f0f0f8"> | 4 </head><body bgcolor="#f0f0f8"> |
5 | 5 |
6 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> | 6 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
7 <tr bgcolor="#7799ee"> | 7 <tr bgcolor="#7799ee"> |
8 <td valign=bottom> <br> | 8 <td valign=bottom> <br> |
9 <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a hre
f="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 | 9 <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a hre
f="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 |
10 ><td align=right valign=bottom | 10 ><td align=right valign=bottom |
11 ><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> | 11 ><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> |
12 <p><tt># Copyright (c) 2012 The Chromium Autho
rs. All rights reserved.<br> | 12 <p><tt># Copyright (c) 2012 The Chromium Autho
rs. All rights reserved.<br> |
13 # Use of this source code is governed by
a BSD-style license that can be<br> | 13 # Use of this source code is governed by
a BSD-style license that can be<br> |
14 # found in the LICENSE file.</tt></p> | 14 # found in the LICENSE file.</tt></p> |
15 <p> | 15 <p> |
16 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 16 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
17 <tr bgcolor="#aa55cc"> | 17 <tr bgcolor="#aa55cc"> |
18 <td colspan=3 valign=bottom> <br> | 18 <td colspan=3 valign=bottom> <br> |
19 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big
></font></td></tr> | 19 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big
></font></td></tr> |
20 | 20 |
21 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td>
</td> | 21 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td>
</td> |
22 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=t
op><a href="telemetry.page.block_page_measurement_results.html">telemetry.page.b
lock_page_measurement_results</a><br> | 22 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=t
op><a href="telemetry.page.page_test.html">telemetry.page.page_test</a><br> |
23 <a href="telemetry.page.buildbot_page_measurement_results.html">telemetry.page.b
uildbot_page_measurement_results</a><br> | 23 </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> |
24 </td><td width="25%" valign=top><a href="telemetry.page.csv_page_measurement_res
ults.html">telemetry.page.csv_page_measurement_results</a><br> | |
25 <a href="os.html">os</a><br> | |
26 </td><td width="25%" valign=top><a href="telemetry.page.page_measurement_results
.html">telemetry.page.page_measurement_results</a><br> | |
27 <a href="telemetry.page.page_test.html">telemetry.page.page_test</a><br> | |
28 </td><td width="25%" valign=top><a href="sys.html">sys</a><br> | |
29 </td></tr></table></td></tr></table><p> | |
30 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 24 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
31 <tr bgcolor="#ee77aa"> | 25 <tr bgcolor="#ee77aa"> |
32 <td colspan=3 valign=bottom> <br> | 26 <td colspan=3 valign=bottom> <br> |
33 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> | 27 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> |
34 | 28 |
35 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> | 29 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> |
36 <td width="100%"><dl> | 30 <td width="100%"><dl> |
37 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#Failure
">telemetry.page.page_test.Failure</a>(<a href="exceptions.html#Exception">excep
tions.Exception</a>) | 31 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#Failure
">telemetry.page.page_test.Failure</a>(<a href="exceptions.html#Exception">excep
tions.Exception</a>) |
38 </font></dt><dd> | 32 </font></dt><dd> |
39 <dl> | 33 <dl> |
40 <dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#
MeasurementFailure">MeasurementFailure</a> | 34 <dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#
MeasurementFailure">MeasurementFailure</a> |
41 </font></dt></dl> | 35 </font></dt></dl> |
42 </dd> | 36 </dd> |
43 <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>) | 37 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#PageTes
t">telemetry.page.page_test.PageTest</a>(<a href="telemetry.core.command_line.ht
ml#ArgumentHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>) |
44 </font></dt><dd> | 38 </font></dt><dd> |
45 <dl> | 39 <dl> |
46 <dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#
PageMeasurement">PageMeasurement</a> | 40 <dt><font face="helvetica, arial"><a href="telemetry.page.page_measurement.html#
PageMeasurement">PageMeasurement</a> |
47 </font></dt></dl> | 41 </font></dt></dl> |
48 </dd> | 42 </dd> |
49 </dl> | 43 </dl> |
50 <p> | 44 <p> |
51 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 45 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
52 <tr bgcolor="#ffc8d8"> | 46 <tr bgcolor="#ffc8d8"> |
53 <td colspan=3 valign=bottom> <br> | 47 <td colspan=3 valign=bottom> <br> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 body_child_count =&nb
sp;tab.EvaluateJavaScript(<br> | 120 body_child_count =&nb
sp;tab.EvaluateJavaScript(<br> |
127 'd
ocument.body.children.length')<br> | 121 'd
ocument.body.children.length')<br> |
128 results.Add('body_children
', 'count', body_child_count)<br> | 122 results.Add('body_children
', 'count', body_child_count)<br> |
129 <br> | 123 <br> |
130 if __name__ == '__main__':<br> | 124 if __name__ == '__main__':<br> |
131 page_measurement.Main(BodyChildElement
Measurement())<br> | 125 page_measurement.Main(BodyChildElement
Measurement())<br> |
132 <br> | 126 <br> |
133 To add test-specific options:<br> | 127 To add test-specific options:<br> |
134 <br> | 128 <br> |
135 class BodyChildElementMeasurement(<a href="#PageMeasureme
nt">PageMeasurement</a>):<br> | 129 class BodyChildElementMeasurement(<a href="#PageMeasureme
nt">PageMeasurement</a>):<br> |
136 def <a href="#PageMeasurement-AddComman
dLineOptions">AddCommandLineOptions</a>(parser):<br> | 130 def <a href="#PageMeasurement-AddComman
dLineArgs">AddCommandLineArgs</a>(parser):<br> |
137 parser.add_option('--eleme
nt', action='store', default='body')<br> | 131 parser.add_option('--eleme
nt', action='store', default='body')<br> |
138 <br> | 132 <br> |
139 def <a href="#PageMeasurement-MeasurePa
ge">MeasurePage</a>(self, page, tab, results):<br> | 133 def <a href="#PageMeasurement-MeasurePa
ge">MeasurePage</a>(self, page, tab, results):<br> |
140 body_child_count =&nb
sp;tab.EvaluateJavaScript(<br> | 134 body_child_count =&nb
sp;tab.EvaluateJavaScript(<br> |
141 'documen
t.querySelector('%s').children.length')<br> | 135 'documen
t.querySelector('%s').children.length')<br> |
142 results.Add('children',&nb
sp;'count', child_count)<br> </tt></td></tr> | 136 results.Add('children',&nb
sp;'count', child_count)<br> </tt></td></tr> |
143 <tr><td> </td> | 137 <tr><td> </td> |
144 <td width="100%"><dl><dt>Method resolution order:</dt> | 138 <td width="100%"><dl><dt>Method resolution order:</dt> |
145 <dd><a href="telemetry.page.page_measurement.html#PageMeasurement">PageMeasureme
nt</a></dd> | 139 <dd><a href="telemetry.page.page_measurement.html#PageMeasurement">PageMeasureme
nt</a></dd> |
146 <dd><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.Pa
geTest</a></dd> | 140 <dd><a href="telemetry.page.page_test.html#PageTest">telemetry.page.page_test.Pa
geTest</a></dd> |
| 141 <dd><a href="telemetry.core.command_line.html#ArgumentHandlerMixIn">telemetry.co
re.command_line.ArgumentHandlerMixIn</a></dd> |
147 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> | 142 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
148 </dl> | 143 </dl> |
149 <hr> | 144 <hr> |
150 Methods defined here:<br> | 145 Methods defined here:<br> |
151 <dl><dt><a name="PageMeasurement-AddOutputOptions"><strong>AddOutputOptions</str
ong></a>(self, parser)</dt></dl> | |
152 | |
153 <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> | 146 <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> |
154 <br> | 147 <br> |
155 page is a page_set.Page<br> | 148 page is a page_set.Page<br> |
156 tab is an instance of telemetry.core.Tab<br> | 149 tab is an instance of telemetry.core.Tab<br> |
157 <br> | 150 <br> |
158 Should call results.Add(name, units, value) for ea
ch result, or raise an<br> | 151 Should call results.Add(name, units, value) for ea
ch result, or raise an<br> |
159 exception on failure. The name and units of&n
bsp;each Add() call must be<br> | 152 exception on failure. The name and units of&n
bsp;each Add() call must be<br> |
160 the same across all iterations. The name 'url
' must not be used.<br> | 153 the same across all iterations. The name 'url
' must not be used.<br> |
161 <br> | 154 <br> |
162 Prefer field names that are in accordance wit
h python variable style. E.g.<br> | 155 Prefer field names that are in accordance wit
h python variable style. E.g.<br> |
163 field_name.<br> | 156 field_name.<br> |
164 <br> | 157 <br> |
165 Put together:<br> | 158 Put together:<br> |
166 <br> | 159 <br> |
167 def <a href="#PageMeasurement-MeasurePage">MeasurePage</a
>(self, page, tab, results):<br> | 160 def <a href="#PageMeasurement-MeasurePage">MeasurePage</a
>(self, page, tab, results):<br> |
168 res = tab.EvaluateJavaScript('2+2')<br> | 161 res = tab.EvaluateJavaScript('2+2')<br> |
169 if res != 4:<br> | 162 if res != 4:<br> |
170 raise Exception('Oh, wow.')<
br> | 163 raise Exception('Oh, wow.')<
br> |
171 results.Add('two_plus_two', 'count', res
)</tt></dd></dl> | 164 results.Add('two_plus_two', 'count', res
)</tt></dd></dl> |
172 | 165 |
173 <dl><dt><a name="PageMeasurement-PrepareResults"><strong>PrepareResults</strong>
</a>(self, options)</dt></dl> | 166 <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_page<font color="#909090">=False</font>, discard_first_result<font color="#9
09090">=False</font>, clear_cache_before_each_run<font color="#909090">=False</f
ont>)</dt></dl> |
174 | |
175 <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>, clear_cache_before_each_run<font color="#909090">=False</fo
nt>)</dt></dl> | |
176 | 167 |
177 <hr> | 168 <hr> |
178 Data descriptors defined here:<br> | 169 Data descriptors defined here:<br> |
179 <dl><dt><strong>output_format_choices</strong></dt> | |
180 </dl> | |
181 <dl><dt><strong>results_are_the_same_on_every_page</strong></dt> | 170 <dl><dt><strong>results_are_the_same_on_every_page</strong></dt> |
182 <dd><tt>By default, measurements are assumed to ou
tput the same values for every<br> | 171 <dd><tt>By default, measurements are assumed to ou
tput the same values for every<br> |
183 page. This allows incremental output, for example&
nbsp;in CSV. If, however, the<br> | 172 page. This allows incremental output, for example&
nbsp;in CSV. If, however, the<br> |
184 measurement discovers what values it can report&nb
sp;as it goes, and those values<br> | 173 measurement discovers what values it can report&nb
sp;as it goes, and those values<br> |
185 may vary from page to page, you need to&
nbsp;override this function and return<br> | 174 may vary from page to page, you need to&
nbsp;override this function and return<br> |
186 False. Output will not appear in this mode&nb
sp;until the entire pageset has<br> | 175 False. Output will not appear in this mode&nb
sp;until the entire pageset has<br> |
187 run.</tt></dd> | 176 run.</tt></dd> |
188 </dl> | 177 </dl> |
189 <hr> | 178 <hr> |
190 Methods inherited from <a href="telemetry.page.page_test.html#PageTest">telemetr
y.page.page_test.PageTest</a>:<br> | 179 Methods inherited from <a href="telemetry.page.page_test.html#PageTest">telemetr
y.page.page_test.PageTest</a>:<br> |
191 <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> | 180 <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> |
192 <br> | |
193 The provided parser is an optparse.OptionParser in
stance and accepts all<br> | |
194 normal results. The parsed options are available&n
bsp;in Run as<br> | |
195 self.<strong>options</strong>.</tt></dd></dl> | |
196 | 181 |
197 <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> | 182 <dl><dt><a name="PageMeasurement-CleanUpAfterPage"><strong>CleanUpAfterPage</str
ong></a>(self, page, tab)</dt><dd><tt>Called after the test
run method was run, even if it failed.</tt></
dd></dl> |
| 183 |
| 184 <dl><dt><a name="PageMeasurement-CreateExpectations"><strong>CreateExpectations<
/strong></a>(self, page_set)</dt><dd><tt>Override to make this&nb
sp;test generate its own expectations instead of<b
r> |
| 185 any that may have been defined in the pa
ge set.</tt></dd></dl> |
198 | 186 |
199 <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> | 187 <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> |
200 allowing arbitrary page sets entered from the 
;command-line.</tt></dd></dl> | 188 allowing arbitrary page sets entered from the 
;command-line.</tt></dd></dl> |
201 | 189 |
202 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptions"><strong>CustomizeBrows
erOptions</strong></a>(self, options)</dt><dd><tt>Override to add 
;test-specific options to the BrowserOptions object</tt
></dd></dl> | 190 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptions"><strong>CustomizeBrows
erOptions</strong></a>(self, options)</dt><dd><tt>Override to add 
;test-specific options to the BrowserOptions object</tt
></dd></dl> |
203 | 191 |
204 <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> | 192 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptionsForPageSet"><strong>Cust
omizeBrowserOptionsForPageSet</strong></a>(self, page_set, options)</dt><dd><tt>
Set options required for this page set.<br> |
| 193 <br> |
| 194 These options will be used every time the&nbs
p;browser is started while running<br> |
| 195 this page set. They may, however, be further&
nbsp;modified by<br> |
| 196 CustomizeBrowserOptionsForSinglePage or by the profiler.</tt
></dd></dl> |
205 | 197 |
206 <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> | 198 <dl><dt><a name="PageMeasurement-CustomizeBrowserOptionsForSinglePage"><strong>C
ustomizeBrowserOptionsForSinglePage</strong></a>(self, page, options)</dt><dd><t
t>Set options specific to the test and the&nb
sp;given page.<br> |
207 any waiting for completion has occurred.</tt></dd></dl> | 199 <br> |
| 200 This will be called with the current page&nbs
p;when the browser is (re)started.<br> |
| 201 Changing options at this point only makes sen
se if the browser is being<br> |
| 202 restarted for each page. Note that if page&nb
sp;has a startup_url, the browser<br> |
| 203 will always be restarted for each run.</tt></dd></
dl> |
| 204 |
| 205 <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 and a
fter<br> |
| 206 all waiting for completion has occurred.</tt></dd></dl> |
208 | 207 |
209 <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> | 208 <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> |
210 | 209 |
211 <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> | 210 <dl><dt><a name="PageMeasurement-DidRunActions"><strong>DidRunActions</strong></
a>(self, page, tab)</dt><dd><tt>Override to do operations af
ter running the actions on the page.</tt></dd></dl
> |
212 is torn down.</tt></dd></dl> | 211 |
| 212 <dl><dt><a name="PageMeasurement-DidRunPageRepeats"><strong>DidRunPageRepeats</s
trong></a>(self, page)</dt><dd><tt>Override to do operations 
;after each page is iterated over.</tt></dd></dl> |
| 213 |
| 214 <dl><dt><a name="PageMeasurement-DidRunTest"><strong>DidRunTest</strong></a>(sel
f, browser, results)</dt><dd><tt>Override to do operations a
fter all page set(s) are completed.<br> |
| 215 <br> |
| 216 This will occur before the browser is torn&nb
sp;down.</tt></dd></dl> |
| 217 |
| 218 <dl><dt><a name="PageMeasurement-DidStartBrowser"><strong>DidStartBrowser</stron
g></a>(self, browser)</dt><dd><tt>Override to customize the
browser right after it has launched.</tt></dd></dl> |
213 | 219 |
214 <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> | 220 <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> |
215 | 221 |
216 <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> | 222 <dl><dt><a name="PageMeasurement-IsExiting"><strong>IsExiting</strong></a>(self)
</dt></dl> |
217 | 223 |
218 <dl><dt><a name="PageMeasurement-Run"><strong>Run</strong></a>(self, options, pa
ge, tab, results)</dt></dl> | 224 <dl><dt><a name="PageMeasurement-RequestExit"><strong>RequestExit</strong></a>(s
elf)</dt></dl> |
219 | 225 |
220 <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> | 226 <dl><dt><a name="PageMeasurement-RestartBrowserBeforeEachPage"><strong>RestartBr
owserBeforeEachPage</strong></a>(self)</dt><dd><tt>Should the browser&
nbsp;be restarted for the page?<br> |
| 227 <br> |
| 228 This returns true if the test needs to u
nconditionally restart the<br> |
| 229 browser for each page. It may be called
before the browser is started.</tt></dd></dl> |
221 | 230 |
222 <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> | 231 <dl><dt><a name="PageMeasurement-Run"><strong>Run</strong></a>(self, page, tab,
results)</dt></dl> |
| 232 |
| 233 <dl><dt><a name="PageMeasurement-RunNavigateSteps"><strong>RunNavigateSteps</str
ong></a>(self, page, tab)</dt><dd><tt>Navigates the tab to t
he page URL attribute.<br> |
| 234 <br> |
| 235 Runs the 'navigate_steps' page attribute as a 
;compound action.</tt></dd></dl> |
| 236 |
| 237 <dl><dt><a name="PageMeasurement-StopBrowserAfterPage"><strong>StopBrowserAfterP
age</strong></a>(self, browser, page)</dt><dd><tt>Should the browser&n
bsp;be stopped after the page is run?<br> |
| 238 <br> |
| 239 This is called after a page is run to&nb
sp;decide whether the browser needs to<br> |
| 240 be stopped to clean up its state. If it&
nbsp;is stopped, then it will be<br> |
| 241 restarted to run the next page.<br> |
| 242 <br> |
| 243 A test that overrides this can look at b
oth the page and the browser to<br> |
| 244 decide whether it needs to stop the browser.<
/tt></dd></dl> |
| 245 |
| 246 <dl><dt><a name="PageMeasurement-TabForPage"><strong>TabForPage</strong></a>(sel
f, page, browser)</dt><dd><tt>Override to select a different
tab for the page. For instance, to<br> |
| 247 create a new tab for every page, return
browser.tabs.New().</tt></dd></dl> |
| 248 |
| 249 <dl><dt><a name="PageMeasurement-ValidatePageSet"><strong>ValidatePageSet</stron
g></a>(self, page_set)</dt><dd><tt>Override to examine the p
age set before the test run. Useful for
<br> |
| 250 example to validate that the pageset can be&n
bsp;used with the test.</tt></dd></dl> |
| 251 |
| 252 <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, notably Tele
metry<br> |
| 253 will already have performed the following operatio
ns on the browser before<br> |
| 254 calling this function:<br> |
| 255 * Ensure only one tab is open.<br> |
| 256 * Call WaitForDocumentReadyStateToComplete on the tab.<
/tt></dd></dl> |
223 | 257 |
224 <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> | 258 <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> |
225 | 259 |
226 <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> | 260 <dl><dt><a name="PageMeasurement-WillRunActions"><strong>WillRunActions</strong>
</a>(self, page, tab)</dt><dd><tt>Override to do operations
before running the actions on the page.</tt></dd><
/dl> |
| 261 |
| 262 <dl><dt><a name="PageMeasurement-WillRunPageRepeats"><strong>WillRunPageRepeats<
/strong></a>(self, page)</dt><dd><tt>Override to do operations&nb
sp;before each page is iterated over.</tt></dd></dl> |
| 263 |
| 264 <dl><dt><a name="PageMeasurement-WillRunTest"><strong>WillRunTest</strong></a>(s
elf, options)</dt><dd><tt>Override to do operations before&n
bsp;the page set(s) are navigated.</tt></dd></dl> |
| 265 |
| 266 <dl><dt><a name="PageMeasurement-WillStartBrowser"><strong>WillStartBrowser</str
ong></a>(self, browser)</dt><dd><tt>Override to manipulate the&nb
sp;browser environment before it launches.</tt></dd></dl> |
227 | 267 |
228 <hr> | 268 <hr> |
229 Data descriptors inherited from <a href="telemetry.page.page_test.html#PageTest"
>telemetry.page.page_test.PageTest</a>:<br> | 269 Data descriptors inherited from <a href="telemetry.page.page_test.html#PageTest"
>telemetry.page.page_test.PageTest</a>:<br> |
| 270 <dl><dt><strong>action_name_to_run</strong></dt> |
| 271 </dl> |
| 272 <dl><dt><strong>attempts</strong></dt> |
| 273 <dd><tt>Maximum number of times test will be
attempted.</tt></dd> |
| 274 </dl> |
| 275 <dl><dt><strong>clear_cache_before_each_run</strong></dt> |
| 276 <dd><tt>When set to True, the browser's disk
and memory cache will be cleared<br> |
| 277 before each run.</tt></dd> |
| 278 </dl> |
| 279 <dl><dt><strong>close_tabs_before_run</strong></dt> |
| 280 <dd><tt>When set to True, all tabs are closed
before running the test for the<br> |
| 281 first time.</tt></dd> |
| 282 </dl> |
| 283 <dl><dt><strong>discard_first_result</strong></dt> |
| 284 <dd><tt>When set to True, the first run of&nb
sp;the test is discarded. This is<br> |
| 285 useful for cases where it's desirable to have
some test resource cached so<br> |
| 286 the first run of the test can warm thing
s up.</tt></dd> |
| 287 </dl> |
| 288 <dl><dt><strong>max_errors</strong></dt> |
| 289 <dd><tt>Maximum number of errors allowed for the&n
bsp;page set.</tt></dd> |
| 290 </dl> |
| 291 <dl><dt><strong>max_failures</strong></dt> |
| 292 <dd><tt>Maximum number of failures allowed for the
page set.</tt></dd> |
| 293 </dl> |
| 294 <hr> |
| 295 Class methods inherited from <a href="telemetry.core.command_line.html#ArgumentH
andlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>:<br> |
| 296 <dl><dt><a name="PageMeasurement-AddCommandLineArgs"><strong>AddCommandLineArgs<
/strong></a>(cls, parser)<font color="#909090"><font face="helvetica, arial"> fr
om <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><t
t>Override to accept custom command-line arguments.</tt
></dd></dl> |
| 297 |
| 298 <dl><dt><a name="PageMeasurement-ProcessCommandLineArgs"><strong>ProcessCommandL
ineArgs</strong></a>(cls, parser, args)<font color="#909090"><font face="helveti
ca, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></fo
nt></dt><dd><tt>Override to process command-line arguments.<
br> |
| 299 <br> |
| 300 We pass in parser so we can call parser.
error().</tt></dd></dl> |
| 301 |
| 302 <hr> |
| 303 Data descriptors inherited from <a href="telemetry.core.command_line.html#Argume
ntHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>:<br> |
230 <dl><dt><strong>__dict__</strong></dt> | 304 <dl><dt><strong>__dict__</strong></dt> |
231 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> | 305 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> |
232 </dl> | 306 </dl> |
233 <dl><dt><strong>__weakref__</strong></dt> | 307 <dl><dt><strong>__weakref__</strong></dt> |
234 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> | 308 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> |
235 </dl> | 309 </dl> |
236 <dl><dt><strong>action_name_to_run</strong></dt> | |
237 </dl> | |
238 <dl><dt><strong>clear_cache_before_each_run</strong></dt> | |
239 <dd><tt>When set to True, the browser's disk
and memory cache will be cleared<br> | |
240 before each run.</tt></dd> | |
241 </dl> | |
242 <dl><dt><strong>discard_first_result</strong></dt> | |
243 <dd><tt>When set to True, the first run of&nb
sp;the test is discarded. This is<br> | |
244 useful for cases where it's desirable to have
some test resource cached so<br> | |
245 the first run of the test can warm thing
s up.</tt></dd> | |
246 </dl> | |
247 </td></tr></table></td></tr></table> | 310 </td></tr></table></td></tr></table> |
248 </body></html> | 311 </body></html> |
OLD | NEW |