| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 import collections | 4 import collections |
| 5 import glob | 5 import glob |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 import tempfile | 9 import tempfile |
| 10 import time | 10 import time |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 self.browser = None | 31 self.browser = None |
| 32 | 32 |
| 33 self._append_to_existing_wpr = False | 33 self._append_to_existing_wpr = False |
| 34 self._last_archive_path = None | 34 self._last_archive_path = None |
| 35 self._first_browser = True | 35 self._first_browser = True |
| 36 self.first_page = collections.defaultdict(lambda: True) | 36 self.first_page = collections.defaultdict(lambda: True) |
| 37 self.profiler_dir = None | 37 self.profiler_dir = None |
| 38 self.repeat_state = None | 38 self.repeat_state = None |
| 39 | 39 |
| 40 def StartBrowserIfNeeded(self, test, page_set, page, possible_browser, | 40 def StartBrowserIfNeeded(self, test, page_set, page, possible_browser, |
| 41 credentials_path, archive_path): | 41 credentials_path, archive_path): |
| 42 started_browser = not self.browser | 42 started_browser = not self.browser |
| 43 # Create a browser. | 43 # Create a browser. |
| 44 if not self.browser: | 44 if not self.browser: |
| 45 test.CustomizeBrowserOptionsForSinglePage(page, | 45 test.CustomizeBrowserOptionsForSinglePage(page, |
| 46 possible_browser.finder_options) | 46 possible_browser.finder_options) |
| 47 self.browser = possible_browser.Create() | 47 self.browser = possible_browser.Create() |
| 48 self.browser.credentials.credentials_path = credentials_path | 48 self.browser.credentials.credentials_path = credentials_path |
| 49 | 49 |
| 50 # Set up WPR path on the new browser. | 50 # Set up WPR path on the new browser. |
| 51 self.browser.SetReplayArchivePath(archive_path, | 51 self.browser.SetReplayArchivePath(archive_path, |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 logging.error('Device is thermally throttled before running ' | 505 logging.error('Device is thermally throttled before running ' |
| 506 'performance tests, results will vary.') | 506 'performance tests, results will vary.') |
| 507 | 507 |
| 508 | 508 |
| 509 def _CheckThermalThrottling(platform): | 509 def _CheckThermalThrottling(platform): |
| 510 if not platform.CanMonitorThermalThrottling(): | 510 if not platform.CanMonitorThermalThrottling(): |
| 511 return | 511 return |
| 512 if platform.HasBeenThermallyThrottled(): | 512 if platform.HasBeenThermallyThrottled(): |
| 513 logging.error('Device has been thermally throttled during ' | 513 logging.error('Device has been thermally throttled during ' |
| 514 'performance tests, results will vary.') | 514 'performance tests, results will vary.') |
| OLD | NEW |