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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/page.py

Issue 11314012: Add spaceport benchmark to Chrome Remote Control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bug Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: tools/chrome_remote_control/chrome_remote_control/page.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/page.py b/tools/chrome_remote_control/chrome_remote_control/page.py
index e966777f936db995096de8b68df3edc7b6b5ada8..122e62b29a8ad7884bbf4801e5fd1e394bae5d24 100644
--- a/tools/chrome_remote_control/chrome_remote_control/page.py
+++ b/tools/chrome_remote_control/chrome_remote_control/page.py
@@ -1,14 +1,19 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
import urlparse
class Page(object):
- def __init__(self, url, attributes=None):
- self.url = url
+ def __init__(self, url, attributes=None, base_dir=None):
parsed_url = urlparse.urlparse(url)
- if parsed_url.scheme == None: # pylint: disable=E1101
- raise Exception('urls must be fully qualified: %s' % url)
+ if not parsed_url.scheme:
+ abspath = os.path.abspath(os.path.join(base_dir, parsed_url.path))
+ if os.path.exists(abspath):
+ url = 'file://%s' % os.path.abspath(os.path.join(base_dir, url))
+ else:
+ raise Exception('URLs must be fully qualified: %s' % url)
+ self.url = url
self.interactions = 'scroll'
self.credentials = None
self.wait_time_after_navigate = 2

Powered by Google App Engine
This is Rietveld 408576698