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 from telemetry import inspector_runtime | 4 from telemetry import inspector_runtime |
5 from telemetry import page as page_module | 5 from telemetry import page as page_module |
6 from telemetry import page_action | 6 from telemetry import page_action |
7 from telemetry import util | 7 from telemetry import util |
8 | 8 |
9 class ClickElementAction(page_action.PageAction): | 9 class ClickElementAction(page_action.PageAction): |
10 def __init__(self, attributes=None): | 10 def __init__(self, attributes=None): |
(...skipping 22 matching lines...) Expand all Loading... |
33 elif hasattr(self, 'wait_for_href_change'): | 33 elif hasattr(self, 'wait_for_href_change'): |
34 old_url = tab.EvaluateJavaScript('document.location.href') | 34 old_url = tab.EvaluateJavaScript('document.location.href') |
35 DoClick() | 35 DoClick() |
36 util.WaitFor(lambda: tab.EvaluateJavaScript( | 36 util.WaitFor(lambda: tab.EvaluateJavaScript( |
37 'document.location.href') != old_url, 60) | 37 'document.location.href') != old_url, 60) |
38 else: | 38 else: |
39 DoClick() | 39 DoClick() |
40 | 40 |
41 page_module.Page.WaitForPageToLoad(self, tab, 60) | 41 page_module.Page.WaitForPageToLoad(self, tab, 60) |
42 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter() | 42 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter() |
OLD | NEW |