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 | 4 |
5 """Worker thread base class. | 5 """Worker thread base class. |
6 | 6 |
7 Worker threads are used to run multiple PyUITests simultaneously. They | 7 Worker threads are used to run multiple PyUITests simultaneously. They |
8 synchronize calls to the browser.""" | 8 synchronize calls to the browser.""" |
9 | 9 |
10 import itertools | 10 import itertools |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 self.__pyauto.AppendTab(pyauto.GURL(url)) | 133 self.__pyauto.AppendTab(pyauto.GURL(url)) |
134 | 134 |
135 @synchronized | 135 @synchronized |
136 def CallJavascriptFunc(self, fun_name, fun_args=[], url=None): | 136 def CallJavascriptFunc(self, fun_name, fun_args=[], url=None): |
137 return self.__pyauto.CallJavascriptFunc(fun_name, fun_args, | 137 return self.__pyauto.CallJavascriptFunc(fun_name, fun_args, |
138 tab_index=self.__FindTabLocked(url)) | 138 tab_index=self.__FindTabLocked(url)) |
139 | 139 |
140 @synchronized | 140 @synchronized |
141 def CloseTabByURL(self, url): | 141 def CloseTabByURL(self, url): |
142 """Closes the tab with the given url.""" | 142 """Closes the tab with the given url.""" |
143 self.CloseTab(tab_index=self.__FindTabLocked(url)) | 143 self.__pyauto.CloseTab(tab_index=self.__FindTabLocked(url)) |
144 | 144 |
145 @synchronized | 145 @synchronized |
146 def GetDOMValue(self, name, url=None): | 146 def GetDOMValue(self, name, url=None): |
147 return self.__pyauto.GetDOMValue(name, tab_index=self.__FindTabLocked(url)) | 147 return self.__pyauto.GetDOMValue(name, tab_index=self.__FindTabLocked(url)) |
148 | 148 |
149 def WaitUntil(self, *args, **kwargs): | 149 def WaitUntil(self, *args, **kwargs): |
150 """We do not need to lock WaitUntil since it does not call into Chrome. | 150 """We do not need to lock WaitUntil since it does not call into Chrome. |
151 | 151 |
152 Ensure that the function passed in the args is thread safe. | 152 Ensure that the function passed in the args is thread safe. |
153 """ | 153 """ |
154 return self.__pyauto.WaitUntil(*args, **kwargs) | 154 return self.__pyauto.WaitUntil(*args, **kwargs) |
OLD | NEW |