OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import copy | 7 import copy |
8 import email | 8 import email |
9 import logging | 9 import logging |
10 import os | 10 import os |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 227 |
228 This method resets the timeout before returning. | 228 This method resets the timeout before returning. |
229 """ | 229 """ |
230 timeout_changer = pyauto.PyUITest.ActionTimeoutChanger( | 230 timeout_changer = pyauto.PyUITest.ActionTimeoutChanger( |
231 self, new_timeout) | 231 self, new_timeout) |
232 logging.info('Automation execution timeout has been changed to %d. ' | 232 logging.info('Automation execution timeout has been changed to %d. ' |
233 'If the timeout is large the test might appear to hang.' | 233 'If the timeout is large the test might appear to hang.' |
234 % new_timeout) | 234 % new_timeout) |
235 function() | 235 function() |
236 del timeout_changer | 236 del timeout_changer |
| 237 |
| 238 def GetOmniboxMatchesFor(self, text, windex=0, attr_dict=None): |
| 239 """Fetch omnibox matches with the given attributes for the given query. |
| 240 |
| 241 Args: |
| 242 text: the query text to use |
| 243 windex: the window index to work on. Defaults to 0 (first window) |
| 244 attr_dict: the dictionary of properties to be satisfied |
| 245 |
| 246 Returns: |
| 247 a list of match items |
| 248 """ |
| 249 self.SetOmniboxText(text, windex=windex) |
| 250 self.WaitUntilOmniboxQueryDone(windex=windex) |
| 251 if not attr_dict: |
| 252 matches = self.GetOmniboxInfo(windex=windex).Matches() |
| 253 else: |
| 254 matches = self.GetOmniboxInfo(windex=windex).MatchesWithAttributes( |
| 255 attr_dict=attr_dict) |
| 256 return matches |
OLD | NEW |