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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
682 os.path.exists(os.path.join(self.DataDir(), 'pyauto_private', 'pdf', | 682 os.path.exists(os.path.join(self.DataDir(), 'pyauto_private', 'pdf', |
683 'TechCrunch.pdf')), | 683 'TechCrunch.pdf')), |
684 msg='Missing required PDF data file.') | 684 msg='Missing required PDF data file.') |
685 url = self.GetFileURLForDataPath('pyauto_private', 'pdf', 'TechCrunch.pdf') | 685 url = self.GetFileURLForDataPath('pyauto_private', 'pdf', 'TechCrunch.pdf') |
686 self._RunNewTabTest('NewTabPdfPage', lambda: self._AppendTab(url), | 686 self._RunNewTabTest('NewTabPdfPage', lambda: self._AppendTab(url), |
687 'open_tab') | 687 'open_tab') |
688 | 688 |
689 def testNewTabFlash(self): | 689 def testNewTabFlash(self): |
690 """Measures time to open a new tab navigated to a flash page.""" | 690 """Measures time to open a new tab navigated to a flash page.""" |
691 self.assertTrue( | 691 self.assertTrue( |
692 os.path.exists(os.path.join(self.DataDir(), 'plugin', 'flash.swf')), | 692 os.path.exists(os.path.join(self.ContentDataDir(), 'plugin', |
693 'flash.swf')), | |
693 msg='Missing required flash data file.') | 694 msg='Missing required flash data file.') |
694 url = self.GetFileURLForDataPath('plugin', 'flash.swf') | 695 url = self.GetFileURLForContentDataPath('plugin', 'flash.swf') |
dennis_jeffrey
2012/07/30 18:55:20
not for this CL, but would it be worthwhile changi
| |
695 self._RunNewTabTest('NewTabFlashPage', lambda: self._AppendTab(url), | 696 self._RunNewTabTest('NewTabFlashPage', lambda: self._AppendTab(url), |
696 'open_tab') | 697 'open_tab') |
697 | 698 |
698 def test20Tabs(self): | 699 def test20Tabs(self): |
699 """Measures time to open 20 tabs.""" | 700 """Measures time to open 20 tabs.""" |
700 self._RunNewTabTest('20TabsNewTabPage', | 701 self._RunNewTabTest('20TabsNewTabPage', |
701 lambda: self._AppendTab('chrome://newtab'), | 702 lambda: self._AppendTab('chrome://newtab'), |
702 'open_20_tabs', num_tabs=20) | 703 'open_20_tabs', num_tabs=20) |
703 | 704 |
704 | 705 |
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2611 """Identifies the port number to which the server is currently bound. | 2612 """Identifies the port number to which the server is currently bound. |
2612 | 2613 |
2613 Returns: | 2614 Returns: |
2614 The numeric port number to which the server is currently bound. | 2615 The numeric port number to which the server is currently bound. |
2615 """ | 2616 """ |
2616 return self._server.server_address[1] | 2617 return self._server.server_address[1] |
2617 | 2618 |
2618 | 2619 |
2619 if __name__ == '__main__': | 2620 if __name__ == '__main__': |
2620 pyauto_functional.Main() | 2621 pyauto_functional.Main() |
OLD | NEW |