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_test</title> | 3 <html><head><title>Python: module telemetry.page.page_test</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_test</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_test</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_test.py">telemetry/page/page_test.py</a></font></td></tr
></table> | 11 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href=
"../telemetry/page/page_test.py">telemetry/page/page_test.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.actions.all_page_actions.html">telemetry.page.actions
.all_page_actions</a><br> | 22 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=t
op><a href="telemetry.page.actions.all_page_actions.html">telemetry.page.actions
.all_page_actions</a><br> |
23 <a href="telemetry.page.gtest_test_results.html">telemetry.page.gtest_test_resul
ts</a><br> | 23 <a href="telemetry.core.command_line.html">telemetry.core.command_line</a><br> |
24 </td><td width="25%" valign=top><a href="logging.html">logging</a><br> | 24 </td><td width="25%" valign=top><a href="telemetry.page.actions.interact.html">t
elemetry.page.actions.interact</a><br> |
| 25 <a href="logging.html">logging</a><br> |
| 26 </td><td width="25%" valign=top><a href="telemetry.page.actions.navigate.html">t
elemetry.page.actions.navigate</a><br> |
25 <a href="telemetry.page.actions.page_action.html">telemetry.page.actions.page_ac
tion</a><br> | 27 <a href="telemetry.page.actions.page_action.html">telemetry.page.actions.page_ac
tion</a><br> |
26 </td><td width="25%" valign=top><a href="telemetry.page.page_test_results.html">
telemetry.page.page_test_results</a><br> | 28 </td><td width="25%" valign=top><a href="telemetry.page.test_expectations.html">
telemetry.page.test_expectations</a><br> |
27 <a href="telemetry.core.util.html">telemetry.core.util</a><br> | 29 </td></tr></table></td></tr></table><p> |
28 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p> | |
29 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 30 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
30 <tr bgcolor="#ee77aa"> | 31 <tr bgcolor="#ee77aa"> |
31 <td colspan=3 valign=bottom> <br> | 32 <td colspan=3 valign=bottom> <br> |
32 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> | 33 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> |
33 | 34 |
34 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> | 35 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> |
35 <td width="100%"><dl> | 36 <td width="100%"><dl> |
36 <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.
object</a> | |
37 </font></dt><dd> | |
38 <dl> | |
39 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#PageTes
t">PageTest</a> | |
40 </font></dt></dl> | |
41 </dd> | |
42 <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions
.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException<
/a>) | 37 <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions
.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException<
/a>) |
43 </font></dt><dd> | 38 </font></dt><dd> |
44 <dl> | 39 <dl> |
45 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#Failure
">Failure</a> | 40 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#Failure
">Failure</a> |
46 </font></dt></dl> | 41 </font></dt></dl> |
47 </dd> | 42 </dd> |
| 43 <dt><font face="helvetica, arial"><a href="telemetry.core.command_line.html#Argu
mentHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>(<a href="
__builtin__.html#object">__builtin__.object</a>) |
| 44 </font></dt><dd> |
| 45 <dl> |
| 46 <dt><font face="helvetica, arial"><a href="telemetry.page.page_test.html#PageTes
t">PageTest</a> |
| 47 </font></dt></dl> |
| 48 </dd> |
48 </dl> | 49 </dl> |
49 <p> | 50 <p> |
50 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 51 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
51 <tr bgcolor="#ffc8d8"> | 52 <tr bgcolor="#ffc8d8"> |
52 <td colspan=3 valign=bottom> <br> | 53 <td colspan=3 valign=bottom> <br> |
53 <font color="#000000" face="helvetica, arial"><a name="Failure">class <strong>Fa
ilure</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)
</font></td></tr> | 54 <font color="#000000" face="helvetica, arial"><a name="Failure">class <strong>Fa
ilure</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)
</font></td></tr> |
54 | 55 |
55 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> | 56 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
56 <td colspan=2><tt><a href="exceptions.html#Exception">Exception</a> that&nb
sp;can be thrown from PageMeasurement to indicate&
nbsp;an<br> | 57 <td colspan=2><tt><a href="exceptions.html#Exception">Exception</a> that&nb
sp;can be thrown from PageMeasurement to indicate&
nbsp;an<br> |
57 undesired but designed-for problem.<br> </tt></td></tr> | 58 undesired but designed-for problem.<br> </tt></td></tr> |
58 <tr><td> </td> | 59 <tr><td> </td> |
59 <td width="100%"><dl><dt>Method resolution order:</dt> | 60 <td width="100%"><dl><dt>Method resolution order:</dt> |
60 <dd><a href="telemetry.page.page_test.html#Failure">Failure</a></dd> | 61 <dd><a href="telemetry.page.page_test.html#Failure">Failure</a></dd> |
61 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> | 62 <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
62 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> | 63 <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
63 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> | 64 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
64 </dl> | 65 </dl> |
65 <hr> | 66 <hr> |
66 Data descriptors defined here:<br> | 67 Data descriptors defined here:<br> |
67 <dl><dt><strong>__weakref__</strong></dt> | 68 <dl><dt><strong>__weakref__</strong></dt> |
68 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> | 69 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> |
69 </dl> | 70 </dl> |
70 <hr> | 71 <hr> |
71 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception<
/a>:<br> | 72 Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception<
/a>:<br> |
72 <dl><dt><a name="Failure-__init__"><strong>__init__</strong></a>(...)</dt><dd><t
t>x.<a href="#Failure-__init__">__init__</a>(...) initializes x;
see help(type(x)) for signature</tt></dd></dl> | 73 <dl><dt><a name="Failure-__init__"><strong>__init__</strong></a>(...)</dt><dd><t
t>x.<a href="#Failure-__init__">__init__</a>(...) initializes x;
see help(type(x)) for signature</tt></dd></dl> |
73 | 74 |
74 <hr> | 75 <hr> |
75 Data and other attributes inherited from <a href="exceptions.html#Exception">exc
eptions.Exception</a>:<br> | 76 Data and other attributes inherited from <a href="exceptions.html#Exception">exc
eptions.Exception</a>:<br> |
76 <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object>
;<dd><tt>T.<a href="#Failure-__new__">__new__</a>(S, ...) -> a
new <a href="__builtin__.html#object">object</a> with type&
nbsp;S, a subtype of T</tt></dl> | 77 <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object>
;<dd><tt>T.<a href="#Failure-__new__">__new__</a>(S, ...) -> a
new object with type S, a subtype of&nb
sp;T</tt></dl> |
77 | 78 |
78 <hr> | 79 <hr> |
79 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseEx
ception</a>:<br> | 80 Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseEx
ception</a>:<br> |
80 <dl><dt><a name="Failure-__delattr__"><strong>__delattr__</strong></a>(...)</dt>
<dd><tt>x.<a href="#Failure-__delattr__">__delattr__</a>('name') <==>
del x.name</tt></dd></dl> | 81 <dl><dt><a name="Failure-__delattr__"><strong>__delattr__</strong></a>(...)</dt>
<dd><tt>x.<a href="#Failure-__delattr__">__delattr__</a>('name') <==>
del x.name</tt></dd></dl> |
81 | 82 |
82 <dl><dt><a name="Failure-__getattribute__"><strong>__getattribute__</strong></a>
(...)</dt><dd><tt>x.<a href="#Failure-__getattribute__">__getattribute__</a>('na
me') <==> x.name</tt></dd></dl> | 83 <dl><dt><a name="Failure-__getattribute__"><strong>__getattribute__</strong></a>
(...)</dt><dd><tt>x.<a href="#Failure-__getattribute__">__getattribute__</a>('na
me') <==> x.name</tt></dd></dl> |
83 | 84 |
84 <dl><dt><a name="Failure-__getitem__"><strong>__getitem__</strong></a>(...)</dt>
<dd><tt>x.<a href="#Failure-__getitem__">__getitem__</a>(y) <==> 
;x[y]</tt></dd></dl> | 85 <dl><dt><a name="Failure-__getitem__"><strong>__getitem__</strong></a>(...)</dt>
<dd><tt>x.<a href="#Failure-__getitem__">__getitem__</a>(y) <==> 
;x[y]</tt></dd></dl> |
85 | 86 |
86 <dl><dt><a name="Failure-__getslice__"><strong>__getslice__</strong></a>(...)</d
t><dd><tt>x.<a href="#Failure-__getslice__">__getslice__</a>(i, j) <
;==> x[i:j]<br> | 87 <dl><dt><a name="Failure-__getslice__"><strong>__getslice__</strong></a>(...)</d
t><dd><tt>x.<a href="#Failure-__getslice__">__getslice__</a>(i, j) <
;==> x[i:j]<br> |
(...skipping 17 matching lines...) Expand all Loading... |
104 <dl><dt><strong>__dict__</strong></dt> | 105 <dl><dt><strong>__dict__</strong></dt> |
105 </dl> | 106 </dl> |
106 <dl><dt><strong>args</strong></dt> | 107 <dl><dt><strong>args</strong></dt> |
107 </dl> | 108 </dl> |
108 <dl><dt><strong>message</strong></dt> | 109 <dl><dt><strong>message</strong></dt> |
109 </dl> | 110 </dl> |
110 </td></tr></table> <p> | 111 </td></tr></table> <p> |
111 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 112 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
112 <tr bgcolor="#ffc8d8"> | 113 <tr bgcolor="#ffc8d8"> |
113 <td colspan=3 valign=bottom> <br> | 114 <td colspan=3 valign=bottom> <br> |
114 <font color="#000000" face="helvetica, arial"><a name="PageTest">class <strong>P
ageTest</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</
font></td></tr> | 115 <font color="#000000" face="helvetica, arial"><a name="PageTest">class <strong>P
ageTest</strong></a>(<a href="telemetry.core.command_line.html#ArgumentHandlerMi
xIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>)</font></td></tr> |
115 | 116 |
116 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> | 117 <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
117 <td colspan=2><tt>A class styled on unittest.TestCase f
or creating page-specific tests.<br> </tt></td></tr> | 118 <td colspan=2><tt>A class styled on unittest.TestCase f
or creating page-specific tests.<br> </tt></td></tr> |
118 <tr><td> </td> | 119 <tr><td> </td> |
119 <td width="100%">Methods defined here:<br> | 120 <td width="100%"><dl><dt>Method resolution order:</dt> |
120 <dl><dt><a name="PageTest-AddCommandLineOptions"><strong>AddCommandLineOptions</
strong></a>(self, parser)</dt><dd><tt>Override to expose command-
line options for this test.<br> | 121 <dd><a href="telemetry.page.page_test.html#PageTest">PageTest</a></dd> |
121 <br> | 122 <dd><a href="telemetry.core.command_line.html#ArgumentHandlerMixIn">telemetry.co
re.command_line.ArgumentHandlerMixIn</a></dd> |
122 The provided parser is an optparse.OptionParser in
stance and accepts all<br> | 123 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
123 normal results. The parsed options are available&n
bsp;in Run as<br> | 124 </dl> |
124 self.<strong>options</strong>.</tt></dd></dl> | 125 <hr> |
| 126 Methods defined here:<br> |
| 127 <dl><dt><a name="PageTest-CanRunForPage"><strong>CanRunForPage</strong></a>(self
, page)</dt><dd><tt>Override to customize if the test&n
bsp;can be ran for the given page.</tt></dd></dl> |
125 | 128 |
126 <dl><dt><a name="PageTest-AddOutputOptions"><strong>AddOutputOptions</strong></a
>(self, parser)</dt></dl> | 129 <dl><dt><a name="PageTest-CleanUpAfterPage"><strong>CleanUpAfterPage</strong></a
>(self, page, tab)</dt><dd><tt>Called after the test run&nbs
p;method was run, even if it failed.</tt></dd></dl
> |
127 | 130 |
128 <dl><dt><a name="PageTest-CanRunForPage"><strong>CanRunForPage</strong></a>(self
, page)</dt><dd><tt>Override to customize if the test&n
bsp;can be ran for the given page.</tt></dd></dl> | 131 <dl><dt><a name="PageTest-CreateExpectations"><strong>CreateExpectations</strong
></a>(self, page_set)</dt><dd><tt>Override to make this test
generate its own expectations instead of<br> |
| 132 any that may have been defined in the pa
ge set.</tt></dd></dl> |
129 | 133 |
130 <dl><dt><a name="PageTest-CreatePageSet"><strong>CreatePageSet</strong></a>(self
, args, options)</dt><dd><tt>Override to make this test 
;generate its own page set instead of<br> | 134 <dl><dt><a name="PageTest-CreatePageSet"><strong>CreatePageSet</strong></a>(self
, args, options)</dt><dd><tt>Override to make this test 
;generate its own page set instead of<br> |
131 allowing arbitrary page sets entered from the 
;command-line.</tt></dd></dl> | 135 allowing arbitrary page sets entered from the 
;command-line.</tt></dd></dl> |
132 | 136 |
133 <dl><dt><a name="PageTest-CustomizeBrowserOptions"><strong>CustomizeBrowserOptio
ns</strong></a>(self, options)</dt><dd><tt>Override to add test-s
pecific options to the BrowserOptions <a href="__builti
n__.html#object">object</a></tt></dd></dl> | 137 <dl><dt><a name="PageTest-CustomizeBrowserOptions"><strong>CustomizeBrowserOptio
ns</strong></a>(self, options)</dt><dd><tt>Override to add test-s
pecific options to the BrowserOptions object</tt></dd><
/dl> |
134 | 138 |
135 <dl><dt><a name="PageTest-CustomizeBrowserOptionsForPage"><strong>CustomizeBrows
erOptionsForPage</strong></a>(self, page, options)</dt><dd><tt>Add options&
nbsp;specific to the test and the given page.
</tt></dd></dl> | 139 <dl><dt><a name="PageTest-CustomizeBrowserOptionsForPageSet"><strong>CustomizeBr
owserOptionsForPageSet</strong></a>(self, page_set, options)</dt><dd><tt>Set&nbs
p;options required for this page set.<br> |
| 140 <br> |
| 141 These options will be used every time the&nbs
p;browser is started while running<br> |
| 142 this page set. They may, however, be further&
nbsp;modified by<br> |
| 143 CustomizeBrowserOptionsForSinglePage or by the profiler.</tt
></dd></dl> |
136 | 144 |
137 <dl><dt><a name="PageTest-DidNavigateToPage"><strong>DidNavigateToPage</strong><
/a>(self, page, tab)</dt><dd><tt>Override to do operations r
ight after the page is navigated, but before<
br> | 145 <dl><dt><a name="PageTest-CustomizeBrowserOptionsForSinglePage"><strong>Customiz
eBrowserOptionsForSinglePage</strong></a>(self, page, options)</dt><dd><tt>Set&n
bsp;options specific to the test and the give
n page.<br> |
138 any waiting for completion has occurred.</tt></dd></dl> | 146 <br> |
| 147 This will be called with the current page&nbs
p;when the browser is (re)started.<br> |
| 148 Changing options at this point only makes sen
se if the browser is being<br> |
| 149 restarted for each page. Note that if page&nb
sp;has a startup_url, the browser<br> |
| 150 will always be restarted for each run.</tt></dd></
dl> |
| 151 |
| 152 <dl><dt><a name="PageTest-DidNavigateToPage"><strong>DidNavigateToPage</strong><
/a>(self, page, tab)</dt><dd><tt>Override to do operations r
ight after the page is navigated and after<br
> |
| 153 all waiting for completion has occurred.</tt></dd></dl> |
139 | 154 |
140 <dl><dt><a name="PageTest-DidRunAction"><strong>DidRunAction</strong></a>(self,
page, tab, action)</dt><dd><tt>Override to do operations aft
er running the action on the page.</tt></dd></dl> | 155 <dl><dt><a name="PageTest-DidRunAction"><strong>DidRunAction</strong></a>(self,
page, tab, action)</dt><dd><tt>Override to do operations aft
er running the action on the page.</tt></dd></dl> |
141 | 156 |
142 <dl><dt><a name="PageTest-DidRunPageSet"><strong>DidRunPageSet</strong></a>(self
, tab, results)</dt><dd><tt>Override to do operations after&
nbsp;page set is completed, but before browser<br> | 157 <dl><dt><a name="PageTest-DidRunActions"><strong>DidRunActions</strong></a>(self
, page, tab)</dt><dd><tt>Override to do operations after&nbs
p;running the actions on the page.</tt></dd></dl> |
143 is torn down.</tt></dd></dl> | 158 |
| 159 <dl><dt><a name="PageTest-DidRunPageRepeats"><strong>DidRunPageRepeats</strong><
/a>(self, page)</dt><dd><tt>Override to do operations after&
nbsp;each page is iterated over.</tt></dd></dl> |
| 160 |
| 161 <dl><dt><a name="PageTest-DidRunTest"><strong>DidRunTest</strong></a>(self, brow
ser, results)</dt><dd><tt>Override to do operations after&nb
sp;all page set(s) are completed.<br> |
| 162 <br> |
| 163 This will occur before the browser is torn&nb
sp;down.</tt></dd></dl> |
| 164 |
| 165 <dl><dt><a name="PageTest-DidStartBrowser"><strong>DidStartBrowser</strong></a>(
self, browser)</dt><dd><tt>Override to customize the browser
right after it has launched.</tt></dd></dl> |
144 | 166 |
145 <dl><dt><a name="PageTest-DidStartHTTPServer"><strong>DidStartHTTPServer</strong
></a>(self, tab)</dt><dd><tt>Override to do operations after
the HTTP server is started.</tt></dd></dl> | 167 <dl><dt><a name="PageTest-DidStartHTTPServer"><strong>DidStartHTTPServer</strong
></a>(self, tab)</dt><dd><tt>Override to do operations after
the HTTP server is started.</tt></dd></dl> |
146 | 168 |
147 <dl><dt><a name="PageTest-NeedsBrowserRestartAfterEachRun"><strong>NeedsBrowserR
estartAfterEachRun</strong></a>(self, tab)</dt><dd><tt>Override to spe
cify browser restart after each run.</tt></dd></dl> | 169 <dl><dt><a name="PageTest-IsExiting"><strong>IsExiting</strong></a>(self)</dt></
dl> |
148 | 170 |
149 <dl><dt><a name="PageTest-PrepareResults"><strong>PrepareResults</strong></a>(se
lf, options)</dt></dl> | 171 <dl><dt><a name="PageTest-RequestExit"><strong>RequestExit</strong></a>(self)</d
t></dl> |
150 | 172 |
151 <dl><dt><a name="PageTest-Run"><strong>Run</strong></a>(self, options, page, tab
, results)</dt></dl> | 173 <dl><dt><a name="PageTest-RestartBrowserBeforeEachPage"><strong>RestartBrowserBe
foreEachPage</strong></a>(self)</dt><dd><tt>Should the browser be
restarted for the page?<br> |
| 174 <br> |
| 175 This returns true if the test needs to u
nconditionally restart the<br> |
| 176 browser for each page. It may be called
before the browser is started.</tt></dd></dl> |
152 | 177 |
153 <dl><dt><a name="PageTest-SetUpBrowser"><strong>SetUpBrowser</strong></a>(self,
browser)</dt><dd><tt>Override to customize the browser
right after it has launched.</tt></dd></dl> | 178 <dl><dt><a name="PageTest-Run"><strong>Run</strong></a>(self, page, tab, results
)</dt></dl> |
154 | 179 |
155 <dl><dt><a name="PageTest-WillNavigateToPage"><strong>WillNavigateToPage</strong
></a>(self, page, tab)</dt><dd><tt>Override to do operations 
;before the page is navigated.</tt></dd></dl> | 180 <dl><dt><a name="PageTest-RunNavigateSteps"><strong>RunNavigateSteps</strong></a
>(self, page, tab)</dt><dd><tt>Navigates the tab to the 
;page URL attribute.<br> |
| 181 <br> |
| 182 Runs the 'navigate_steps' page attribute as a 
;compound action.</tt></dd></dl> |
| 183 |
| 184 <dl><dt><a name="PageTest-StopBrowserAfterPage"><strong>StopBrowserAfterPage</st
rong></a>(self, browser, page)</dt><dd><tt>Should the browser be&
nbsp;stopped after the page is run?<br> |
| 185 <br> |
| 186 This is called after a page is run to&nb
sp;decide whether the browser needs to<br> |
| 187 be stopped to clean up its state. If it&
nbsp;is stopped, then it will be<br> |
| 188 restarted to run the next page.<br> |
| 189 <br> |
| 190 A test that overrides this can look at b
oth the page and the browser to<br> |
| 191 decide whether it needs to stop the browser.<
/tt></dd></dl> |
| 192 |
| 193 <dl><dt><a name="PageTest-TabForPage"><strong>TabForPage</strong></a>(self, page
, browser)</dt><dd><tt>Override to select a different t
ab for the page. For instance, to<br> |
| 194 create a new tab for every page, return
browser.tabs.New().</tt></dd></dl> |
| 195 |
| 196 <dl><dt><a name="PageTest-ValidatePageSet"><strong>ValidatePageSet</strong></a>(
self, page_set)</dt><dd><tt>Override to examine the page&nbs
p;set before the test run. Useful for<br> |
| 197 example to validate that the pageset can be&n
bsp;used with the test.</tt></dd></dl> |
| 198 |
| 199 <dl><dt><a name="PageTest-WillNavigateToPage"><strong>WillNavigateToPage</strong
></a>(self, page, tab)</dt><dd><tt>Override to do operations 
;before the page is navigated, notably Telemetry<b
r> |
| 200 will already have performed the following operatio
ns on the browser before<br> |
| 201 calling this function:<br> |
| 202 * Ensure only one tab is open.<br> |
| 203 * Call WaitForDocumentReadyStateToComplete on the tab.<
/tt></dd></dl> |
156 | 204 |
157 <dl><dt><a name="PageTest-WillRunAction"><strong>WillRunAction</strong></a>(self
, page, tab, action)</dt><dd><tt>Override to do operations b
efore running the action on the page.</tt></dd></d
l> | 205 <dl><dt><a name="PageTest-WillRunAction"><strong>WillRunAction</strong></a>(self
, page, tab, action)</dt><dd><tt>Override to do operations b
efore running the action on the page.</tt></dd></d
l> |
158 | 206 |
159 <dl><dt><a name="PageTest-WillRunPageSet"><strong>WillRunPageSet</strong></a>(se
lf, tab)</dt><dd><tt>Override to do operations before t
he page set is navigated.</tt></dd></dl> | 207 <dl><dt><a name="PageTest-WillRunActions"><strong>WillRunActions</strong></a>(se
lf, page, tab)</dt><dd><tt>Override to do operations before&
nbsp;running the actions on the page.</tt></dd></dl> |
160 | 208 |
161 <dl><dt><a name="PageTest-__init__"><strong>__init__</strong></a>(self, test_met
hod_name, action_name_to_run<font color="#909090">=''</font>, needs_browser_rest
art_after_each_run<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> | 209 <dl><dt><a name="PageTest-WillRunPageRepeats"><strong>WillRunPageRepeats</strong
></a>(self, page)</dt><dd><tt>Override to do operations befo
re each page is iterated over.</tt></dd></dl> |
| 210 |
| 211 <dl><dt><a name="PageTest-WillRunTest"><strong>WillRunTest</strong></a>(self, op
tions)</dt><dd><tt>Override to do operations before the
page set(s) are navigated.</tt></dd></dl> |
| 212 |
| 213 <dl><dt><a name="PageTest-WillStartBrowser"><strong>WillStartBrowser</strong></a
>(self, browser)</dt><dd><tt>Override to manipulate the brow
ser environment before it launches.</tt></dd></dl> |
| 214 |
| 215 <dl><dt><a name="PageTest-__init__"><strong>__init__</strong></a>(self, test_met
hod_name, action_name_to_run<font color="#909090">=''</font>, needs_browser_rest
art_after_each_page<font color="#909090">=False</font>, discard_first_result<fon
t color="#909090">=False</font>, clear_cache_before_each_run<font color="#909090
">=False</font>, attempts<font color="#909090">=3</font>, max_failures<font colo
r="#909090">=None</font>, max_errors<font color="#909090">=None</font>)</dt></dl
> |
162 | 216 |
163 <hr> | 217 <hr> |
164 Data descriptors defined here:<br> | 218 Data descriptors defined here:<br> |
| 219 <dl><dt><strong>action_name_to_run</strong></dt> |
| 220 </dl> |
| 221 <dl><dt><strong>attempts</strong></dt> |
| 222 <dd><tt>Maximum number of times test will be
attempted.</tt></dd> |
| 223 </dl> |
| 224 <dl><dt><strong>clear_cache_before_each_run</strong></dt> |
| 225 <dd><tt>When set to True, the browser's disk
and memory cache will be cleared<br> |
| 226 before each run.</tt></dd> |
| 227 </dl> |
| 228 <dl><dt><strong>close_tabs_before_run</strong></dt> |
| 229 <dd><tt>When set to True, all tabs are closed
before running the test for the<br> |
| 230 first time.</tt></dd> |
| 231 </dl> |
| 232 <dl><dt><strong>discard_first_result</strong></dt> |
| 233 <dd><tt>When set to True, the first run of&nb
sp;the test is discarded. This is<br> |
| 234 useful for cases where it's desirable to have
some test resource cached so<br> |
| 235 the first run of the test can warm thing
s up.</tt></dd> |
| 236 </dl> |
| 237 <dl><dt><strong>max_errors</strong></dt> |
| 238 <dd><tt>Maximum number of errors allowed for the&n
bsp;page set.</tt></dd> |
| 239 </dl> |
| 240 <dl><dt><strong>max_failures</strong></dt> |
| 241 <dd><tt>Maximum number of failures allowed for the
page set.</tt></dd> |
| 242 </dl> |
| 243 <hr> |
| 244 Class methods inherited from <a href="telemetry.core.command_line.html#ArgumentH
andlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>:<br> |
| 245 <dl><dt><a name="PageTest-AddCommandLineArgs"><strong>AddCommandLineArgs</strong
></a>(cls, parser)<font color="#909090"><font face="helvetica, arial"> from <a h
ref="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Overr
ide to accept custom command-line arguments.</tt></dd><
/dl> |
| 246 |
| 247 <dl><dt><a name="PageTest-ProcessCommandLineArgs"><strong>ProcessCommandLineArgs
</strong></a>(cls, parser, args)<font color="#909090"><font face="helvetica, ari
al"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt
><dd><tt>Override to process command-line arguments.<br> |
| 248 <br> |
| 249 We pass in parser so we can call parser.
error().</tt></dd></dl> |
| 250 |
| 251 <hr> |
| 252 Data descriptors inherited from <a href="telemetry.core.command_line.html#Argume
ntHandlerMixIn">telemetry.core.command_line.ArgumentHandlerMixIn</a>:<br> |
165 <dl><dt><strong>__dict__</strong></dt> | 253 <dl><dt><strong>__dict__</strong></dt> |
166 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> | 254 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> |
167 </dl> | 255 </dl> |
168 <dl><dt><strong>__weakref__</strong></dt> | 256 <dl><dt><strong>__weakref__</strong></dt> |
169 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> | 257 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> |
170 </dl> | 258 </dl> |
171 <dl><dt><strong>action_name_to_run</strong></dt> | |
172 </dl> | |
173 <dl><dt><strong>clear_cache_before_each_run</strong></dt> | |
174 <dd><tt>When set to True, the browser's disk
and memory cache will be cleared<br> | |
175 before each run.</tt></dd> | |
176 </dl> | |
177 <dl><dt><strong>discard_first_result</strong></dt> | |
178 <dd><tt>When set to True, the first run of&nb
sp;the test is discarded. This is<br> | |
179 useful for cases where it's desirable to have
some test resource cached so<br> | |
180 the first run of the test can warm thing
s up.</tt></dd> | |
181 </dl> | |
182 <dl><dt><strong>output_format_choices</strong></dt> | |
183 <dd><tt>Allowed output formats. The default is the
first item in the list.</tt></dd> | |
184 </dl> | |
185 </td></tr></table></td></tr></table><p> | 259 </td></tr></table></td></tr></table><p> |
186 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 260 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
187 <tr bgcolor="#eeaa77"> | 261 <tr bgcolor="#eeaa77"> |
188 <td colspan=3 valign=bottom> <br> | 262 <td colspan=3 valign=bottom> <br> |
189 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></b
ig></font></td></tr> | 263 <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></b
ig></font></td></tr> |
190 | 264 |
191 <tr><td bgcolor="#eeaa77"><tt> </tt></td><td>
</td> | 265 <tr><td bgcolor="#eeaa77"><tt> </tt></td><td>
</td> |
192 <td width="100%"><dl><dt><a name="-GetCompoundActionFromPage"><strong>GetCompoun
dActionFromPage</strong></a>(page, action_name)</dt></dl> | 266 <td width="100%"><dl><dt><a name="-GetCompoundActionFromPage"><strong>GetCompoun
dActionFromPage</strong></a>(page, action_name, interactive<font color="#909090"
>=False</font>)</dt></dl> |
| 267 <dl><dt><a name="-GetSubactionFromData"><strong>GetSubactionFromData</strong></
a>(page, subaction_data, interactive)</dt></dl> |
193 </td></tr></table> | 268 </td></tr></table> |
194 </body></html> | 269 </body></html> |
OLD | NEW |