OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 from telemetry.page.actions import page_action | 5 from telemetry.page.actions import page_action |
6 | 6 |
7 class NavigateAction(page_action.PageAction): | 7 class NavigateAction(page_action.PageAction): |
8 def __init__(self, attributes=None): | 8 def __init__(self, attributes=None): |
9 super(NavigateAction, self).__init__(attributes) | 9 super(NavigateAction, self).__init__(attributes) |
10 | 10 |
11 def RunAction(self, page, tab, previous_action): | 11 def RunAction(self, page, tab, previous_action): |
12 if page.is_file: | 12 if page.is_file: |
13 target_side_url = tab.browser.http_server.UrlOf(page.file_path_url) | 13 target_side_url = tab.browser.http_server.UrlOf(page.file_path_url) |
14 else: | 14 else: |
15 target_side_url = page.url | 15 target_side_url = page.url |
16 | 16 |
17 tab.Navigate(target_side_url, page.script_to_evaluate_on_commit) | 17 if hasattr(self, 'timeout_seconds') and self.timeout_seconds: |
tonyg
2014/03/12 02:08:37
Please break this out to a new CL and mail to dtu.
bolian
2014/03/19 00:20:03
Split out as https://codereview.chromium.org/20248
| |
18 tab.Navigate(target_side_url, | |
19 page.script_to_evaluate_on_commit, | |
20 self.timeout_seconds) | |
21 else: | |
22 tab.Navigate(target_side_url, page.script_to_evaluate_on_commit) | |
18 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter() | 23 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter() |
OLD | NEW |