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 collections | 5 import collections |
6 import logging | 6 import logging |
7 import optparse | 7 import optparse |
8 import os | 8 import os |
9 import random | 9 import random |
10 import sys | 10 import sys |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 # Support overriding this from the command line. | 416 # Support overriding this from the command line. |
417 max_failures = finder_options.max_failures | 417 max_failures = finder_options.max_failures |
418 | 418 |
419 try: | 419 try: |
420 test.WillRunTest(finder_options) | 420 test.WillRunTest(finder_options) |
421 for _ in xrange(0, finder_options.pageset_repeat): | 421 for _ in xrange(0, finder_options.pageset_repeat): |
422 for page in pages: | 422 for page in pages: |
423 if test.IsExiting(): | 423 if test.IsExiting(): |
424 break | 424 break |
425 | 425 |
426 test.WillRunPageRepeats(page) | |
427 for _ in xrange(0, finder_options.page_repeat): | 426 for _ in xrange(0, finder_options.page_repeat): |
428 results.WillRunPage(page) | 427 results.WillRunPage(page) |
429 try: | 428 try: |
430 _PrepareAndRunPage( | 429 _PrepareAndRunPage( |
431 test, page_set, expectations, finder_options, browser_options, | 430 test, page_set, expectations, finder_options, browser_options, |
432 page, credentials_path, possible_browser, results, state) | 431 page, credentials_path, possible_browser, results, state) |
433 finally: | 432 finally: |
434 discard_run = False | 433 discard_run = False |
435 if state.first_page[page]: | 434 if state.first_page[page]: |
436 state.first_page[page] = False | 435 state.first_page[page] = False |
437 if test.discard_first_result: | 436 if test.discard_first_result: |
438 discard_run = True | 437 discard_run = True |
439 results.DidRunPage(page, discard_run=discard_run) | 438 results.DidRunPage(page, discard_run=discard_run) |
440 test.DidRunPageRepeats(page) | |
441 if (not max_failures is None and | 439 if (not max_failures is None and |
442 len(results.failures) > max_failures): | 440 len(results.failures) > max_failures): |
443 logging.error('Too many failures. Aborting.') | 441 logging.error('Too many failures. Aborting.') |
444 test.RequestExit() | 442 test.RequestExit() |
445 | 443 |
446 finally: | 444 finally: |
447 test.DidRunTest(state.browser, results) | 445 test.DidRunTest(state.browser, results) |
448 state.StopBrowser() | 446 state.StopBrowser() |
449 | 447 |
450 return | 448 return |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 logging.warning('Device is thermally throttled before running ' | 584 logging.warning('Device is thermally throttled before running ' |
587 'performance tests, results will vary.') | 585 'performance tests, results will vary.') |
588 | 586 |
589 | 587 |
590 def _CheckThermalThrottling(platform): | 588 def _CheckThermalThrottling(platform): |
591 if not platform.CanMonitorThermalThrottling(): | 589 if not platform.CanMonitorThermalThrottling(): |
592 return | 590 return |
593 if platform.HasBeenThermallyThrottled(): | 591 if platform.HasBeenThermallyThrottled(): |
594 logging.warning('Device has been thermally throttled during ' | 592 logging.warning('Device has been thermally throttled during ' |
595 'performance tests, results will vary.') | 593 'performance tests, results will vary.') |
OLD | NEW |