OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 def testBlankPageScroll(self): | 520 def testBlankPageScroll(self): |
521 """Runs the scroll test on a blank page.""" | 521 """Runs the scroll test on a blank page.""" |
522 self._RunScrollTest( | 522 self._RunScrollTest( |
523 self.GetFileURLForDataPath('scroll', 'blank.html'), 'ScrollBlankPage') | 523 self.GetFileURLForDataPath('scroll', 'blank.html'), 'ScrollBlankPage') |
524 | 524 |
525 def testTextScroll(self): | 525 def testTextScroll(self): |
526 """Runs the scroll test on a text-filled page.""" | 526 """Runs the scroll test on a text-filled page.""" |
527 self._RunScrollTest( | 527 self._RunScrollTest( |
528 self.GetFileURLForDataPath('scroll', 'text.html'), 'ScrollTextPage') | 528 self.GetFileURLForDataPath('scroll', 'text.html'), 'ScrollTextPage') |
529 | 529 |
| 530 def testGooglePlusScroll(self): |
| 531 """Runs the scroll test on a Google Plus anonymized page.""" |
| 532 self._RunScrollTest( |
| 533 self.GetFileURLForDataPath('scroll', 'plus.html'), |
| 534 'ScrollGooglePlusPage') |
| 535 |
530 | 536 |
531 class PerfTestServerRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | 537 class PerfTestServerRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |
532 """Request handler for the local performance test server.""" | 538 """Request handler for the local performance test server.""" |
533 | 539 |
534 def _IgnoreHandler(self, unused_args): | 540 def _IgnoreHandler(self, unused_args): |
535 """A GET request handler that simply replies with status code 200. | 541 """A GET request handler that simply replies with status code 200. |
536 | 542 |
537 Args: | 543 Args: |
538 unused_args: A dictionary of arguments for the current GET request. | 544 unused_args: A dictionary of arguments for the current GET request. |
539 The arguments are ignored. | 545 The arguments are ignored. |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 """Identifies the port number to which the server is currently bound. | 760 """Identifies the port number to which the server is currently bound. |
755 | 761 |
756 Returns: | 762 Returns: |
757 The numeric port number to which the server is currently bound. | 763 The numeric port number to which the server is currently bound. |
758 """ | 764 """ |
759 return self._server.server_address[1] | 765 return self._server.server_address[1] |
760 | 766 |
761 | 767 |
762 if __name__ == '__main__': | 768 if __name__ == '__main__': |
763 pyauto_functional.Main() | 769 pyauto_functional.Main() |
OLD | NEW |