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

Unified Diff: tools/perf/perf_tools/spaceport.py

Issue 11314012: Add spaceport benchmark to Chrome Remote Control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bug 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/page_sets/spaceport.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/perf_tools/spaceport.py
diff --git a/tools/perf/perf_tools/spaceport.py b/tools/perf/perf_tools/spaceport.py
new file mode 100644
index 0000000000000000000000000000000000000000..b2484592fb3fc9e75ff0b1408b037f95cdfc4b8a
--- /dev/null
+++ b/tools/perf/perf_tools/spaceport.py
@@ -0,0 +1,37 @@
+# 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 SpaceportBenchmark(multi_page_benchmark.MultiPageBenchmark):
+ def CustomizeBrowserOptions(self, options):
+ options.extra_browser_args.extend(['--disable-gpu-vsync'])
+
+ def MeasurePage(self, _, tab, results):
+ tab.runtime.Execute("""
+ window.__results = {};
+ window.console.log = function(str) {
+ if (!str) return;
+ var key_val = str.split(': ');
+ if (!key_val.length == 2) return;
+ __results[key_val[0]] = key_val[1];
+ };
+ document.getElementById('start-performance-tests').click();
+ """)
+
+ js_get_results = 'JSON.stringify(window.__results)'
+ def _IsDone():
+ num_tests_in_benchmark = 30
+ result_dict = eval(tab.runtime.Evaluate(js_get_results))
+ return num_tests_in_benchmark == len(result_dict)
+ util.WaitFor(_IsDone, 1200)
+
+ result_dict = eval(tab.runtime.Evaluate(js_get_results))
+ for key in result_dict:
+ chart, trace = key.split('.', 1)
+ results.Add(trace, 'objects (bigger is better)', float(result_dict[key]),
+ chart_name=chart, data_type='unimportant')
+ results.Add('Overall', 'objects (bigger is better)',
+ [float(x) for x in result_dict.values()])
« no previous file with comments | « tools/perf/page_sets/spaceport.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698