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.core import util | 6 from telemetry.core import util |
7 from telemetry.page import gtest_test_results | 7 from telemetry.page import gtest_test_results |
8 from telemetry.page import page_test_results | 8 from telemetry.page import page_test_results |
9 from telemetry.page.actions import all_page_actions | 9 from telemetry.page.actions import all_page_actions |
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 action.CustomizeBrowserOptions(options) | 100 action.CustomizeBrowserOptions(options) |
101 | 101 |
102 def SetUpBrowser(self, browser): | 102 def SetUpBrowser(self, browser): |
103 """Override to customize the browser right after it has launched.""" | 103 """Override to customize the browser right after it has launched.""" |
104 pass | 104 pass |
105 | 105 |
106 def CanRunForPage(self, page): #pylint: disable=W0613 | 106 def CanRunForPage(self, page): #pylint: disable=W0613 |
107 """Override to customize if the test can be ran for the given page.""" | 107 """Override to customize if the test can be ran for the given page.""" |
108 return True | 108 return True |
109 | 109 |
110 def WillRunPageSet(self, tab): | 110 def WillRunTest(self, tab): |
111 """Override to do operations before the page set is navigated.""" | 111 """Override to do operations before the page set(s) are navigated.""" |
112 pass | 112 pass |
113 | 113 |
114 def DidRunPageSet(self, tab, results): | 114 def DidRunTest(self, tab, results): |
115 """Override to do operations after page set is completed, but before browser | 115 """Override to do operations after all page set(s) are completed, but before |
116 is torn down.""" | 116 |
117 browser is torn down.""" | |
dtu
2013/07/11 17:28:38
Sorry, this isn't quite what Dennis meant. The fir
edmundyan
2013/07/11 18:55:01
Got it now, thanks.
| |
117 pass | 118 pass |
118 | 119 |
119 def DidStartHTTPServer(self, tab): | 120 def DidStartHTTPServer(self, tab): |
120 """Override to do operations after the HTTP server is started.""" | 121 """Override to do operations after the HTTP server is started.""" |
121 pass | 122 pass |
122 | 123 |
123 def WillNavigateToPage(self, page, tab): | 124 def WillNavigateToPage(self, page, tab): |
124 """Override to do operations before the page is navigated.""" | 125 """Override to do operations before the page is navigated.""" |
125 pass | 126 pass |
126 | 127 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
195 finally: | 196 finally: |
196 self.DidRunAction(page, tab, action) | 197 self.DidRunAction(page, tab, action) |
197 | 198 |
198 # Closing the connections periodically is needed; otherwise we won't be | 199 # Closing the connections periodically is needed; otherwise we won't be |
199 # able to open enough sockets, and the pages will time out. | 200 # able to open enough sockets, and the pages will time out. |
200 util.CloseConnections(tab) | 201 util.CloseConnections(tab) |
201 | 202 |
202 @property | 203 @property |
203 def action_name_to_run(self): | 204 def action_name_to_run(self): |
204 return self._action_name_to_run | 205 return self._action_name_to_run |
OLD | NEW |