| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 4 |
| 5 import logging | 5 import logging |
| 6 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 import time | 9 import time |
| 10 | 10 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 if not state: | 225 if not state: |
| 226 # Construct shared state by using a copy of finder_options. Shared | 226 # Construct shared state by using a copy of finder_options. Shared |
| 227 # state may update the finder_options. If we tear down the shared | 227 # state may update the finder_options. If we tear down the shared |
| 228 # state after this story run, we want to construct the shared | 228 # state after this story run, we want to construct the shared |
| 229 # state for the next story from the original finder_options. | 229 # state for the next story from the original finder_options. |
| 230 state = group.shared_state_class( | 230 state = group.shared_state_class( |
| 231 test, finder_options.Copy(), story_set) | 231 test, finder_options.Copy(), story_set) |
| 232 | 232 |
| 233 results.WillRunPage(story, storyset_repeat_counter) | 233 results.WillRunPage(story, storyset_repeat_counter) |
| 234 try: | 234 try: |
| 235 state.platform.WaitForTemperature(35) | 235 state.platform.WaitForBatteryTemperature(35) |
| 236 _WaitForThermalThrottlingIfNeeded(state.platform) | 236 _WaitForThermalThrottlingIfNeeded(state.platform) |
| 237 _RunStoryAndProcessErrorIfNeeded(story, results, state, test) | 237 _RunStoryAndProcessErrorIfNeeded(story, results, state, test) |
| 238 except exceptions.Error: | 238 except exceptions.Error: |
| 239 # Catch all Telemetry errors to give the story a chance to retry. | 239 # Catch all Telemetry errors to give the story a chance to retry. |
| 240 # The retry is enabled by tearing down the state and creating | 240 # The retry is enabled by tearing down the state and creating |
| 241 # a new state instance in the next iteration. | 241 # a new state instance in the next iteration. |
| 242 try: | 242 try: |
| 243 # If TearDownState raises, do not catch the exception. | 243 # If TearDownState raises, do not catch the exception. |
| 244 # (The Error was saved as a failure value.) | 244 # (The Error was saved as a failure value.) |
| 245 state.TearDownState() | 245 state.TearDownState() |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 logging.warning('Device is thermally throttled before running ' | 454 logging.warning('Device is thermally throttled before running ' |
| 455 'performance tests, results will vary.') | 455 'performance tests, results will vary.') |
| 456 | 456 |
| 457 | 457 |
| 458 def _CheckThermalThrottling(platform): | 458 def _CheckThermalThrottling(platform): |
| 459 if not platform.CanMonitorThermalThrottling(): | 459 if not platform.CanMonitorThermalThrottling(): |
| 460 return | 460 return |
| 461 if platform.HasBeenThermallyThrottled(): | 461 if platform.HasBeenThermallyThrottled(): |
| 462 logging.warning('Device has been thermally throttled during ' | 462 logging.warning('Device has been thermally throttled during ' |
| 463 'performance tests, results will vary.') | 463 'performance tests, results will vary.') |
| OLD | NEW |