OLD | NEW |
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 | 4 |
5 from chrome_remote_control import multi_page_benchmark | 5 from telemetry import multi_page_benchmark |
6 from chrome_remote_control import util | 6 from telemetry import util |
7 | 7 |
8 class SpaceportBenchmark(multi_page_benchmark.MultiPageBenchmark): | 8 class SpaceportBenchmark(multi_page_benchmark.MultiPageBenchmark): |
9 def CustomizeBrowserOptions(self, options): | 9 def CustomizeBrowserOptions(self, options): |
10 options.extra_browser_args.extend(['--disable-gpu-vsync']) | 10 options.extra_browser_args.extend(['--disable-gpu-vsync']) |
11 | 11 |
12 def MeasurePage(self, _, tab, results): | 12 def MeasurePage(self, _, tab, results): |
13 tab.runtime.Execute(""" | 13 tab.runtime.Execute(""" |
14 window.__results = {}; | 14 window.__results = {}; |
15 window.console.log = function(str) { | 15 window.console.log = function(str) { |
16 if (!str) return; | 16 if (!str) return; |
(...skipping 11 matching lines...) Expand all Loading... |
28 return num_tests_in_benchmark == len(result_dict) | 28 return num_tests_in_benchmark == len(result_dict) |
29 util.WaitFor(_IsDone, 1200) | 29 util.WaitFor(_IsDone, 1200) |
30 | 30 |
31 result_dict = eval(tab.runtime.Evaluate(js_get_results)) | 31 result_dict = eval(tab.runtime.Evaluate(js_get_results)) |
32 for key in result_dict: | 32 for key in result_dict: |
33 chart, trace = key.split('.', 1) | 33 chart, trace = key.split('.', 1) |
34 results.Add(trace, 'objects (bigger is better)', float(result_dict[key]), | 34 results.Add(trace, 'objects (bigger is better)', float(result_dict[key]), |
35 chart_name=chart, data_type='unimportant') | 35 chart_name=chart, data_type='unimportant') |
36 results.Add('Overall', 'objects (bigger is better)', | 36 results.Add('Overall', 'objects (bigger is better)', |
37 [float(x) for x in result_dict.values()]) | 37 [float(x) for x in result_dict.values()]) |
OLD | NEW |