| 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 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 def ExtraChromeFlags(self): | 758 def ExtraChromeFlags(self): |
| 759 """Ensures Chrome is launched with custom flags. | 759 """Ensures Chrome is launched with custom flags. |
| 760 | 760 |
| 761 Returns: | 761 Returns: |
| 762 A list of extra flags to pass to Chrome when it is launched. | 762 A list of extra flags to pass to Chrome when it is launched. |
| 763 """ | 763 """ |
| 764 flags = super(BasePerfTest, self).ExtraChromeFlags() | 764 flags = super(BasePerfTest, self).ExtraChromeFlags() |
| 765 # Window size impacts a variety of perf tests, ensure consistency. | 765 # Window size impacts a variety of perf tests, ensure consistency. |
| 766 flags.append('--window-size=1024,768') | 766 flags.append('--window-size=1024,768') |
| 767 if self._IsPGOMode(): | 767 if self._IsPGOMode(): |
| 768 flags = flags + ['--child-clean-exit', '--no-sandbox'] | 768 flags = flags + ['--no-sandbox'] |
| 769 return flags | 769 return flags |
| 770 | 770 |
| 771 | 771 |
| 772 class TabPerfTest(BasePerfTest): | 772 class TabPerfTest(BasePerfTest): |
| 773 """Tests that involve opening tabs.""" | 773 """Tests that involve opening tabs.""" |
| 774 | 774 |
| 775 def testNewTab(self): | 775 def testNewTab(self): |
| 776 """Measures time to open a new tab.""" | 776 """Measures time to open a new tab.""" |
| 777 self._RunNewTabTest('NewTabPage', | 777 self._RunNewTabTest('NewTabPage', |
| 778 lambda: self._AppendTab('chrome://newtab'), 'open_tab') | 778 lambda: self._AppendTab('chrome://newtab'), 'open_tab') |
| (...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2417 """Identifies the port number to which the server is currently bound. | 2417 """Identifies the port number to which the server is currently bound. |
| 2418 | 2418 |
| 2419 Returns: | 2419 Returns: |
| 2420 The numeric port number to which the server is currently bound. | 2420 The numeric port number to which the server is currently bound. |
| 2421 """ | 2421 """ |
| 2422 return self._server.server_address[1] | 2422 return self._server.server_address[1] |
| 2423 | 2423 |
| 2424 | 2424 |
| 2425 if __name__ == '__main__': | 2425 if __name__ == '__main__': |
| 2426 pyauto_functional.Main() | 2426 pyauto_functional.Main() |
| OLD | NEW |