| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """A class to help start/stop a Web Page Replay Server. | 6 """A class to help start/stop a Web Page Replay Server. |
| 7 | 7 |
| 8 The page cycler tests use this module to run Web Page Replay | 8 The page cycler tests use this module to run Web Page Replay |
| 9 (see tools/build/scripts/slave/runtest.py). | 9 (see tools/build/scripts/slave/runtest.py). |
| 10 | 10 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 | 128 |
| 129 class ChromiumPaths(object): | 129 class ChromiumPaths(object): |
| 130 """Collect all the path handling together.""" | 130 """Collect all the path handling together.""" |
| 131 PATHS = { | 131 PATHS = { |
| 132 'archives': 'src/data/page_cycler/webpagereplay', | 132 'archives': 'src/data/page_cycler/webpagereplay', |
| 133 '.wpr': 'src/data/page_cycler/webpagereplay/{TEST_NAME}.wpr', | 133 '.wpr': 'src/data/page_cycler/webpagereplay/{TEST_NAME}.wpr', |
| 134 '.wpr_alt': 'src/tools/page_cycler/webpagereplay/tests/{TEST_NAME}.wpr', | 134 '.wpr_alt': 'src/tools/page_cycler/webpagereplay/tests/{TEST_NAME}.wpr', |
| 135 'start.html': 'src/tools/page_cycler/webpagereplay/start.html', | 135 'start.html': 'src/tools/page_cycler/webpagereplay/start.html', |
| 136 'extension': 'src/tools/page_cycler/webpagereplay/extension', | 136 'extension': 'src/tools/page_cycler/webpagereplay/extension', |
| 137 'replay': 'src/third_party/webpagereplay', | |
| 138 'logs': 'src/webpagereplay_logs/{TEST_EXE_NAME}', | 137 'logs': 'src/webpagereplay_logs/{TEST_EXE_NAME}', |
| 138 'replay': 'tools/build/third_party/webpagereplay', |
| 139 } | 139 } |
| 140 | 140 |
| 141 def __init__(self, **replacements): | 141 def __init__(self, **replacements): |
| 142 """Initialize ChromiumPaths. | 142 """Initialize ChromiumPaths. |
| 143 | 143 |
| 144 Args: | 144 Args: |
| 145 replacements: a dict of format replacements for PATHS such as | 145 replacements: a dict of format replacements for PATHS such as |
| 146 {'TEST_NAME': '2012Q2', 'TEST_EXE_NAME': 'performance_ui_tests'}. | 146 {'TEST_NAME': '2012Q2', 'TEST_EXE_NAME': 'performance_ui_tests'}. |
| 147 """ | 147 """ |
| 148 module_dir = os.path.dirname(__file__) | 148 module_dir = os.path.dirname(__file__) |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 try: | 260 try: |
| 261 wpr.StartServer() | 261 wpr.StartServer() |
| 262 LaunchChromium(chrome_exe, chromium_paths, test_name, | 262 LaunchChromium(chrome_exe, chromium_paths, test_name, |
| 263 options.dns_forwarding, options.auto) | 263 options.dns_forwarding, options.auto) |
| 264 finally: | 264 finally: |
| 265 wpr.StopServer() | 265 wpr.StopServer() |
| 266 return 0 | 266 return 0 |
| 267 | 267 |
| 268 if '__main__' == __name__: | 268 if '__main__' == __name__: |
| 269 sys.exit(main()) | 269 sys.exit(main()) |
| OLD | NEW |