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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 'aquarium.html'), | 652 'aquarium.html'), |
653 'WebGLAquarium') | 653 'WebGLAquarium') |
654 | 654 |
655 def testWebGLField(self): | 655 def testWebGLField(self): |
656 """Measures performance using the WebGL Field demo.""" | 656 """Measures performance using the WebGL Field demo.""" |
657 self._RunWebGLTest( | 657 self._RunWebGLTest( |
658 self.GetFileURLForDataPath('pyauto_private', 'webgl', 'field', | 658 self.GetFileURLForDataPath('pyauto_private', 'webgl', 'field', |
659 'field.html'), | 659 'field.html'), |
660 'WebGLField') | 660 'WebGLField') |
661 | 661 |
| 662 def testWebGLSpaceRocks(self): |
| 663 """Measures performance using the WebGL SpaceRocks demo.""" |
| 664 self._RunWebGLTest( |
| 665 self.GetFileURLForDataPath('pyauto_private', 'webgl', 'spacerocks', |
| 666 'spacerocks.html'), |
| 667 'WebGLSpaceRocks') |
| 668 |
662 | 669 |
663 class FileUploadDownloadTest(BasePerfTest): | 670 class FileUploadDownloadTest(BasePerfTest): |
664 """Tests that involve measuring performance of upload and download.""" | 671 """Tests that involve measuring performance of upload and download.""" |
665 | 672 |
666 def setUp(self): | 673 def setUp(self): |
667 """Performs necessary setup work before running each test in this class.""" | 674 """Performs necessary setup work before running each test in this class.""" |
668 self._temp_dir = tempfile.mkdtemp() | 675 self._temp_dir = tempfile.mkdtemp() |
669 self._test_server = PerfTestServer(self._temp_dir) | 676 self._test_server = PerfTestServer(self._temp_dir) |
670 self._test_server_port = self._test_server.GetPort() | 677 self._test_server_port = self._test_server.GetPort() |
671 self._test_server.Run() | 678 self._test_server.Run() |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 """Identifies the port number to which the server is currently bound. | 1324 """Identifies the port number to which the server is currently bound. |
1318 | 1325 |
1319 Returns: | 1326 Returns: |
1320 The numeric port number to which the server is currently bound. | 1327 The numeric port number to which the server is currently bound. |
1321 """ | 1328 """ |
1322 return self._server.server_address[1] | 1329 return self._server.server_address[1] |
1323 | 1330 |
1324 | 1331 |
1325 if __name__ == '__main__': | 1332 if __name__ == '__main__': |
1326 pyauto_functional.Main() | 1333 pyauto_functional.Main() |
OLD | NEW |