summaryrefslogtreecommitdiffstats
path: root/tools/perf/perf_tools
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 00:07:30 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 00:07:30 +0000
commitea980d2ee55bb4a9207608f5194594675f79d133 (patch)
tree1fe84cde06e9b90471777a6b619539352b6ef70a /tools/perf/perf_tools
parent3a2b2b5c2ab0d633b6ce072074acc4d40b07d00b (diff)
downloadchromium_src-ea980d2ee55bb4a9207608f5194594675f79d133.zip
chromium_src-ea980d2ee55bb4a9207608f5194594675f79d133.tar.gz
chromium_src-ea980d2ee55bb4a9207608f5194594675f79d133.tar.bz2
Automate JSGameBench with Chrome Remote Control.
BUG=124813 TEST=Manual on linux Review URL: https://codereview.chromium.org/11364037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf/perf_tools')
-rw-r--r--tools/perf/perf_tools/jsgamebench.py19
-rwxr-xr-xtools/perf/perf_tools/multipage_benchmark_runner.py3
2 files changed, 22 insertions, 0 deletions
diff --git a/tools/perf/perf_tools/jsgamebench.py b/tools/perf/perf_tools/jsgamebench.py
new file mode 100644
index 0000000..d311f2c
--- /dev/null
+++ b/tools/perf/perf_tools/jsgamebench.py
@@ -0,0 +1,19 @@
+# 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 chrome_remote_control import multi_page_benchmark
+from chrome_remote_control import util
+
+class JsGameBench(multi_page_benchmark.MultiPageBenchmark):
+ def MeasurePage(self, _, tab, results):
+ tab.runtime.Execute('UI.call({}, "perftest")')
+
+ js_is_done = 'document.getElementById("perfscore0") != null'
+ def _IsDone():
+ return bool(tab.runtime.Evaluate(js_is_done))
+ util.WaitFor(_IsDone, 600)
+
+ js_get_results = 'document.getElementById("perfscore0").innerHTML'
+ result = int(tab.runtime.Evaluate(js_get_results))
+ results.Add('Score', 'score (bigger is better)', result)
diff --git a/tools/perf/perf_tools/multipage_benchmark_runner.py b/tools/perf/perf_tools/multipage_benchmark_runner.py
index e390bb4..4d082c3 100755
--- a/tools/perf/perf_tools/multipage_benchmark_runner.py
+++ b/tools/perf/perf_tools/multipage_benchmark_runner.py
@@ -14,6 +14,7 @@ from chrome_remote_control import page_runner
from chrome_remote_control import page_set
import perf_tools.first_paint_time_benchmark
+import perf_tools.jsgamebench
import perf_tools.kraken
import perf_tools.robohornetpro
import perf_tools.scrolling_benchmark
@@ -24,6 +25,8 @@ import perf_tools.texture_upload_benchmark
_BENCHMARKS = {
'first_paint_time_benchmark':
perf_tools.first_paint_time_benchmark.FirstPaintTimeBenchmark,
+ 'jsgamebench':
+ perf_tools.jsgamebench.JsGameBench,
'kraken':
perf_tools.kraken.Kraken,
'robohornetpro':