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 | 7 |
8 class NavigateAction(page_action.PageAction): | 8 class NavigateAction(page_action.PageAction): |
9 def __init__(self, attributes=None): | 9 def __init__(self, attributes=None): |
10 super(NavigateAction, self).__init__(attributes) | 10 super(NavigateAction, self).__init__(attributes) |
11 | 11 |
12 def RunAction(self, page, tab, previous_action): | 12 def RunAction(self, page, tab, previous_action): |
13 if page.is_file: | 13 if page.is_file: |
14 filename = page.serving_dirs_and_file[1] | 14 target_side_url = tab.browser.http_server.UrlOf(page.file_path) |
15 target_side_url = tab.browser.http_server.UrlOf(filename) | |
16 else: | 15 else: |
17 target_side_url = page.url | 16 target_side_url = page.url |
18 | 17 |
19 tab.Navigate(target_side_url, page.script_to_evaluate_on_commit) | 18 tab.Navigate(target_side_url, page.script_to_evaluate_on_commit) |
20 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter() | 19 tab.WaitForDocumentReadyStateToBeInteractiveOrBetter() |
OLD | NEW |