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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 def ExtraChromeFlags(self): | 657 def ExtraChromeFlags(self): |
658 """Ensures Chrome is launched with custom flags. | 658 """Ensures Chrome is launched with custom flags. |
659 | 659 |
660 Returns: | 660 Returns: |
661 A list of extra flags to pass to Chrome when it is launched. | 661 A list of extra flags to pass to Chrome when it is launched. |
662 """ | 662 """ |
663 flags = super(BasePerfTest, self).ExtraChromeFlags() | 663 flags = super(BasePerfTest, self).ExtraChromeFlags() |
664 # Window size impacts a variety of perf tests, ensure consistency. | 664 # Window size impacts a variety of perf tests, ensure consistency. |
665 flags.append('--window-size=1024,768') | 665 flags.append('--window-size=1024,768') |
666 if self._IsPGOMode(): | 666 if self._IsPGOMode(): |
667 flags = flags + ['--renderer-clean-exit', '--no-sandbox'] | 667 flags = flags + ['--child-clean-exit', '--no-sandbox'] |
668 return flags | 668 return flags |
669 | 669 |
670 | 670 |
671 class TabPerfTest(BasePerfTest): | 671 class TabPerfTest(BasePerfTest): |
672 """Tests that involve opening tabs.""" | 672 """Tests that involve opening tabs.""" |
673 | 673 |
674 def testNewTab(self): | 674 def testNewTab(self): |
675 """Measures time to open a new tab.""" | 675 """Measures time to open a new tab.""" |
676 self._RunNewTabTest('NewTabPage', | 676 self._RunNewTabTest('NewTabPage', |
677 lambda: self._AppendTab('chrome://newtab'), 'open_tab') | 677 lambda: self._AppendTab('chrome://newtab'), 'open_tab') |
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2611 """Identifies the port number to which the server is currently bound. | 2611 """Identifies the port number to which the server is currently bound. |
2612 | 2612 |
2613 Returns: | 2613 Returns: |
2614 The numeric port number to which the server is currently bound. | 2614 The numeric port number to which the server is currently bound. |
2615 """ | 2615 """ |
2616 return self._server.server_address[1] | 2616 return self._server.server_address[1] |
2617 | 2617 |
2618 | 2618 |
2619 if __name__ == '__main__': | 2619 if __name__ == '__main__': |
2620 pyauto_functional.Main() | 2620 pyauto_functional.Main() |
OLD | NEW |