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 """Basic pyauto performance tests. | 6 """Basic pyauto performance tests. |
7 | 7 |
8 For tests that need to be run for multiple iterations (e.g., so that average | 8 For tests that need to be run for multiple iterations (e.g., so that average |
9 and standard deviation values can be reported), the default number of iterations | 9 and standard deviation values can be reported), the default number of iterations |
10 run for each of these tests is specified by |_DEFAULT_NUM_ITERATIONS|. | 10 run for each of these tests is specified by |_DEFAULT_NUM_ITERATIONS|. |
(...skipping 2273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 'page_sets': 'src/tools/page_cycler/webpagereplay/tests/{test_name}.js', | 2284 'page_sets': 'src/tools/page_cycler/webpagereplay/tests/{test_name}.js', |
2285 'start_page': 'src/tools/page_cycler/webpagereplay/start.html', | 2285 'start_page': 'src/tools/page_cycler/webpagereplay/start.html', |
2286 'extension': 'src/tools/page_cycler/webpagereplay/extension', | 2286 'extension': 'src/tools/page_cycler/webpagereplay/extension', |
2287 } | 2287 } |
2288 | 2288 |
2289 WEBPAGEREPLAY_HOST = '127.0.0.1' | 2289 WEBPAGEREPLAY_HOST = '127.0.0.1' |
2290 WEBPAGEREPLAY_HTTP_PORT = 8080 | 2290 WEBPAGEREPLAY_HTTP_PORT = 8080 |
2291 WEBPAGEREPLAY_HTTPS_PORT = 8413 | 2291 WEBPAGEREPLAY_HTTPS_PORT = 8413 |
2292 | 2292 |
2293 CHROME_FLAGS = webpagereplay.GetChromeFlags( | 2293 CHROME_FLAGS = webpagereplay.GetChromeFlags( |
2294 self.WEBPAGEREPLAY_HOST, | 2294 WEBPAGEREPLAY_HOST, |
2295 self.WEBPAGEREPLAY_HTTP_PORT, | 2295 WEBPAGEREPLAY_HTTP_PORT, |
2296 self.WEBPAGEREPLAY_HTTPS_PORT) + [ | 2296 WEBPAGEREPLAY_HTTPS_PORT) + [ |
2297 '--log-level=0', | 2297 '--log-level=0', |
2298 '--disable-background-networking', | 2298 '--disable-background-networking', |
2299 '--enable-experimental-extension-apis', | 2299 '--enable-experimental-extension-apis', |
2300 '--enable-logging', | 2300 '--enable-logging', |
2301 '--enable-benchmarking', | 2301 '--enable-benchmarking', |
2302 '--metrics-recording-only', | 2302 '--metrics-recording-only', |
2303 '--activate-on-launch', | 2303 '--activate-on-launch', |
2304 '--no-first-run', | 2304 '--no-first-run', |
2305 '--no-proxy-server', | 2305 '--no-proxy-server', |
2306 ] | 2306 ] |
2307 | 2307 |
2308 @classmethod | 2308 @classmethod |
2309 def Path(cls, key, **kwargs): | 2309 def Path(cls, key, **kwargs): |
2310 return FormatChromePath(cls._PATHS[key], **kwargs) | 2310 return FormatChromePath(cls._PATHS[key], **kwargs) |
2311 | 2311 |
2312 @classmethod | 2312 @classmethod |
2313 def ReplayServer(cls, test_name, replay_options=None): | 2313 def ReplayServer(cls, test_name, replay_options=None): |
2314 archive_path = cls.Path('archive', test_name=test_name) | 2314 archive_path = cls.Path('archive', test_name=test_name) |
2315 return webpagereplay.ReplayServer(archive_path, | 2315 return webpagereplay.ReplayServer(archive_path, |
2316 self.WEBPAGEREPLAY_HOST, | 2316 cls.WEBPAGEREPLAY_HOST, |
2317 self.WEBPAGEREPLAY_HTTP_PORT, | 2317 cls.WEBPAGEREPLAY_HTTP_PORT, |
2318 self.WEBPAGEREPLAY_HTTPS_PORT, | 2318 cls.WEBPAGEREPLAY_HTTPS_PORT, |
2319 replay_options) | 2319 replay_options) |
2320 | 2320 |
2321 | 2321 |
2322 class PageCyclerNetSimTest(BasePageCyclerTest): | 2322 class PageCyclerNetSimTest(BasePageCyclerTest): |
2323 """Tests to run Web Page Replay backed page cycler tests.""" | 2323 """Tests to run Web Page Replay backed page cycler tests.""" |
2324 MAX_ITERATION_SECONDS = 180 | 2324 MAX_ITERATION_SECONDS = 180 |
2325 | 2325 |
2326 def ExtraChromeFlags(self): | 2326 def ExtraChromeFlags(self): |
2327 """Ensures Chrome is launched with custom flags. | 2327 """Ensures Chrome is launched with custom flags. |
2328 | 2328 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 """Identifies the port number to which the server is currently bound. | 2693 """Identifies the port number to which the server is currently bound. |
2694 | 2694 |
2695 Returns: | 2695 Returns: |
2696 The numeric port number to which the server is currently bound. | 2696 The numeric port number to which the server is currently bound. |
2697 """ | 2697 """ |
2698 return self._server.server_address[1] | 2698 return self._server.server_address[1] |
2699 | 2699 |
2700 | 2700 |
2701 if __name__ == '__main__': | 2701 if __name__ == '__main__': |
2702 pyauto_functional.Main() | 2702 pyauto_functional.Main() |
OLD | NEW |