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

Side by Side Diff: tools/telemetry/telemetry/page_set_url_builder.py

Issue 11419320: [Telemetry] Port page cycler to Telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tabs Created 8 years 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 (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 import os 4 import os
5 import urlparse
5 6
6 # NOTE: This assumes the page_set file uses 'file:///' instead of 'file://', 7 # NOTE: This assumes the page_set file uses 'file:///' instead of 'file://',
7 # otherwise the '/' will be missing between page_set.base_dir and 8 # otherwise the '/' will be missing between page_set.base_dir and
8 # parsed_url.path. 9 # parsed_url.path.
9 def GetUrlBaseDirAndFile(page_set_base_dir, parsed_url): 10 def GetUrlBaseDirAndFile(page, page_set_base_dir, parsed_url):
10 # Don't use os.path.join otherwise netloc and path can't point to relative 11 # Don't use os.path.join otherwise netloc and path can't point to relative
11 # directories. 12 # directories.
12 assert parsed_url.path[0] == '/' 13 assert parsed_url.path[0] == '/'
13 14
14 path = (page_set_base_dir + 15 path = (page_set_base_dir +
15 parsed_url.netloc + 16 parsed_url.netloc +
16 parsed_url.path) # pylint: disable=E1101 17 parsed_url.path) # pylint: disable=E1101
17 18
19 if hasattr(page, 'url_base_dir'):
20 parsed_url = urlparse.urlparse(page.url_base_dir)
21 base_path = (page_set_base_dir + parsed_url.netloc + parsed_url.path)
22 return (base_path, path.replace(base_path, ''))
23
18 return os.path.split(path) 24 return os.path.split(path)
OLDNEW
« no previous file with comments | « tools/telemetry/telemetry/page_runner.py ('k') | tools/telemetry/telemetry/page_set_url_builder_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698