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 """PyAuto: Python Interface to Chromium's Automation Proxy. | 6 """PyAuto: Python Interface to Chromium's Automation Proxy. |
7 | 7 |
8 PyAuto uses swig to expose Automation Proxy interfaces to Python. | 8 PyAuto uses swig to expose Automation Proxy interfaces to Python. |
9 For complete documentation on the functionality available, | 9 For complete documentation on the functionality available, |
10 run pydoc on this file. | 10 run pydoc on this file. |
(...skipping 5413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5424 for measurement_type in stats: | 5424 for measurement_type in stats: |
5425 values = stats[measurement_type] | 5425 values = stats[measurement_type] |
5426 result[measurement_type] = { | 5426 result[measurement_type] = { |
5427 'min': min(values), | 5427 'min': min(values), |
5428 'max': max(values), | 5428 'max': max(values), |
5429 'end': values[-1], | 5429 'end': values[-1], |
5430 } | 5430 } |
5431 | 5431 |
5432 return result | 5432 return result |
5433 | 5433 |
| 5434 def ApplyAshAccelerator(self, action): |
| 5435 cmd_dict = { |
| 5436 'command': 'ApplyAshAccelerator', |
| 5437 'action': action |
| 5438 } |
| 5439 return self._GetResultFromJSONRequest(cmd_dict, windex=None) |
| 5440 |
5434 ## ChromeOS section -- end | 5441 ## ChromeOS section -- end |
5435 | 5442 |
5436 | 5443 |
5437 class ExtraBrowser(PyUITest): | 5444 class ExtraBrowser(PyUITest): |
5438 """Launches a new browser with some extra flags. | 5445 """Launches a new browser with some extra flags. |
5439 | 5446 |
5440 The new browser is launched with its own fresh profile. | 5447 The new browser is launched with its own fresh profile. |
5441 This class does not apply to ChromeOS. | 5448 This class does not apply to ChromeOS. |
5442 """ | 5449 """ |
5443 def __init__(self, chrome_flags=[], methodName='runTest', **kwargs): | 5450 def __init__(self, chrome_flags=[], methodName='runTest', **kwargs): |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6002 successful = result.wasSuccessful() | 6009 successful = result.wasSuccessful() |
6003 if not successful: | 6010 if not successful: |
6004 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) | 6011 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) |
6005 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ | 6012 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ |
6006 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) | 6013 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) |
6007 sys.exit(not successful) | 6014 sys.exit(not successful) |
6008 | 6015 |
6009 | 6016 |
6010 if __name__ == '__main__': | 6017 if __name__ == '__main__': |
6011 Main() | 6018 Main() |
OLD | NEW |