Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: tools/perf/contrib/cluster_telemetry/screenshot_ct.py

Issue 2923163007: Implemented telemetry benchmark that loads page and outputs screenshot. (Closed)
Patch Set: Removed mtime, saved_picture_count, javascript flag, Edited unittest Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 from contrib.cluster_telemetry import screenshot
11
12 class ScreenshotCT(perf_benchmark.PerfBenchmark):
13 """Captures PNG screenshots of web pages for Cluster Telemetry. Screenshots
14 written to local file with path-safe urls of pages as filenames. Cluster
15 Telemetry is then used for aggregation and analysis."""
16
17 @classmethod
18 def Name(cls):
19 return 'screenshot_ct'
20
21 @classmethod
22 def AddBenchmarkCommandLineArgs(cls, parser):
23 ct_benchmarks_util.AddBenchmarkCommandLineArgs(parser)
24 parser.add_option('--png-outdir', type='string',
25 default=None,
26 help='Output directory for the PNG files')
27 parser.add_option('--wait-time', type='float', default=0,
28 help='Wait time before the benchmark is started')
29
30 @classmethod
31 def ProcessCommandLineArgs(cls, parser, args):
32 ct_benchmarks_util.ValidateCommandLineArgs(parser, args)
33 if not args.png_outdir:
34 parser.error('Please specify --png-outdir')
35
36 def CreatePageTest(self, options):
37 return screenshot.Screenshot(options.png_outdir)
38
39 def CreateStorySet(self, options):
40 return page_set.CTPageSet(
41 options.urls_list, options.user_agent, options.archive_data_file,
42 run_page_interaction_callback=repaint_helpers.WaitThenRepaint)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698