summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 17:37:15 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-28 17:37:15 +0000
commitcfb7e8ebb4f53f13b4b21469c71e90cef60e3bf2 (patch)
tree27611c7618912776169305b5cf75aa0573a5d913 /tools
parent9a0b674e5837269d815fcf07c382cdfe3591428f (diff)
downloadchromium_src-cfb7e8ebb4f53f13b4b21469c71e90cef60e3bf2.zip
chromium_src-cfb7e8ebb4f53f13b4b21469c71e90cef60e3bf2.tar.gz
chromium_src-cfb7e8ebb4f53f13b4b21469c71e90cef60e3bf2.tar.bz2
Android Perf: upstream image_decoding_benchmark using Chrome Remote Control.
We're migrating our bots to use Chrome Remote Control instead of the downstream harness. Start migrating some of the existing tests. BUG=160045 TEST=tools/perf/run_multipage_benchmarks --show-stdout --browser=android-content-shell image_decoding_benchmark tools/perf/page_sets/image_decoding/image_decoding_png.json Review URL: https://chromiumcodereview.appspot.com/11293167 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169986 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/page_sets/simple_image_decoding.json8
-rw-r--r--tools/perf/perf_tools/image_decoding_benchmark.py21
2 files changed, 29 insertions, 0 deletions
diff --git a/tools/perf/page_sets/simple_image_decoding.json b/tools/perf/page_sets/simple_image_decoding.json
new file mode 100644
index 0000000..036233c
--- /dev/null
+++ b/tools/perf/page_sets/simple_image_decoding.json
@@ -0,0 +1,8 @@
+{
+ "description": "A collection of image decoding performance tests",
+ "pages": [
+ {"url": "file:///../../../chrome/test/data/image_decoding/image_decoding.html?gif"},
+ {"url": "file:///../../../chrome/test/data/image_decoding/image_decoding.html?jpg"},
+ {"url": "file:///../../../chrome/test/data/image_decoding/image_decoding.html?png"}
+ ]
+}
diff --git a/tools/perf/perf_tools/image_decoding_benchmark.py b/tools/perf/perf_tools/image_decoding_benchmark.py
new file mode 100644
index 0000000..80aa06c
--- /dev/null
+++ b/tools/perf/perf_tools/image_decoding_benchmark.py
@@ -0,0 +1,21 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from telemetry import multi_page_benchmark
+from telemetry import util
+
+
+class ImageDecoding(multi_page_benchmark.MultiPageBenchmark):
+ def MeasurePage(self, _, tab, results):
+ def _IsDone():
+ return tab.runtime.Evaluate('isDone')
+
+ with tab.timeline.Recorder(tab.timeline):
+ tab.runtime.Execute('runBenchmark()')
+ util.WaitFor(_IsDone, 60)
+ iterations = tab.runtime.Evaluate('minIterations')
+ decode_image = tab.timeline.timeline_events.GetAllOfType('DecodeImage')
+ elapsed_times = [d.elapsed_time for d in decode_image[-iterations:]]
+ image_decoding_avg = sum(elapsed_times) / len(elapsed_times)
+ results.Add('ImageDecoding_avg', 'ms', image_decoding_avg)