diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-05 02:37:36 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-05 02:37:36 +0000 |
commit | ae9aa3daf18a85334b5d3fb56a477aee1b315e02 (patch) | |
tree | df97e1fc1c1fa7d58de49b885d3cf8c2b18ad9ee /tools/perf | |
parent | d7620b6aa8b7c34c7c7d3ae4c8ab0707356c4b66 (diff) | |
download | chromium_src-ae9aa3daf18a85334b5d3fb56a477aee1b315e02.zip chromium_src-ae9aa3daf18a85334b5d3fb56a477aee1b315e02.tar.gz chromium_src-ae9aa3daf18a85334b5d3fb56a477aee1b315e02.tar.bz2 |
Clear image cache before running a benchmark
Added this JS benchmarking API to clear image cache:
chrome.gpuBenchmarkingExtension.clearImageCache
Used this API to clear image cahe for these measurements:
image_decoding_measurement
rasterize_and_record_benchmark
BUG=241943
Review URL: https://chromiumcodereview.appspot.com/15801004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204132 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/perf_tools/image_decoding_measurement.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/perf/perf_tools/image_decoding_measurement.py b/tools/perf/perf_tools/image_decoding_measurement.py index 4da7838..c0351fef 100644 --- a/tools/perf/perf_tools/image_decoding_measurement.py +++ b/tools/perf/perf_tools/image_decoding_measurement.py @@ -6,9 +6,26 @@ from telemetry.page import page_measurement class ImageDecoding(page_measurement.PageMeasurement): + def CustomizeBrowserOptions(self, options): + options.extra_browser_args.append('--enable-gpu-benchmarking') + def WillNavigateToPage(self, page, tab): + tab.ExecuteJavaScript(""" + if (window.chrome && + chrome.gpuBenchmarking && + chrome.gpuBenchmarking.clearImageCache) { + chrome.gpuBenchmarking.clearImageCache(); + } + """) tab.StartTimelineRecording() + def NeedsBrowserRestartAfterEachRun(self, tab): + return not tab.ExecuteJavaScript(""" + window.chrome && + chrome.gpuBenchmarking && + chrome.gpuBenchmarking.clearImageCache; + """) + def MeasurePage(self, page, tab, results): tab.StopTimelineRecording() def _IsDone(): |