Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: tools/telemetry/telemetry/page/actions/navigate.py

Issue 24451002: [telemetry] Support absolute paths by changing file:/// to file://. More robust file path handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test on mac, apparently /tmp is a symlink to /private/tmp Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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()
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/core/temporary_http_server.py ('k') | tools/telemetry/telemetry/page/page.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698