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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
201 'what is specified by --page-repeat and --pageset-repeat.') | 201 'what is specified by --page-repeat and --pageset-repeat.') |
202 group.add_option('--page-repeat', default=1, type='int', | 202 group.add_option('--page-repeat', default=1, type='int', |
203 help='Number of times to repeat each individual page ' | 203 help='Number of times to repeat each individual page ' |
204 'before proceeding with the next page in the pageset.') | 204 'before proceeding with the next page in the pageset.') |
205 group.add_option('--pageset-repeat', default=1, type='int', | 205 group.add_option('--pageset-repeat', default=1, type='int', |
206 help='Number of times to repeat the entire pageset.') | 206 help='Number of times to repeat the entire pageset.') |
207 group.add_option('--max-failures', default=None, type='int', | 207 group.add_option('--max-failures', default=None, type='int', |
208 help='Maximum number of test failures before aborting ' | 208 help='Maximum number of test failures before aborting ' |
209 'the run. Defaults to the number specified by the ' | 209 'the run. Defaults to the number specified by the ' |
210 'PageTest.') | 210 'PageTest.') |
211 group.add_option('--pageset-replicate', default=1, type='int', | |
tonyg
2014/09/29 16:54:09
It's not clear from this description why this is d
aiolos (Not reviewing)
2015/04/03 18:16:39
It's also unclear to me why this is different.
| |
212 help='Number of times the page set should be replicated ' | |
213 '(for multi-tab tests). Defaults to 1') | |
214 group.add_option('--pageset-truncate', default=sys.maxint, type='int', | |
aiolos (Not reviewing)
2015/04/03 18:16:39
This logic shouldn't be here if it's needed and I'
| |
215 help='Maximum size of page set after replication (for ' | |
216 'multi-tab tests). Defaults to MAXINT and has no effect ' | |
217 'if larger than the size of the replicated page set.') | |
211 parser.add_option_group(group) | 218 parser.add_option_group(group) |
212 | 219 |
213 # WPR options | 220 # WPR options |
214 group = optparse.OptionGroup(parser, 'Web Page Replay options') | 221 group = optparse.OptionGroup(parser, 'Web Page Replay options') |
215 group.add_option('--use-live-sites', | 222 group.add_option('--use-live-sites', |
216 dest='use_live_sites', action='store_true', | 223 dest='use_live_sites', action='store_true', |
217 help='Run against live sites and ignore the Web Page Replay archives.') | 224 help='Run against live sites and ignore the Web Page Replay archives.') |
218 parser.add_option_group(group) | 225 parser.add_option_group(group) |
219 | 226 |
220 parser.add_option('-d', '--also-run-disabled-tests', | 227 parser.add_option('-d', '--also-run-disabled-tests', |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 | 370 |
364 if not should_run: | 371 if not should_run: |
365 logging.warning('You are trying to run a disabled test.') | 372 logging.warning('You are trying to run a disabled test.') |
366 logging.warning('Pass --also-run-disabled-tests to squelch this message.') | 373 logging.warning('Pass --also-run-disabled-tests to squelch this message.') |
367 return | 374 return |
368 | 375 |
369 if possible_browser.IsRemote(): | 376 if possible_browser.IsRemote(): |
370 possible_browser.RunRemote() | 377 possible_browser.RunRemote() |
371 sys.exit(0) | 378 sys.exit(0) |
372 | 379 |
380 # Replicate page set as requested. | |
381 page_set.pages *= finder_options.pageset_replicate | |
382 | |
383 # Truncate the page set to the given number of pages. | |
384 page_set.pages = page_set.pages[:finder_options.pageset_truncate] | |
385 | |
373 # Reorder page set based on options. | 386 # Reorder page set based on options. |
374 pages = _ShuffleAndFilterPageSet(page_set, finder_options) | 387 pages = _ShuffleAndFilterPageSet(page_set, finder_options) |
375 | 388 |
376 if not finder_options.use_live_sites: | 389 if not finder_options.use_live_sites: |
377 _UpdateCredentials(page_set) | 390 _UpdateCredentials(page_set) |
378 if browser_options.wpr_mode != wpr_modes.WPR_RECORD: | 391 if browser_options.wpr_mode != wpr_modes.WPR_RECORD: |
379 _UpdatePageSetArchivesIfChanged(page_set) | 392 _UpdatePageSetArchivesIfChanged(page_set) |
380 pages = _CheckArchives(page_set, pages, results) | 393 pages = _CheckArchives(page_set, pages, results) |
381 | 394 |
382 # Verify credentials path. | 395 # Verify credentials path. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 logging.warning('Device is thermally throttled before running ' | 597 logging.warning('Device is thermally throttled before running ' |
585 'performance tests, results will vary.') | 598 'performance tests, results will vary.') |
586 | 599 |
587 | 600 |
588 def _CheckThermalThrottling(platform): | 601 def _CheckThermalThrottling(platform): |
589 if not platform.CanMonitorThermalThrottling(): | 602 if not platform.CanMonitorThermalThrottling(): |
590 return | 603 return |
591 if platform.HasBeenThermallyThrottled(): | 604 if platform.HasBeenThermallyThrottled(): |
592 logging.warning('Device has been thermally throttled during ' | 605 logging.warning('Device has been thermally throttled during ' |
593 'performance tests, results will vary.') | 606 'performance tests, results will vary.') |
OLD | NEW |