Chromium Code Reviews| Index: tools/android/loading/sandwich_utils.py |
| diff --git a/tools/android/loading/sandwich_utils.py b/tools/android/loading/sandwich_utils.py |
| index bbc2d9d198c7b98e6bb20fc80c8c7fa3bb9ab20a..b26077d59ff5c7c54bf0729de2368f7dcc3ce574 100644 |
| --- a/tools/android/loading/sandwich_utils.py |
| +++ b/tools/android/loading/sandwich_utils.py |
| @@ -2,12 +2,26 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import re |
| +import urlparse |
| + |
| import common_util |
| import emulation |
| import sandwich_runner |
| import task_manager |
| +class SandwichKnownError(Exception): |
|
pasko
2016/07/06 12:45:52
We are not catching this anywhere, so what is the
gabadie
2016/07/06 13:31:14
Done.
|
| + pass |
| + |
| + |
| +def NormalizeUrl(url): |
| + """Returns normalized URL such as removing trailing slashes.""" |
| + parsed_url = list(urlparse.urlparse(url)) |
| + parsed_url[2] = re.sub(r'/{2,}', r'/', parsed_url[2]) |
| + return urlparse.urlunparse(parsed_url) |
| + |
| + |
| def NetworkSimulationTransformer(network_condition): |
| """Creates a function that accepts a SandwichRunner as a parameter and sets |
| network emulation options on it. |