Chromium Code Reviews| 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) |
|
nduca
2012/11/04 19:53:30
Test coverage
tonyg
2012/11/05 23:02:01
Done.
|
| - 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 |