OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 import logging | 4 import logging |
5 | 5 |
6 from telemetry.page import test_expectations | 6 from telemetry.page import test_expectations |
7 from telemetry.page.actions import all_page_actions | 7 from telemetry.page.actions import all_page_actions |
8 from telemetry.page.actions import interact | 8 from telemetry.page.actions import interact |
9 from telemetry.page.actions import navigate | 9 from telemetry.page.actions import navigate |
10 from telemetry.page.actions import page_action | 10 from telemetry.page.actions import page_action |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 @property | 100 @property |
101 def close_tabs_before_run(self): | 101 def close_tabs_before_run(self): |
102 """When set to True, all tabs are closed before running the test for the | 102 """When set to True, all tabs are closed before running the test for the |
103 first time.""" | 103 first time.""" |
104 return self._close_tabs_before_run | 104 return self._close_tabs_before_run |
105 | 105 |
106 @close_tabs_before_run.setter | 106 @close_tabs_before_run.setter |
107 def close_tabs_before_run(self, close_tabs): | 107 def close_tabs_before_run(self, close_tabs): |
108 self._close_tabs_before_run = close_tabs | 108 self._close_tabs_before_run = close_tabs |
109 | 109 |
110 def AlwaysRestartBrowserForEachRun(self): | |
111 """ Should be browser be restarted after each run - browser independent. | |
jeremy
2013/12/15 13:03:36
nit: "Should the..."
And if this returns false th
aberent
2013/12/16 17:07:43
Done.
| |
112 | |
113 Can be called at any time.""" | |
114 return self._needs_browser_restart_after_each_run | |
115 | |
110 def NeedsBrowserRestartAfterEachRun(self, browser): # pylint: disable=W0613 | 116 def NeedsBrowserRestartAfterEachRun(self, browser): # pylint: disable=W0613 |
111 """Override to specify browser restart after each run.""" | 117 """Browser dependent version of AlwaysRestartBrowserForEachRun. |
112 return self._needs_browser_restart_after_each_run | 118 |
119 Can only be called once the browser has stared. Override this if the test | |
120 has to restart the browser for some browsers but not all.""" | |
jeremy
2013/12/15 13:03:36
Not clear what "browser dependent" means in this c
aberent
2013/12/16 17:07:43
I have renamed this to more accurately reflect wha
| |
121 return self.AlwaysRestartBrowserForEachRun() | |
113 | 122 |
114 def AddCommandLineOptions(self, parser): | 123 def AddCommandLineOptions(self, parser): |
115 """Override to expose command-line options for this test. | 124 """Override to expose command-line options for this test. |
116 | 125 |
117 The provided parser is an optparse.OptionParser instance and accepts all | 126 The provided parser is an optparse.OptionParser instance and accepts all |
118 normal results. The parsed options are available in Run as | 127 normal results. The parsed options are available in Run as |
119 self.options.""" | 128 self.options.""" |
120 pass | 129 pass |
121 | 130 |
122 def CustomizeBrowserOptions(self, options): | 131 def CustomizeBrowserOptions(self, options): |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 | 278 |
270 def IsExiting(self): | 279 def IsExiting(self): |
271 return self._exit_requested | 280 return self._exit_requested |
272 | 281 |
273 def RequestExit(self): | 282 def RequestExit(self): |
274 self._exit_requested = True | 283 self._exit_requested = True |
275 | 284 |
276 @property | 285 @property |
277 def action_name_to_run(self): | 286 def action_name_to_run(self): |
278 return self._action_name_to_run | 287 return self._action_name_to_run |
OLD | NEW |