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.actions.play</title> | 3 <html><head><title>Python: module telemetry.page.actions.play</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>.<a href="telemetry.page.action
s.html"><font color="#ffffff">actions</font></a>.play</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>.<a href="telemetry.page.action
s.html"><font color="#ffffff">actions</font></a>.play</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/actions/play.py">telemetry/page/actions/play.py</a></font></t
d></tr></table> | 11 ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href=
"../telemetry/page/actions/play.py">telemetry/page/actions/play.py</a></font></t
d></tr></table> |
12 <p><tt>A Telemetry page_action that performs the&nb
sp;"play" action on media elements.<br> | 12 <p><tt>A Telemetry page_action that performs the&nb
sp;"play" action on media elements.<br> |
13 <br> | 13 <br> |
14 Media elements can be specified by a selector
attribute. If no selector is<br> | 14 Media elements can be specified by a selector
attribute. If no selector is<br> |
15 defined then then the action attempts to play
the first video element or audio<br> | 15 defined then then the action attempts to play
the first video element or audio<br> |
16 element on the page. A selector can also 
;be 'all' to play all media elements.<br> | 16 element on the page. A selector can also 
;be 'all' to play all media elements.<br> |
17 <br> | 17 <br> |
18 Other attributes to use are: wait_for_playing and&
nbsp;wait_for_ended, which forces<br> | 18 Other attributes to use are: wait_for_playing and&
nbsp;wait_for_ended, which forces<br> |
19 the action to wait until playing and ended&nb
sp;events get fired respectively.</tt></p> | 19 the action to wait until playing and ended&nb
sp;events get fired respectively.</tt></p> |
20 <p> | 20 <p> |
21 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 21 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
22 <tr bgcolor="#aa55cc"> | 22 <tr bgcolor="#aa55cc"> |
23 <td colspan=3 valign=bottom> <br> | 23 <td colspan=3 valign=bottom> <br> |
24 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big
></font></td></tr> | 24 <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big
></font></td></tr> |
25 | 25 |
26 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td>
</td> | 26 <tr><td bgcolor="#aa55cc"><tt> </tt></td><td>
</td> |
27 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=t
op><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br> | 27 <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=t
op><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br> |
28 </td><td width="25%" valign=top><a href="os.html">os</a><br> | 28 </td><td width="25%" valign=top><a href="telemetry.page.actions.media_action.htm
l">telemetry.page.actions.media_action</a><br> |
29 </td><td width="25%" valign=top><a href="telemetry.page.actions.page_action.html
">telemetry.page.actions.page_action</a><br> | 29 </td><td width="25%" valign=top><a href="telemetry.page.actions.page_action.html
">telemetry.page.actions.page_action</a><br> |
30 </td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.cor
e.util</a><br> | 30 </td><td width="25%" valign=top></td></tr></table></td></tr></table><p> |
31 </td></tr></table></td></tr></table><p> | |
32 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 31 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
33 <tr bgcolor="#ee77aa"> | 32 <tr bgcolor="#ee77aa"> |
34 <td colspan=3 valign=bottom> <br> | 33 <td colspan=3 valign=bottom> <br> |
35 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> | 34 <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big
></font></td></tr> |
36 | 35 |
37 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> | 36 <tr><td bgcolor="#ee77aa"><tt> </tt></td><td>
</td> |
38 <td width="100%"><dl> | 37 <td width="100%"><dl> |
39 <dt><font face="helvetica, arial"><a href="telemetry.page.actions.page_action.ht
ml#PageAction">telemetry.page.actions.page_action.PageAction</a>(<a href="__buil
tin__.html#object">__builtin__.object</a>) | 38 <dt><font face="helvetica, arial"><a href="telemetry.page.actions.media_action.h
tml#MediaAction">telemetry.page.actions.media_action.MediaAction</a>(<a href="te
lemetry.page.actions.page_action.html#PageAction">telemetry.page.actions.page_ac
tion.PageAction</a>) |
40 </font></dt><dd> | 39 </font></dt><dd> |
41 <dl> | 40 <dl> |
42 <dt><font face="helvetica, arial"><a href="telemetry.page.actions.play.html#Play
Action">PlayAction</a> | 41 <dt><font face="helvetica, arial"><a href="telemetry.page.actions.play.html#Play
Action">PlayAction</a> |
43 </font></dt></dl> | 42 </font></dt></dl> |
44 </dd> | 43 </dd> |
45 </dl> | 44 </dl> |
46 <p> | 45 <p> |
47 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> | 46 <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
48 <tr bgcolor="#ffc8d8"> | 47 <tr bgcolor="#ffc8d8"> |
49 <td colspan=3 valign=bottom> <br> | 48 <td colspan=3 valign=bottom> <br> |
50 <font color="#000000" face="helvetica, arial"><a name="PlayAction">class <strong
>PlayAction</strong></a>(<a href="telemetry.page.actions.page_action.html#PageAc
tion">telemetry.page.actions.page_action.PageAction</a>)</font></td></tr> | 49 <font color="#000000" face="helvetica, arial"><a name="PlayAction">class <strong
>PlayAction</strong></a>(<a href="telemetry.page.actions.media_action.html#Media
Action">telemetry.page.actions.media_action.MediaAction</a>)</font></td></tr> |
51 | 50 |
52 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> | 51 <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> |
53 <td width="100%"><dl><dt>Method resolution order:</dt> | 52 <td width="100%"><dl><dt>Method resolution order:</dt> |
54 <dd><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a></dd> | 53 <dd><a href="telemetry.page.actions.play.html#PlayAction">PlayAction</a></dd> |
| 54 <dd><a href="telemetry.page.actions.media_action.html#MediaAction">telemetry.pag
e.actions.media_action.MediaAction</a></dd> |
55 <dd><a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.
actions.page_action.PageAction</a></dd> | 55 <dd><a href="telemetry.page.actions.page_action.html#PageAction">telemetry.page.
actions.page_action.PageAction</a></dd> |
56 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> | 56 <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
57 </dl> | 57 </dl> |
58 <hr> | 58 <hr> |
59 Methods defined here:<br> | 59 Methods defined here:<br> |
60 <dl><dt><a name="PlayAction-HasEventCompleted"><strong>HasEventCompleted</strong
></a>(self, tab, selector, event_name)</dt></dl> | 60 <dl><dt><a name="PlayAction-RunAction"><strong>RunAction</strong></a>(self, page
, tab)</dt></dl> |
61 | |
62 <dl><dt><a name="PlayAction-RunAction"><strong>RunAction</strong></a>(self, page
, tab, previous_action)</dt></dl> | |
63 | |
64 <dl><dt><a name="PlayAction-WaitForEvent"><strong>WaitForEvent</strong></a>(self
, tab, selector, event_name, timeout)</dt><dd><tt>Halts play action&nb
sp;until the selector's event is fired.</tt></dd></dl> | |
65 | 61 |
66 <dl><dt><a name="PlayAction-WillRunAction"><strong>WillRunAction</strong></a>(se
lf, page, tab)</dt><dd><tt>Load the media metrics JS co
de prior to running the action.</tt></dd></dl> | 62 <dl><dt><a name="PlayAction-WillRunAction"><strong>WillRunAction</strong></a>(se
lf, page, tab)</dt><dd><tt>Load the media metrics JS co
de prior to running the action.</tt></dd></dl> |
67 | 63 |
68 <dl><dt><a name="PlayAction-__init__"><strong>__init__</strong></a>(self, attrib
utes<font color="#909090">=None</font>)</dt></dl> | 64 <dl><dt><a name="PlayAction-__init__"><strong>__init__</strong></a>(self, attrib
utes<font color="#909090">=None</font>)</dt></dl> |
69 | 65 |
70 <hr> | 66 <hr> |
| 67 Methods inherited from <a href="telemetry.page.actions.media_action.html#MediaAc
tion">telemetry.page.actions.media_action.MediaAction</a>:<br> |
| 68 <dl><dt><a name="PlayAction-HasEventCompletedOrError"><strong>HasEventCompletedO
rError</strong></a>(self, tab, selector, event_name)</dt></dl> |
| 69 |
| 70 <dl><dt><a name="PlayAction-LoadJS"><strong>LoadJS</strong></a>(self, tab, js_fi
le_name)</dt><dd><tt>Loads and executes a JS file
in the tab.</tt></dd></dl> |
| 71 |
| 72 <dl><dt><a name="PlayAction-WaitForEvent"><strong>WaitForEvent</strong></a>(self
, tab, selector, event_name, timeout)</dt><dd><tt>Halts media action&n
bsp;until the selector's event is fired.<br> |
| 73 <br> |
| 74 Args:<br> |
| 75 tab: The tab to check for event o
n.<br> |
| 76 selector: Media element selector.<br> |
| 77 event_name: Name of the event to check
if fired or not.<br> |
| 78 timeout: Timeout to check for event, t
hrows an exception if not fired.</tt></dd></dl> |
| 79 |
| 80 <hr> |
71 Methods inherited from <a href="telemetry.page.actions.page_action.html#PageActi
on">telemetry.page.actions.page_action.PageAction</a>:<br> | 81 Methods inherited from <a href="telemetry.page.actions.page_action.html#PageActi
on">telemetry.page.actions.page_action.PageAction</a>:<br> |
72 <dl><dt><a name="PlayAction-BindMeasurementJavaScript"><strong>BindMeasurementJa
vaScript</strong></a>(self, tab, start_js, stop_js)</dt><dd><tt>Let this&nb
sp;action determine when measurements should start 
;and stop.<br> | 82 <dl><dt><a name="PlayAction-BindMeasurementJavaScript"><strong>BindMeasurementJa
vaScript</strong></a>(self, tab, start_js, stop_js)</dt><dd><tt>Let this&nb
sp;action determine when measurements should start 
;and stop.<br> |
73 <br> | 83 <br> |
74 A measurement can call this method to provide
the action<br> | 84 A measurement can call this method to provide
the action<br> |
75 with JavaScript code that starts and stops me
asurements. The action<br> | 85 with JavaScript code that starts and stops me
asurements. The action<br> |
76 determines when to execute the provided JavaScript
code, for more accurate<br> | 86 determines when to execute the provided JavaScript
code, for more accurate<br> |
77 timings.<br> | 87 timings.<br> |
78 <br> | 88 <br> |
79 Args:<br> | 89 Args:<br> |
80 tab: The tab to do everything on.<br> | 90 tab: The tab to do everything on.<br> |
81 start_js: JavaScript code that starts measu
rements.<br> | 91 start_js: JavaScript code that starts measu
rements.<br> |
82 stop_js: JavaScript code that stops measure
ments.</tt></dd></dl> | 92 stop_js: JavaScript code that stops measure
ments.</tt></dd></dl> |
83 | 93 |
84 <dl><dt><a name="PlayAction-CanBeBound"><strong>CanBeBound</strong></a>(self)</d
t><dd><tt>If this class implements BindMeasurementJavaScript
, override CanBeBound<br> | 94 <dl><dt><a name="PlayAction-CanBeBound"><strong>CanBeBound</strong></a>(self)</d
t><dd><tt>If this class implements BindMeasurementJavaScript
, override CanBeBound<br> |
85 to return True so that a test knows it&n
bsp;can bind measurements.</tt></dd></dl> | 95 to return True so that a test knows it&n
bsp;can bind measurements.</tt></dd></dl> |
86 | 96 |
87 <dl><dt><a name="PlayAction-CleanUp"><strong>CleanUp</strong></a>(self, page, ta
b)</dt></dl> | 97 <dl><dt><a name="PlayAction-CleanUp"><strong>CleanUp</strong></a>(self, page, ta
b)</dt></dl> |
88 | 98 |
89 <dl><dt><a name="PlayAction-CustomizeBrowserOptions"><strong>CustomizeBrowserOpt
ions</strong></a>(self, options)</dt><dd><tt>Override to add acti
on-specific options to the BrowserOptions<br> | 99 <dl><dt><a name="PlayAction-CustomizeBrowserOptionsForPageSet"><strong>Customize
BrowserOptionsForPageSet</strong></a>(self, options)</dt><dd><tt>Override t
o add action-specific options to the BrowserOption
s<br> |
90 object.</tt></dd></dl> | 100 object. These options will be set for the&nbs
p;whole page set.<br> |
| 101 <br> |
| 102 If the browser is not being restarted for&nbs
p;every page in the page set then<br> |
| 103 all browser options required for the action m
ust be set here. This, however,<br> |
| 104 requires that they do not conflict with optio
ns require by other actions<br> |
| 105 used up by the page set.</tt></dd></dl> |
91 | 106 |
92 <dl><dt><a name="PlayAction-RunsPreviousAction"><strong>RunsPreviousAction</stro
ng></a>(self)</dt><dd><tt>Some actions require some initiali
zation to be performed before the<br> | 107 <dl><dt><a name="PlayAction-GetActiveRangeOnTimeline"><strong>GetActiveRangeOnTi
meline</strong></a>(self, timeline)</dt></dl> |
93 previous action. For example, wait for href c
hange needs to record the old<br> | 108 |
94 href before the previous action changes it. T
herefore, we allow actions to<br> | 109 <dl><dt><a name="PlayAction-RunActionAndMaybeWait"><strong>RunActionAndMaybeWait
</strong></a>(self, page, tab)</dt></dl> |
95 run the previous action. An action that does&
nbsp;this should override this to<br> | 110 |
96 return True in order to prevent the previous&
nbsp;action from being run twice.</tt></dd></dl> | 111 <dl><dt><a name="PlayAction-WillWaitAfterRun"><strong>WillWaitAfterRun</strong><
/a>(self)</dt></dl> |
| 112 |
| 113 <hr> |
| 114 Static methods inherited from <a href="telemetry.page.actions.page_action.html#P
ageAction">telemetry.page.actions.page_action.PageAction</a>:<br> |
| 115 <dl><dt><a name="PlayAction-ResetNextTimelineMarkerId"><strong>ResetNextTimeline
MarkerId</strong></a>()</dt></dl> |
97 | 116 |
98 <hr> | 117 <hr> |
99 Data descriptors inherited from <a href="telemetry.page.actions.page_action.html
#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br> | 118 Data descriptors inherited from <a href="telemetry.page.actions.page_action.html
#PageAction">telemetry.page.actions.page_action.PageAction</a>:<br> |
100 <dl><dt><strong>__dict__</strong></dt> | 119 <dl><dt><strong>__dict__</strong></dt> |
101 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> | 120 <dd><tt>dictionary for instance variables (if defined)<
/tt></dd> |
102 </dl> | 121 </dl> |
103 <dl><dt><strong>__weakref__</strong></dt> | 122 <dl><dt><strong>__weakref__</strong></dt> |
104 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> | 123 <dd><tt>list of weak references to the object 
;(if defined)</tt></dd> |
105 </dl> | 124 </dl> |
106 </td></tr></table></td></tr></table> | 125 </td></tr></table></td></tr></table> |
107 </body></html> | 126 </body></html> |
OLD | NEW |