1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.internal.backends.chrome.oobe</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> <br> 10<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.backends.html"><font color="#ffffff">backends</font></a>.<a href="telemetry.internal.backends.chrome.html"><font color="#ffffff">chrome</font></a>.oobe</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/internal/backends/chrome/oobe.py">telemetry/internal/backends/chrome/oobe.py</a></font></td></tr></table> 13 <p><tt># Copyright 2014 The Chromium Authors. All rights reserved.<br> 14# Use of this source code is governed by a BSD-style license that can be<br> 15# found in the LICENSE 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> <br> 20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 21 22<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.exceptions.html">telemetry.core.exceptions</a><br> 24</td><td width="25%" valign=top><a href="logging.html">logging</a><br> 25</td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.core.util</a><br> 26</td><td width="25%" valign=top><a href="telemetry.internal.browser.web_contents.html">telemetry.internal.browser.web_contents</a><br> 27</td></tr></table></td></tr></table><p> 28<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 29<tr bgcolor="#ee77aa"> 30<td colspan=3 valign=bottom> <br> 31<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 32 33<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 34<td width="100%"><dl> 35<dt><font face="helvetica, arial"><a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 36</font></dt><dd> 37<dl> 38<dt><font face="helvetica, arial"><a href="telemetry.internal.backends.chrome.oobe.html#Oobe">Oobe</a> 39</font></dt></dl> 40</dd> 41</dl> 42 <p> 43<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 44<tr bgcolor="#ffc8d8"> 45<td colspan=3 valign=bottom> <br> 46<font color="#000000" face="helvetica, arial"><a name="Oobe">class <strong>Oobe</strong></a>(<a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>)</font></td></tr> 47 48<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 49<td width="100%"><dl><dt>Method resolution order:</dt> 50<dd><a href="telemetry.internal.backends.chrome.oobe.html#Oobe">Oobe</a></dd> 51<dd><a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a></dd> 52<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 53</dl> 54<hr> 55Methods defined here:<br> 56<dl><dt><a name="Oobe-NavigateFakeLogin"><strong>NavigateFakeLogin</strong></a>(self, username, password, gaia_id)</dt><dd><tt>Fake user login.</tt></dd></dl> 57 58<dl><dt><a name="Oobe-NavigateGaiaLogin"><strong>NavigateGaiaLogin</strong></a>(self, username, password, enterprise_enroll<font color="#909090">=False</font>, for_user_triggered_enrollment<font color="#909090">=False</font>)</dt><dd><tt>Logs in using the GAIA webview or IFrame, whichever is<br> 59present. |enterprise_enroll| allows for enterprise enrollment.<br> 60|for_user_triggered_enrollment| should be False for remora enrollment.</tt></dd></dl> 61 62<dl><dt><a name="Oobe-NavigateGuestLogin"><strong>NavigateGuestLogin</strong></a>(self)</dt><dd><tt>Logs in as guest.</tt></dd></dl> 63 64<dl><dt><a name="Oobe-__init__"><strong>__init__</strong></a>(self, inspector_backend)</dt></dl> 65 66<hr> 67Methods inherited from <a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>:<br> 68<dl><dt><a name="Oobe-CloseConnections"><strong>CloseConnections</strong></a>(self)</dt><dd><tt>Closes all TCP sockets held open by the browser.<br> 69 <br> 70Raises:<br> 71 exceptions.DevtoolsTargetCrashException if the tab is not alive.</tt></dd></dl> 72 73<dl><dt><a name="Oobe-EnableAllContexts"><strong>EnableAllContexts</strong></a>(self)</dt><dd><tt>Enable all contexts in a page. Returns the number of available contexts.<br> 74 <br> 75Raises:<br> 76 exceptions.WebSocketDisconnected<br> 77 exceptions.TimeoutException<br> 78 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 79 80<dl><dt><a name="Oobe-EvaluateJavaScript"><strong>EvaluateJavaScript</strong></a>(self, expr, timeout<font color="#909090">=90</font>)</dt><dd><tt>Evalutes expr in JavaScript and returns the JSONized result.<br> 81 <br> 82Consider using ExecuteJavaScript for cases where the result of the<br> 83expression is not needed.<br> 84 <br> 85If evaluation throws in JavaScript, a Python EvaluateException will<br> 86be raised.<br> 87 <br> 88If the result of the evaluation cannot be JSONized, then an<br> 89EvaluationException will be raised.<br> 90 <br> 91Raises:<br> 92 exceptions.Error: See <a href="#Oobe-EvaluateJavaScriptInContext">EvaluateJavaScriptInContext</a>() for a detailed list<br> 93 of possible exceptions.</tt></dd></dl> 94 95<dl><dt><a name="Oobe-EvaluateJavaScriptInContext"><strong>EvaluateJavaScriptInContext</strong></a>(self, expr, context_id, timeout<font color="#909090">=90</font>)</dt><dd><tt>Similar to ExecuteJavaScript, except context_id can refer to an iframe.<br> 96The main page has context_id=1, the first iframe context_id=2, etc.<br> 97 <br> 98Raises:<br> 99 exceptions.EvaluateException<br> 100 exceptions.WebSocketDisconnected<br> 101 exceptions.TimeoutException<br> 102 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 103 104<dl><dt><a name="Oobe-ExecuteJavaScript"><strong>ExecuteJavaScript</strong></a>(self, statement, timeout<font color="#909090">=90</font>)</dt><dd><tt>Executes statement in JavaScript. Does not return the result.<br> 105 <br> 106If the statement failed to evaluate, EvaluateException will be raised.<br> 107 <br> 108Raises:<br> 109 exceptions.Error: See <a href="#Oobe-ExecuteJavaScriptInContext">ExecuteJavaScriptInContext</a>() for a detailed list of<br> 110 possible exceptions.</tt></dd></dl> 111 112<dl><dt><a name="Oobe-ExecuteJavaScriptInContext"><strong>ExecuteJavaScriptInContext</strong></a>(self, expr, context_id, timeout<font color="#909090">=90</font>)</dt><dd><tt>Similar to ExecuteJavaScript, except context_id can refer to an iframe.<br> 113The main page has context_id=1, the first iframe context_id=2, etc.<br> 114 <br> 115Raises:<br> 116 exceptions.EvaluateException<br> 117 exceptions.WebSocketDisconnected<br> 118 exceptions.TimeoutException<br> 119 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 120 121<dl><dt><a name="Oobe-GetUrl"><strong>GetUrl</strong></a>(self)</dt><dd><tt>Returns the URL to which the <a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a> is connected.<br> 122 <br> 123Raises:<br> 124 exceptions.Error: If there is an error in inspector backend connection.</tt></dd></dl> 125 126<dl><dt><a name="Oobe-GetWebviewContexts"><strong>GetWebviewContexts</strong></a>(self)</dt><dd><tt>Returns a list of webview contexts within the current inspector backend.<br> 127 <br> 128Returns:<br> 129 A list of <a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a> objects representing the webview contexts.<br> 130 <br> 131Raises:<br> 132 exceptions.Error: If there is an error in inspector backend connection.</tt></dd></dl> 133 134<dl><dt><a name="Oobe-HasReachedQuiescence"><strong>HasReachedQuiescence</strong></a>(self)</dt><dd><tt>Determine whether the page has reached quiescence after loading.<br> 135 <br> 136Returns:<br> 137 True if 2 seconds have passed since last resource received, false<br> 138 otherwise.<br> 139Raises:<br> 140 exceptions.Error: See <a href="#Oobe-EvaluateJavaScript">EvaluateJavaScript</a>() for a detailed list of<br> 141 possible exceptions.</tt></dd></dl> 142 143<dl><dt><a name="Oobe-IsAlive"><strong>IsAlive</strong></a>(self)</dt><dd><tt>Whether the <a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a> is still operating normally.<br> 144 <br> 145Since <a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a> function asynchronously, this method does not guarantee<br> 146that the <a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a> will still be alive at any point in the future.<br> 147 <br> 148Returns:<br> 149 A boolean indicating whether the <a href="telemetry.internal.browser.web_contents.html#WebContents">WebContents</a> is opearting normally.</tt></dd></dl> 150 151<dl><dt><a name="Oobe-Navigate"><strong>Navigate</strong></a>(self, url, script_to_evaluate_on_commit<font color="#909090">=None</font>, timeout<font color="#909090">=90</font>)</dt><dd><tt>Navigates to url.<br> 152 <br> 153If |script_to_evaluate_on_commit| is given, the script source string will be<br> 154evaluated when the navigation is committed. This is after the context of<br> 155the page exists, but before any script on the page itself has executed.<br> 156 <br> 157Raises:<br> 158 exceptions.TimeoutException<br> 159 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 160 161<dl><dt><a name="Oobe-StartTimelineRecording"><strong>StartTimelineRecording</strong></a>(self)</dt><dd><tt>Starts timeline recording.<br> 162 <br> 163Raises:<br> 164 exceptions.TimeoutException<br> 165 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 166 167<dl><dt><a name="Oobe-StopTimelineRecording"><strong>StopTimelineRecording</strong></a>(self)</dt><dd><tt>Stops timeline recording.<br> 168 <br> 169Raises:<br> 170 exceptions.TimeoutException<br> 171 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 172 173<dl><dt><a name="Oobe-SynthesizeScrollGesture"><strong>SynthesizeScrollGesture</strong></a>(self, x<font color="#909090">=100</font>, y<font color="#909090">=800</font>, xDistance<font color="#909090">=0</font>, yDistance<font color="#909090">=-500</font>, xOverscroll<font color="#909090">=None</font>, yOverscroll<font color="#909090">=None</font>, preventFling<font color="#909090">=True</font>, speed<font color="#909090">=None</font>, gestureSourceType<font color="#909090">=None</font>, repeatCount<font color="#909090">=None</font>, repeatDelayMs<font color="#909090">=None</font>, interactionMarkerName<font color="#909090">=None</font>)</dt><dd><tt>Runs an inspector command that causes a repeatable browser driven scroll.<br> 174 <br> 175Args:<br> 176 x: X coordinate of the start of the gesture in CSS pixels.<br> 177 y: Y coordinate of the start of the gesture in CSS pixels.<br> 178 xDistance: Distance to scroll along the X axis (positive to scroll left).<br> 179 yDistance: Ddistance to scroll along the Y axis (positive to scroll up).<br> 180 xOverscroll: Number of additional pixels to scroll back along the X axis.<br> 181 xOverscroll: Number of additional pixels to scroll back along the Y axis.<br> 182 preventFling: Prevents a fling gesture.<br> 183 speed: Swipe speed in pixels per second.<br> 184 gestureSourceType: Which type of input events to be generated.<br> 185 repeatCount: Number of additional repeats beyond the first scroll.<br> 186 repeatDelayMs: Number of milliseconds delay between each repeat.<br> 187 interactionMarkerName: The name of the interaction markers to generate.<br> 188 <br> 189Raises:<br> 190 exceptions.TimeoutException<br> 191 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 192 193<dl><dt><a name="Oobe-WaitForDocumentReadyStateToBeComplete"><strong>WaitForDocumentReadyStateToBeComplete</strong></a>(self, timeout<font color="#909090">=90</font>)</dt><dd><tt>Waits for the document to finish loading.<br> 194 <br> 195Raises:<br> 196 exceptions.Error: See <a href="#Oobe-WaitForJavaScriptExpression">WaitForJavaScriptExpression</a>() for a detailed list<br> 197 of possible exceptions.</tt></dd></dl> 198 199<dl><dt><a name="Oobe-WaitForDocumentReadyStateToBeInteractiveOrBetter"><strong>WaitForDocumentReadyStateToBeInteractiveOrBetter</strong></a>(self, timeout<font color="#909090">=90</font>)</dt><dd><tt>Waits for the document to be interactive.<br> 200 <br> 201Raises:<br> 202 exceptions.Error: See <a href="#Oobe-WaitForJavaScriptExpression">WaitForJavaScriptExpression</a>() for a detailed list<br> 203 of possible exceptions.</tt></dd></dl> 204 205<dl><dt><a name="Oobe-WaitForJavaScriptExpression"><strong>WaitForJavaScriptExpression</strong></a>(self, expr, timeout, dump_page_state_on_timeout<font color="#909090">=True</font>)</dt><dd><tt>Waits for the given JavaScript expression to be True.<br> 206 <br> 207This method is robust against any given Evaluation timing out.<br> 208 <br> 209Args:<br> 210 expr: The expression to evaluate.<br> 211 timeout: The number of seconds to wait for the expression to be True.<br> 212 dump_page_state_on_timeout: Whether to provide additional information on<br> 213 the page state if a TimeoutException is thrown.<br> 214 <br> 215Raises:<br> 216 exceptions.TimeoutException: On a timeout.<br> 217 exceptions.Error: See <a href="#Oobe-EvaluateJavaScript">EvaluateJavaScript</a>() for a detailed list of<br> 218 possible exceptions.</tt></dd></dl> 219 220<dl><dt><a name="Oobe-WaitForNavigate"><strong>WaitForNavigate</strong></a>(self, timeout<font color="#909090">=90</font>)</dt><dd><tt>Waits for the navigation to complete.<br> 221 <br> 222The current page is expect to be in a navigation.<br> 223This function returns when the navigation is complete or when<br> 224the timeout has been exceeded.<br> 225 <br> 226Raises:<br> 227 exceptions.TimeoutException<br> 228 exceptions.DevtoolsTargetCrashException</tt></dd></dl> 229 230<hr> 231Data descriptors inherited from <a href="telemetry.internal.browser.web_contents.html#WebContents">telemetry.internal.browser.web_contents.WebContents</a>:<br> 232<dl><dt><strong>__dict__</strong></dt> 233<dd><tt>dictionary for instance variables (if defined)</tt></dd> 234</dl> 235<dl><dt><strong>__weakref__</strong></dt> 236<dd><tt>list of weak references to the object (if defined)</tt></dd> 237</dl> 238<dl><dt><strong>id</strong></dt> 239<dd><tt>Return the unique id string for this tab object.</tt></dd> 240</dl> 241<dl><dt><strong>message_output_stream</strong></dt> 242</dl> 243<dl><dt><strong>timeline_model</strong></dt> 244</dl> 245</td></tr></table></td></tr></table> 246</body></html>