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

Side by Side Diff: tools/perf/perf_tools/scrolling_benchmark.py

Issue 11273081: Adding a test for measuring memory usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 os 4 import os
5 5
6 from telemetry import multi_page_benchmark 6 from telemetry import multi_page_benchmark
7 from telemetry import util 7 from telemetry import util
8 8
9 class DidNotScrollException(multi_page_benchmark.MeasurementFailure): 9 class DidNotScrollException(multi_page_benchmark.MeasurementFailure):
10 def __init__(self): 10 def __init__(self):
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 util.WaitFor(lambda: tab.runtime.Evaluate( 69 util.WaitFor(lambda: tab.runtime.Evaluate(
70 'window.__renderingStatsDeltas'), 60) 70 'window.__renderingStatsDeltas'), 60)
71 71
72 rendering_stats_deltas = tab.runtime.Evaluate( 72 rendering_stats_deltas = tab.runtime.Evaluate(
73 'window.__renderingStatsDeltas') 73 'window.__renderingStatsDeltas')
74 74
75 if not (rendering_stats_deltas['numFramesSentToScreen'] > 0): 75 if not (rendering_stats_deltas['numFramesSentToScreen'] > 0):
76 raise DidNotScrollException() 76 raise DidNotScrollException()
77 return rendering_stats_deltas 77 return rendering_stats_deltas
78 78
79 def CustomizeBrowserOptions(self, options): 79 def CustomizeBrowserOptions(self, pages, options):
80 if not options.no_gpu_benchmarking_extension: 80 if not options.no_gpu_benchmarking_extension:
81 options.extra_browser_args.append('--enable-gpu-benchmarking') 81 options.extra_browser_args.append('--enable-gpu-benchmarking')
82 82
83 def MeasurePage(self, page, tab, results): 83 def MeasurePage(self, page, tab, results):
84 rendering_stats_deltas = self.ScrollPageFully(page, tab) 84 rendering_stats_deltas = self.ScrollPageFully(page, tab)
85 CalcScrollResults(rendering_stats_deltas, results) 85 CalcScrollResults(rendering_stats_deltas, results)
86 if self.options.report_all_results: 86 if self.options.report_all_results:
87 for k, v in rendering_stats_deltas.iteritems(): 87 for k, v in rendering_stats_deltas.iteritems():
88 results.Add(k, '', v) 88 results.Add(k, '', v)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698