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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 # Create a tab if there's none. | 86 # Create a tab if there's none. |
87 if len(self.browser.tabs) == 0: | 87 if len(self.browser.tabs) == 0: |
88 self.browser.tabs.New() | 88 self.browser.tabs.New() |
89 | 89 |
90 # Ensure only one tab is open, unless the test is a multi-tab test. | 90 # Ensure only one tab is open, unless the test is a multi-tab test. |
91 if not test.is_multi_tab_test: | 91 if not test.is_multi_tab_test: |
92 while len(self.browser.tabs) > 1: | 92 while len(self.browser.tabs) > 1: |
93 self.browser.tabs[-1].Close() | 93 self.browser.tabs[-1].Close() |
94 | 94 |
95 # Must wait for tab to commit otherwise it can commit after the next | 95 # Must wait for tab to commit otherwise it can commit after the next |
96 # navigation has begun and RenderViewHostManager::DidNavigateMainFrame() | 96 # navigation has begun and RenderFrameHostManager::DidNavigateMainFrame() |
97 # will cancel the next navigation because it's pending. This manifests as | 97 # will cancel the next navigation because it's pending. This manifests as |
98 # the first navigation in a PageSet freezing indefinitly because the | 98 # the first navigation in a PageSet freezing indefinitly because the |
99 # navigation was silently cancelled when |self.browser.tabs[0]| was | 99 # navigation was silently cancelled when |self.browser.tabs[0]| was |
100 # committed. Only do this when we just started the browser, otherwise | 100 # committed. Only do this when we just started the browser, otherwise |
101 # there are cases where previous pages in a PageSet never complete | 101 # there are cases where previous pages in a PageSet never complete |
102 # loading so we'll wait forever. | 102 # loading so we'll wait forever. |
103 if started_browser: | 103 if started_browser: |
104 self.browser.tabs[0].WaitForDocumentReadyStateToBeComplete() | 104 self.browser.tabs[0].WaitForDocumentReadyStateToBeComplete() |
105 | 105 |
106 if self.first_page[page]: | 106 if self.first_page[page]: |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 logging.error('Device is thermally throttled before running ' | 493 logging.error('Device is thermally throttled before running ' |
494 'performance tests, results will vary.') | 494 'performance tests, results will vary.') |
495 | 495 |
496 | 496 |
497 def _CheckThermalThrottling(platform): | 497 def _CheckThermalThrottling(platform): |
498 if not platform.CanMonitorThermalThrottling(): | 498 if not platform.CanMonitorThermalThrottling(): |
499 return | 499 return |
500 if platform.HasBeenThermallyThrottled(): | 500 if platform.HasBeenThermallyThrottled(): |
501 logging.error('Device has been thermally throttled during ' | 501 logging.error('Device has been thermally throttled during ' |
502 'performance tests, results will vary.') | 502 'performance tests, results will vary.') |
OLD | NEW |