Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from core import perf_benchmark | |
| 6 | |
| 7 from contrib.cluster_telemetry import ct_benchmarks_util | |
| 8 from contrib.cluster_telemetry import page_set | |
| 9 from contrib.cluster_telemetry import repaint_helpers | |
| 10 | |
| 11 from measurements import pixel_diff | |
| 12 | |
| 13 class PixelDiffCT(perf_benchmark.PerfBenchmark): | |
|
nednguyen
2017/06/07 20:32:12
This should inherit s.t like a base CTBenchmark cl
wkorman
2017/06/08 17:57:52
Looks reasonable to me, but propose doing as separ
| |
| 14 """Captures PNG screenshots of web pages for Cluster Telemetry.""" | |
|
wkorman
2017/06/07 20:15:11
Consider adding note that we write to a local file
| |
| 15 | |
| 16 @classmethod | |
| 17 def Name(cls): | |
| 18 return 'pixel_diff_ct' | |
| 19 | |
| 20 @classmethod | |
| 21 def AddBenchmarkCommandLineArgs(cls, parser): | |
| 22 ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser) | |
| 23 parser.add_option('--png-outdir', type='string', | |
| 24 default=None, | |
| 25 help='Output directory for the PNG files') | |
| 26 parser.add_option('--wait-time', type='float', default=0, | |
| 27 help='Wait time before the benchmark is started') | |
| 28 parser.add_option('--disable-javascript', action='store_true', | |
|
wkorman
2017/06/07 20:15:11
Either remove for now or clarify that this is plan
| |
| 29 default=False, | |
| 30 help='Strips out script tags from page if enabled') | |
| 31 | |
| 32 @classmethod | |
| 33 def ProcessCommandLineArgs(cls, parser, args): | |
| 34 ct_benchmarks_util.ValidateCommandLineArgs(parser, args) | |
| 35 if not args.png_outdir: | |
| 36 parser.error('Please specify --png-outdir') | |
| 37 | |
| 38 def CreatePageTest(self, options): | |
| 39 return pixel_diff.PixelDiff(options.png_outdir) | |
| 40 | |
| 41 def CreateStorySet(self, options): | |
| 42 return page_set.CTPageSet( | |
| 43 options.urls_list, options.user_agent, options.archive_data_file, | |
| 44 run_page_interaction_callback=repaint_helpers.WaitThenRepaint) | |
| OLD | NEW |