1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.story.story</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.story.html"><font color="#ffffff">story</font></a>.story</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/story/story.py">telemetry/story/story.py</a></font></td></tr></table> 13 <p><tt># Copyright 2015 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="re.html">re</a><br> 24</td><td width="25%" valign=top><a href="telemetry.story.shared_state.html">telemetry.story.shared_state</a><br> 25</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> 26<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 27<tr bgcolor="#ee77aa"> 28<td colspan=3 valign=bottom> <br> 29<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 30 31<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 32<td width="100%"><dl> 33<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 34</font></dt><dd> 35<dl> 36<dt><font face="helvetica, arial"><a href="telemetry.story.story.html#Story">Story</a> 37</font></dt></dl> 38</dd> 39</dl> 40 <p> 41<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 42<tr bgcolor="#ffc8d8"> 43<td colspan=3 valign=bottom> <br> 44<font color="#000000" face="helvetica, arial"><a name="Story">class <strong>Story</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 45 46<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 47<td colspan=2><tt>A class styled on unittest.TestCase for creating story tests.<br> 48 <br> 49Tests should override Run to maybe start the application and perform actions<br> 50on it. To share state between different tests, one can define a<br> 51shared_state which contains hooks that will be called before and<br> 52after mutiple stories run and in between runs.<br> 53 <br> 54Args:<br> 55 shared_state_class: subclass of telemetry.story.shared_state.SharedState.<br> 56 name: string name of this story that can be used for identifying this story<br> 57 in results output.<br> 58 labels: A list or set of string labels that are used for filtering. See<br> 59 story.story_filter for more information.<br> 60 is_local: If True, the story does not require network.<br> </tt></td></tr> 61<tr><td> </td> 62<td width="100%">Methods defined here:<br> 63<dl><dt><a name="Story-AsDict"><strong>AsDict</strong></a>(self)</dt><dd><tt>Converts a story <a href="__builtin__.html#object">object</a> to a dict suitable for JSON output.</tt></dd></dl> 64 65<dl><dt><a name="Story-Run"><strong>Run</strong></a>(self, shared_state)</dt><dd><tt>Execute the interactions with the applications and/or platforms.</tt></dd></dl> 66 67<dl><dt><a name="Story-__init__"><strong>__init__</strong></a>(self, shared_state_class, name<font color="#909090">=''</font>, labels<font color="#909090">=None</font>, is_local<font color="#909090">=False</font>, make_javascript_deterministic<font color="#909090">=True</font>)</dt><dd><tt>Args:<br> 68 make_javascript_deterministic: Whether JavaScript performed on<br> 69 the page is made deterministic across multiple runs. This<br> 70 requires that the web content is served via Web Page Replay<br> 71 to take effect. This setting does not affect stories containing no web<br> 72 content or where the HTTP MIME type is not text/html.See also:<br> 73 _InjectScripts method in third_party/webpagereplay/httpclient.py.</tt></dd></dl> 74 75<hr> 76Data descriptors defined here:<br> 77<dl><dt><strong>__dict__</strong></dt> 78<dd><tt>dictionary for instance variables (if defined)</tt></dd> 79</dl> 80<dl><dt><strong>__weakref__</strong></dt> 81<dd><tt>list of weak references to the object (if defined)</tt></dd> 82</dl> 83<dl><dt><strong>display_name</strong></dt> 84</dl> 85<dl><dt><strong>file_safe_name</strong></dt> 86<dd><tt>A version of display_name that's safe to use as a filename.<br> 87 <br> 88The default implementation sanitizes special characters with underscores,<br> 89but it's okay to override it with a more specific implementation in<br> 90subclasses.</tt></dd> 91</dl> 92<dl><dt><strong>id</strong></dt> 93</dl> 94<dl><dt><strong>is_local</strong></dt> 95<dd><tt>Returns True iff this story does not require network.</tt></dd> 96</dl> 97<dl><dt><strong>labels</strong></dt> 98</dl> 99<dl><dt><strong>make_javascript_deterministic</strong></dt> 100</dl> 101<dl><dt><strong>name</strong></dt> 102</dl> 103<dl><dt><strong>serving_dir</strong></dt> 104<dd><tt>Returns the absolute path to a directory with hash files to data that<br> 105should be updated from cloud storage, or None if no files need to be<br> 106updated.</tt></dd> 107</dl> 108<dl><dt><strong>shared_state_class</strong></dt> 109</dl> 110</td></tr></table></td></tr></table> 111</body></html>